2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/level/block/BlockCake.java
|
|
|
|
+++ b/net/minecraft/world/level/block/BlockCake.java
|
2022-06-07 18:00:00 +02:00
|
|
|
@@ -85,7 +85,18 @@
|
2019-12-10 23:00:00 +01:00
|
|
|
return EnumInteractionResult.PASS;
|
2016-11-17 02:41:03 +01:00
|
|
|
} else {
|
2021-11-21 23:00:00 +01:00
|
|
|
entityhuman.awardStat(StatisticList.EAT_CAKE_SLICE);
|
2014-11-25 22:32:16 +01:00
|
|
|
- entityhuman.getFoodData().eat(2, 0.1F);
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ // entityhuman.getFoodData().eat(2, 0.1F);
|
|
|
|
+ int oldFoodLevel = entityhuman.getFoodData().foodLevel;
|
|
|
|
+
|
|
|
|
+ org.bukkit.event.entity.FoodLevelChangeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callFoodLevelChangeEvent(entityhuman, 2 + oldFoodLevel);
|
|
|
|
+
|
|
|
|
+ if (!event.isCancelled()) {
|
|
|
|
+ entityhuman.getFoodData().eat(event.getFoodLevel() - oldFoodLevel, 0.1F);
|
|
|
|
+ }
|
|
|
|
+
|
2021-03-15 23:00:00 +01:00
|
|
|
+ ((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().sendHealthUpdate();
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit end
|
2021-11-21 23:00:00 +01:00
|
|
|
int i = (Integer) iblockdata.getValue(BlockCake.BITES);
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2022-06-07 18:00:00 +02:00
|
|
|
generatoraccess.gameEvent((Entity) entityhuman, GameEvent.EAT, blockposition);
|