fix autoeat kick when hungry in gui

This commit is contained in:
Jess H 2024-05-28 03:49:25 +01:00
parent e910229940
commit f7da34738c

View file

@ -66,7 +66,8 @@ public class AutoEat extends Feature {
private boolean isValid(ItemStack stack, int food) {
return stack.getItem() instanceof ItemFood
return mc.currentScreen != null && //fix
stack.getItem() instanceof ItemFood
&& !(stack.getItem() instanceof ItemChorusFruit)
&& ((20 - food)>=((ItemFood) stack.getItem()).getHealAmount(stack)
|| (stack.getItem() instanceof ItemAppleGold && mc.player.getHealth() < 19D)