3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 21:10:17 +01:00

Prevent health from wrapping around.

Dieser Commit ist enthalten in:
EvilSeph 2012-10-28 23:55:40 -04:00
Ursprung db49a57694
Commit 442b7a69f1

Datei anzeigen

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