summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvilSeph <evilseph@gmail.com>2012-09-12 21:56:06 -0400
committerEvilSeph <evilseph@gmail.com>2012-09-12 22:06:36 -0400
commit412b4624c30208119cc1152fdd67811fb7a3cbd5 (patch)
tree14a7ea126862e7a6bd21570842b81cda5a5ca5e5
parent9a4b85c931741dbbb8c163c38d5d218974076115 (diff)
downloadcraftbukkit-412b4624c30208119cc1152fdd67811fb7a3cbd5.tar
craftbukkit-412b4624c30208119cc1152fdd67811fb7a3cbd5.tar.gz
craftbukkit-412b4624c30208119cc1152fdd67811fb7a3cbd5.tar.lz
craftbukkit-412b4624c30208119cc1152fdd67811fb7a3cbd5.tar.xz
craftbukkit-412b4624c30208119cc1152fdd67811fb7a3cbd5.zip
Update the client after a FoodLevelChange event is fired. Fixes BUKKIT-2510
-rw-r--r--src/main/java/net/minecraft/server/FoodMetaData.java2
-rw-r--r--src/main/java/net/minecraft/server/ItemFood.java2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/FoodMetaData.java b/src/main/java/net/minecraft/server/FoodMetaData.java
index d2b3a8dc..30f3fb68 100644
--- a/src/main/java/net/minecraft/server/FoodMetaData.java
+++ b/src/main/java/net/minecraft/server/FoodMetaData.java
@@ -38,6 +38,8 @@ public class FoodMetaData {
if (!event.isCancelled()) {
this.foodLevel = event.getFoodLevel();
}
+
+ ((EntityPlayer) entityhuman).netServerHandler.sendPacket(new Packet8UpdateHealth(entityhuman.getHealth(), this.foodLevel, this.saturationLevel));
// CraftBukkit end
}
}
diff --git a/src/main/java/net/minecraft/server/ItemFood.java b/src/main/java/net/minecraft/server/ItemFood.java
index 287ce36f..ffe16976 100644
--- a/src/main/java/net/minecraft/server/ItemFood.java
+++ b/src/main/java/net/minecraft/server/ItemFood.java
@@ -35,6 +35,8 @@ public class ItemFood extends Item {
if (!event.isCancelled()) {
entityhuman.getFoodData().eat(event.getFoodLevel() - oldFoodLevel, this.getSaturationModifier());
}
+
+ ((EntityPlayer) entityhuman).netServerHandler.sendPacket(new Packet8UpdateHealth(entityhuman.getHealth(), entityhuman.getFoodData().foodLevel, entityhuman.getFoodData().saturationLevel));
// CraftBukkit end
world.makeSound(entityhuman, "random.burp", 0.5F, world.random.nextFloat() * 0.1F + 0.9F);