File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
common/src/main/java/com/mrcrayfish/controllable/client/overlay Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1717import net .minecraft .client .Minecraft ;
1818import net .minecraft .client .gui .GuiGraphics ;
1919import net .minecraft .client .gui .screens .inventory .AbstractContainerScreen ;
20+ import net .minecraft .core .component .DataComponents ;
2021import net .minecraft .network .chat .Component ;
22+ import net .minecraft .world .food .FoodProperties ;
2123import net .minecraft .world .inventory .Slot ;
2224import net .minecraft .world .item .BlockItem ;
2325import net .minecraft .world .item .ItemStack ;
@@ -260,7 +262,8 @@ else if(mc.screen == null)
260262 switch (currentItem .getUseAnimation ())
261263 {
262264 case EAT :
263- if (mc .player .getFoodData ().needsFood ())
265+ FoodProperties properties = currentItem .get (DataComponents .FOOD );
266+ if (properties != null && mc .player .canEat (properties .canAlwaysEat ()))
264267 {
265268 actionMap .put (ButtonBindings .USE_ITEM , new Action (ActionDescriptions .EAT , Action .Side .RIGHT ));
266269 }
You can’t perform that action at this time.
0 commit comments