From 8447f3ec6337210630b02b43e6db3c1a9eb2b361 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 13 Jun 2013 15:56:15 +1000 Subject: [PATCH] Bracket hell, thanks @sleaker. --- CraftBukkit-Patches/0047-Fix-Health-Scaling.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CraftBukkit-Patches/0047-Fix-Health-Scaling.patch b/CraftBukkit-Patches/0047-Fix-Health-Scaling.patch index f4acf284b..ad5bc0553 100644 --- a/CraftBukkit-Patches/0047-Fix-Health-Scaling.patch +++ b/CraftBukkit-Patches/0047-Fix-Health-Scaling.patch @@ -1,4 +1,4 @@ -From 45bf0bbac3ca8a8dfc69872101ccdc25b2a5adf5 Mon Sep 17 00:00:00 2001 +From 56c99746881104116854c2ac2ebaac742fbcf8dc Mon Sep 17 00:00:00 2001 From: Nick Minkler Date: Sun, 2 Jun 2013 14:54:11 +1000 Subject: [PATCH] Fix Health Scaling @@ -6,7 +6,7 @@ Subject: [PATCH] Fix Health Scaling Fix scaled health sending incorrect values to client. No longer attempts to scale health above maximum. Hopefully fixes 'flash' when player eats food. diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 35f3fea..526b59f 100644 +index 35f3fea..ae9415c 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -423,7 +423,10 @@ public abstract class EntityLiving extends Entity { @@ -15,7 +15,7 @@ index 35f3fea..526b59f 100644 if (this.maxHealth != this.getMaxHealth() && this.getHealth() > 0) { - return this.getHealth() * this.getMaxHealth() / this.maxHealth + 1; + // Spigot start -+ int health = (int) (((double) this.getHealth()) / this.maxHealth) * this.getMaxHealth(); ++ int health = (int) ((((double) this.getHealth()) / this.maxHealth) * this.getMaxHealth()); + return health > 0 ? health : 1; + // Spigot end } else {