diff options
author | md_5 <git@md-5.net> | 2016-07-01 11:20:31 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-07-01 11:20:31 +1000 |
commit | 45038571f9022e92cda3cdadebef98f90b7b0424 (patch) | |
tree | af3fb9e2f1d2c8c9be9f8a398db970cbf97cb5d8 /src/main/java/org/bukkit | |
parent | 8db0dbfc44231627c6095a72fcc8eebe04e5fd3e (diff) | |
download | craftbukkit-45038571f9022e92cda3cdadebef98f90b7b0424.tar craftbukkit-45038571f9022e92cda3cdadebef98f90b7b0424.tar.gz craftbukkit-45038571f9022e92cda3cdadebef98f90b7b0424.tar.lz craftbukkit-45038571f9022e92cda3cdadebef98f90b7b0424.tar.xz craftbukkit-45038571f9022e92cda3cdadebef98f90b7b0424.zip |
SPIGOT-1341: Cancelled cake interact decreases client hunger
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index b93ff63c..f65c4de0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1304,12 +1304,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { injectScaledMaxHealth(set, true); getHandle().getDataWatcher().set(EntityLiving.HEALTH, (float) getScaledHealth()); - getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateHealth(getScaledHealth(), getHandle().getFoodData().getFoodLevel(), getHandle().getFoodData().getSaturationLevel())); + sendHealthUpdate(); getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateAttributes(getHandle().getId(), set)); getHandle().maxHealthCache = getMaxHealth(); } + public void sendHealthUpdate() { + getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateHealth(getScaledHealth(), getHandle().getFoodData().getFoodLevel(), getHandle().getFoodData().getSaturationLevel())); + } + public void injectScaledMaxHealth(Collection collection, boolean force) { if (!scaledHealth && !force) { return; |