Update the client after a FoodLevelChange event is fired. Fixes BUKKIT-2510

This commit is contained in:
EvilSeph 2012-09-12 21:56:06 -04:00
parent 9a4b85c931
commit 412b4624c3
2 changed files with 4 additions and 0 deletions

View File

@ -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
}
}

View File

@ -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);