diff options
author | T00thpick1 <t00thpick1dirko@gmail.com> | 2013-07-23 21:30:38 -0500 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2013-07-23 21:52:17 -0500 |
commit | 1192f2a53a20354e7d2292a1c710d6bfe779b600 (patch) | |
tree | 0a543ad3c73860cd3b5ccec64e429c85ca2bdd41 /src/main/java/net/minecraft/server/PlayerList.java | |
parent | 4ad3cdd4b5cfe90f319cfba6c4dabc9bff10a59d (diff) | |
download | craftbukkit-1192f2a53a20354e7d2292a1c710d6bfe779b600.tar craftbukkit-1192f2a53a20354e7d2292a1c710d6bfe779b600.tar.gz craftbukkit-1192f2a53a20354e7d2292a1c710d6bfe779b600.tar.lz craftbukkit-1192f2a53a20354e7d2292a1c710d6bfe779b600.tar.xz craftbukkit-1192f2a53a20354e7d2292a1c710d6bfe779b600.zip |
Add API to control scaled health. Adds BUKKIT-4590
This commit implements the ability to set the scale of hearts that the
client renders. When the Packet44UpdateAttributes packet is sent, the
max health attribute is replaced with a scaled version, to preserve the
scaled health illusion clientside.
In order to accurately display the scaled health for players, a true
health is stored within CraftPlayer, and the datawatcher now stores the
scaled health. The getHealth() method for players still returns their
true health.
Changed setHealth() within EntityLiving to appropriately handle health
for instances of EntityPlayer. Inlined a call to
setHealth(getMaxHealth()) within the EntityLiving constructor to work
around CraftEntity instantiation.
Additionally fixes the health values sent when eating food within
FoodMetaData and ItemFood, which previously sent the unscaled health;
this commit alters them to send the properly scaled health.
Additionally fixes BUKKIT-4535, BUKKIT-4536, and BUKKIT-4127
Diffstat (limited to 'src/main/java/net/minecraft/server/PlayerList.java')
-rw-r--r-- | src/main/java/net/minecraft/server/PlayerList.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java index f24ba954..0f17c90c 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -981,7 +981,7 @@ public abstract class PlayerList { public void updateClient(EntityPlayer entityplayer) { entityplayer.updateInventory(entityplayer.defaultContainer); - entityplayer.triggerHealthUpdate(); + entityplayer.getBukkitEntity().updateScaledHealth(); // CraftBukkit - Update scaled health on respawn and worldchange entityplayer.playerConnection.sendPacket(new Packet16BlockItemSwitch(entityplayer.inventory.itemInHandIndex)); } |