summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-07-01 11:20:31 +1000
committermd_5 <git@md-5.net>2016-07-01 11:20:31 +1000
commit45038571f9022e92cda3cdadebef98f90b7b0424 (patch)
treeaf3fb9e2f1d2c8c9be9f8a398db970cbf97cb5d8 /src/main/java/org/bukkit
parent8db0dbfc44231627c6095a72fcc8eebe04e5fd3e (diff)
downloadcraftbukkit-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.java6
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;