diff options
author | Wesley Wolfe <weswolf@aol.com> | 2013-07-02 12:34:40 -0500 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2013-07-02 12:34:40 -0500 |
commit | 22adf8a3ce1a9482f44d9f1147e8b35535d3a2ff (patch) | |
tree | 06ea65a10524c0d8852e6007ee37655de3df99c9 /src/main/java/org | |
parent | e79d26d7d74bf5fa5cd1c1a8de7eaba84f37fd2e (diff) | |
download | craftbukkit-22adf8a3ce1a9482f44d9f1147e8b35535d3a2ff.tar craftbukkit-22adf8a3ce1a9482f44d9f1147e8b35535d3a2ff.tar.gz craftbukkit-22adf8a3ce1a9482f44d9f1147e8b35535d3a2ff.tar.lz craftbukkit-22adf8a3ce1a9482f44d9f1147e8b35535d3a2ff.tar.xz craftbukkit-22adf8a3ce1a9482f44d9f1147e8b35535d3a2ff.zip |
Rework max health values. Fixes BUKKIT-4398
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index bd00911b..da7a2af9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -19,6 +19,7 @@ import net.minecraft.server.EntitySnowball; import net.minecraft.server.EntityPlayer; import net.minecraft.server.EntityPotion; import net.minecraft.server.EntityWitherSkull; +import net.minecraft.server.GenericAttributes; import net.minecraft.server.MobEffect; import net.minecraft.server.MobEffectList; import net.minecraft.server.Packet42RemoveMobEffect; @@ -83,13 +84,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { } public double getMaxHealth() { - return getHandle().maxHealth; + return getHandle().getMaxHealth(); } public void setMaxHealth(double amount) { Validate.isTrue(amount > 0, "Max health must be greater than 0"); - getHandle().maxHealth = (float) amount; + getHandle().a(GenericAttributes.a).a(amount); if (getHealth() > amount) { setHealth(amount); |