mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 03:52:45 +01:00
SPIGOT-3040: Round health to float for validation
By: md_5 <git@md-5.net>
This commit is contained in:
parent
4166ac5145
commit
634ad7d00e
1 changed files with 2 additions and 1 deletions
|
@ -91,8 +91,9 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|||
}
|
||||
|
||||
public void setHealth(double health) {
|
||||
health = (float) health;
|
||||
if ((health < 0) || (health > getMaxHealth())) {
|
||||
throw new IllegalArgumentException("Health must be between 0 and " + getMaxHealth());
|
||||
throw new IllegalArgumentException("Health must be between 0 and " + getMaxHealth() + "(" + health + ")");
|
||||
}
|
||||
|
||||
if (health == 0) {
|
||||
|
|
Loading…
Reference in a new issue