diff options
author | md_5 <git@md-5.net> | 2017-01-28 11:41:09 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2017-01-28 11:41:09 +1100 |
commit | c1aa85918e6683fa0d8677feb733ba8743c40502 (patch) | |
tree | 009abc6fcc4ee6fc8018e94a4265ba12f5712cce /src | |
parent | 80dd971b5240b40838dd10c389d311490069eaa5 (diff) | |
download | craftbukkit-c1aa85918e6683fa0d8677feb733ba8743c40502.tar craftbukkit-c1aa85918e6683fa0d8677feb733ba8743c40502.tar.gz craftbukkit-c1aa85918e6683fa0d8677feb733ba8743c40502.tar.lz craftbukkit-c1aa85918e6683fa0d8677feb733ba8743c40502.tar.xz craftbukkit-c1aa85918e6683fa0d8677feb733ba8743c40502.zip |
SPIGOT-3040: Round health to float for validation
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 4641e3d5..58fbed1d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -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) { |