Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
Prevent health from wrapping around.
Dieser Commit ist enthalten in:
Ursprung
db49a57694
Commit
442b7a69f1
@ -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();
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren