From 427e7b3b530121ebe6f4c345d705d8527d6c3d4f Mon Sep 17 00:00:00 2001 From: Tidy-Bear Date: Thu, 24 Jul 2025 14:06:48 +0800 Subject: [PATCH] Improve: Back to default behavior if the food can not be eaten when full. Signed-off-by: Tidy-Bear --- .../com/suppergerrie2/alwayseat/alwayseat/AlwaysEat.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/suppergerrie2/alwayseat/alwayseat/AlwaysEat.java b/src/main/java/com/suppergerrie2/alwayseat/alwayseat/AlwaysEat.java index dec88b6..4e0433e 100644 --- a/src/main/java/com/suppergerrie2/alwayseat/alwayseat/AlwaysEat.java +++ b/src/main/java/com/suppergerrie2/alwayseat/alwayseat/AlwaysEat.java @@ -47,13 +47,12 @@ public void rightClickItemEvent(PlayerInteractEvent.RightClickItem event) { Player player = event.getEntity(); - if(player.canEat(AlwaysEat.canEatItemWhenFull(itemstack, player))) { + if (AlwaysEat.canEatItemWhenFull(itemstack, player) // leaves no processing to default behavior if the food can not be eaten when full + && player.canEat(true) // seems to be always true, but it's still here to provide compatibility with other mods who may modify the logic + ) { player.startUsingItem(event.getHand()); event.setCanceled(true); event.setCancellationResult(InteractionResult.CONSUME); - } else { - event.setCanceled(true); - event.setCancellationResult(InteractionResult.FAIL); } }