Implement entity max health methods. Adds BUKKIT-266

This commit is contained in:
feildmaster
2012-12-23 05:49:03 -06:00
parent 4e1793f363
commit ced0646351
10 changed files with 92 additions and 18 deletions

View File

@@ -205,7 +205,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
if (this.getHealth() != this.cl || this.cm != this.foodData.a() || this.foodData.e() == 0.0F != this.cn) {
this.playerConnection.sendPacket(new Packet8UpdateHealth(this.getHealth(), this.foodData.a(), this.foodData.e()));
// CraftBukkit - this.getHealth() -> this.getScaledHealth()
this.playerConnection.sendPacket(new Packet8UpdateHealth(this.getScaledHealth(), this.foodData.a(), this.foodData.e()));
this.cl = this.getHealth();
this.cm = this.foodData.a();
this.cn = this.foodData.e() == 0.0F;
@@ -773,7 +774,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.newLevel = this.expLevel;
}
this.health = 20;
this.health = this.maxHealth;
this.fireTicks = 0;
this.fallDistance = 0;
this.foodData = new FoodMetaData();