summaryrefslogtreecommitdiffstats
path: root/src/main/java/net
diff options
context:
space:
mode:
authorEvilSeph <evilseph@gmail.com>2012-10-28 23:55:40 -0400
committerEvilSeph <evilseph@gmail.com>2012-10-28 23:55:40 -0400
commit442b7a69f1130d0114226d30d081cfe6dc6d8e0a (patch)
treee0f5b75599aa95ca80b10eb1a87837bbdf39c058 /src/main/java/net
parentdb49a576946d58f7e7bcc41d716fd03b94459b63 (diff)
downloadcraftbukkit-442b7a69f1130d0114226d30d081cfe6dc6d8e0a.tar
craftbukkit-442b7a69f1130d0114226d30d081cfe6dc6d8e0a.tar.gz
craftbukkit-442b7a69f1130d0114226d30d081cfe6dc6d8e0a.tar.lz
craftbukkit-442b7a69f1130d0114226d30d081cfe6dc6d8e0a.tar.xz
craftbukkit-442b7a69f1130d0114226d30d081cfe6dc6d8e0a.zip
Prevent health from wrapping around.
Diffstat (limited to 'src/main/java/net')
-rw-r--r--src/main/java/net/minecraft/server/EntityLiving.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 884a797f..d6a4c169 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -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();