mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 14:04:51 +08:00
Update the client after a FoodLevelChange event is fired. Fixes BUKKIT-2510
This commit is contained in:
parent
9a4b85c931
commit
412b4624c3
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user