Prevent health from wrapping around.

This commit is contained in:
EvilSeph 2012-10-28 23:55:40 -04:00
parent db49a57694
commit 442b7a69f1

View File

@ -1055,6 +1055,12 @@ public abstract class EntityLiving extends Entity {
}
public void b(NBTTagCompound nbttagcompound) {
// CraftBukkit start
if (this.health < -32768) {
this.health = -32768;
}
// CraftBukkit end
nbttagcompound.setShort("Health", (short) this.health);
nbttagcompound.setShort("HurtTime", (short) this.hurtTicks);
nbttagcompound.setShort("DeathTime", (short) this.deathTicks);
@ -1100,10 +1106,6 @@ public abstract class EntityLiving extends Entity {
}
public void a(NBTTagCompound nbttagcompound) {
if (this.health < -32768) {
this.health = -32768;
}
this.health = nbttagcompound.getShort("Health");
if (!nbttagcompound.hasKey("Health")) {
this.health = this.getMaxHealth();