Rework max health values. Fixes BUKKIT-4398

This commit is contained in:
Wesley Wolfe
2013-07-02 12:34:40 -05:00
parent e79d26d7d7
commit 22adf8a3ce
12 changed files with 21 additions and 60 deletions

View File

@@ -351,8 +351,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
--this.br;
}
// CraftBukkit - this.getMaxHealth() -> this.maxHealth
if (this.world.difficulty == 0 && this.getHealth() < this.maxHealth && this.world.getGameRules().getBoolean("naturalRegeneration") && this.ticksLived % 20 * 12 == 0) {
if (this.world.difficulty == 0 && this.getHealth() < this.getMaxHealth() && this.world.getGameRules().getBoolean("naturalRegeneration") && this.ticksLived % 20 * 12 == 0) {
// CraftBukkit - added regain reason of "REGEN" for filtering purposes.
this.heal(1.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.REGEN);
}
@@ -1402,7 +1401,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
}
public boolean bE() {
return this.getHealth() > 0.0F && this.getHealth() < this.maxHealth; // CraftBukkit - this.getMaxHealth() -> this.maxHealth
return this.getHealth() > 0.0F && this.getHealth() < this.getMaxHealth();
}
public void a(ItemStack itemstack, int i) {