aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/CakeBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/CakeBlock.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/CakeBlock.java.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/CakeBlock.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/CakeBlock.java.patch
new file mode 100644
index 0000000000..1e895b0276
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/CakeBlock.java.patch
@@ -0,0 +1,27 @@
+--- a/net/minecraft/world/level/block/CakeBlock.java
++++ b/net/minecraft/world/level/block/CakeBlock.java
+@@ -96,9 +92,21 @@
+ return InteractionResult.PASS;
+ } else {
+ player.awardStat(Stats.EAT_CAKE_SLICE);
+- player.getFoodData().eat(2, 0.1F);
+- int i = state.getValue(BITES);
+- level.gameEvent(player, GameEvent.EAT, pos);
++ // CraftBukkit start
++ // entityhuman.getFoodData().eat(2, 0.1F);
++ int oldFoodLevel = player.getFoodData().foodLevel;
++
++ org.bukkit.event.entity.FoodLevelChangeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callFoodLevelChangeEvent(player, 2 + oldFoodLevel);
++
++ if (!event.isCancelled()) {
++ player.getFoodData().eat(event.getFoodLevel() - oldFoodLevel, 0.1F);
++ }
++
++ ((net.minecraft.server.level.ServerPlayer) player).getBukkitEntity().sendHealthUpdate();
++ // CraftBukkit end
++ int i = (Integer) state.getValue(CakeBlock.BITES);
++
++ level.gameEvent((Entity) player, GameEvent.EAT, pos);
+ if (i < 6) {
+ level.setBlock(pos, state.setValue(BITES, Integer.valueOf(i + 1)), 3);
+ } else {