Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-16 04:50:05 +01:00
Update the client after a FoodLevelChange event is fired. Fixes BUKKIT-2510
Dieser Commit ist enthalten in:
Ursprung
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);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren