Incorrect brackets....

This commit is contained in:
md_5 2013-06-10 14:10:42 +10:00
parent 1fd79fc87e
commit 40287791c8

View File

@ -1,4 +1,4 @@
From 63114381d169d098a31955246c46cb665651e33b Mon Sep 17 00:00:00 2001
From 4645cf5de8a97078bfab381db000f82ae781ed8f Mon Sep 17 00:00:00 2001
From: Nick Minkler <sleaker@gmail.com>
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..ae9415c 100644
index 35f3fea..526b59f 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..ae9415c 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 {