--- a/net/minecraft/world/level/block/CakeBlock.java
+++ b/net/minecraft/world/level/block/CakeBlock.java
@@ -8,6 +8,7 @@
 import net.minecraft.tags.ItemTags;
 import net.minecraft.world.InteractionHand;
 import net.minecraft.world.InteractionResult;
+import net.minecraft.world.entity.Entity;
 import net.minecraft.world.entity.player.Player;
 import net.minecraft.world.item.Item;
 import net.minecraft.world.item.ItemStack;
@@ -27,53 +28,56 @@
 import net.minecraft.world.phys.shapes.VoxelShape;
 
 public class CakeBlock extends Block {
+
     public static final int MAX_BITES = 6;
     public static final IntegerProperty BITES = BlockStateProperties.BITES;
-    public static final int FULL_CAKE_SIGNAL = getOutputSignal(0);
+    public static final int FULL_CAKE_SIGNAL = CakeBlock.getOutputSignal(0);
     protected static final float AABB_OFFSET = 1.0F;
     protected static final float AABB_SIZE_PER_BITE = 2.0F;
     protected static final VoxelShape[] SHAPE_BY_BITE = new VoxelShape[]{Block.box(1.0D, 0.0D, 1.0D, 15.0D, 8.0D, 15.0D), Block.box(3.0D, 0.0D, 1.0D, 15.0D, 8.0D, 15.0D), Block.box(5.0D, 0.0D, 1.0D, 15.0D, 8.0D, 15.0D), Block.box(7.0D, 0.0D, 1.0D, 15.0D, 8.0D, 15.0D), Block.box(9.0D, 0.0D, 1.0D, 15.0D, 8.0D, 15.0D), Block.box(11.0D, 0.0D, 1.0D, 15.0D, 8.0D, 15.0D), Block.box(13.0D, 0.0D, 1.0D, 15.0D, 8.0D, 15.0D)};
 
     protected CakeBlock(BlockBehaviour.Properties settings) {
         super(settings);
-        this.registerDefaultState(this.stateDefinition.any().setValue(BITES, Integer.valueOf(0)));
+        this.registerDefaultState((BlockState) ((BlockState) this.stateDefinition.any()).setValue(CakeBlock.BITES, 0));
     }
 
     @Override
     public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
-        return SHAPE_BY_BITE[state.getValue(BITES)];
+        return CakeBlock.SHAPE_BY_BITE[(Integer) state.getValue(CakeBlock.BITES)];
     }
 
     @Override
     public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
-        ItemStack itemStack = player.getItemInHand(hand);
-        Item item = itemStack.getItem();
-        if (itemStack.is(ItemTags.CANDLES) && state.getValue(BITES) == 0) {
+        ItemStack itemstack = player.getItemInHand(hand);
+        Item item = itemstack.getItem();
+
+        if (itemstack.is(ItemTags.CANDLES) && (Integer) state.getValue(CakeBlock.BITES) == 0) {
             Block block = Block.byItem(item);
+
             if (block instanceof CandleBlock) {
                 if (!player.isCreative()) {
-                    itemStack.shrink(1);
+                    itemstack.shrink(1);
                 }
 
-                world.playSound((Player)null, pos, SoundEvents.CAKE_ADD_CANDLE, SoundSource.BLOCKS, 1.0F, 1.0F);
+                world.playSound((Player) null, pos, SoundEvents.CAKE_ADD_CANDLE, SoundSource.BLOCKS, 1.0F, 1.0F);
                 world.setBlockAndUpdate(pos, CandleCakeBlock.byCandle(block));
-                world.gameEvent(player, GameEvent.BLOCK_CHANGE, pos);
+                world.gameEvent((Entity) player, GameEvent.BLOCK_CHANGE, pos);
                 player.awardStat(Stats.ITEM_USED.get(item));
                 return InteractionResult.SUCCESS;
             }
         }
 
         if (world.isClientSide) {
-            if (eat(world, pos, state, player).consumesAction()) {
+            if (CakeBlock.eat(world, pos, state, player).consumesAction()) {
                 return InteractionResult.SUCCESS;
             }
 
-            if (itemStack.isEmpty()) {
+            if (itemstack.isEmpty()) {
                 return InteractionResult.CONSUME;
             }
         }
 
-        return eat(world, pos, state, player);
+        return CakeBlock.eat(world, pos, state, player);
     }
 
     protected static InteractionResult eat(LevelAccessor world, BlockPos pos, BlockState state, Player player) {
@@ -81,14 +85,26 @@
             return InteractionResult.PASS;
         } else {
             player.awardStat(Stats.EAT_CAKE_SLICE);
-            player.getFoodData().eat(2, 0.1F);
-            int i = state.getValue(BITES);
-            world.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.v1_19_R2.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);
+
+            world.gameEvent((Entity) player, GameEvent.EAT, pos);
             if (i < 6) {
-                world.setBlock(pos, state.setValue(BITES, Integer.valueOf(i + 1)), 3);
+                world.setBlock(pos, (BlockState) state.setValue(CakeBlock.BITES, i + 1), 3);
             } else {
                 world.removeBlock(pos, false);
-                world.gameEvent(player, GameEvent.BLOCK_DESTROY, pos);
+                world.gameEvent((Entity) player, GameEvent.BLOCK_DESTROY, pos);
             }
 
             return InteractionResult.SUCCESS;
@@ -107,12 +123,12 @@
 
     @Override
     protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
-        builder.add(BITES);
+        builder.add(CakeBlock.BITES);
     }
 
     @Override
     public int getAnalogOutputSignal(BlockState state, Level world, BlockPos pos) {
-        return getOutputSignal(state.getValue(BITES));
+        return CakeBlock.getOutputSignal((Integer) state.getValue(CakeBlock.BITES));
     }
 
     public static int getOutputSignal(int bites) {
