4444import net .minecraft .client .player .ClientInput ;
4545import net .minecraft .core .BlockPos ;
4646import net .minecraft .core .Direction ;
47- import net .minecraft .core .component .DataComponents ;
4847import net .minecraft .network .chat .Component ;
4948import net .minecraft .network .chat .MutableComponent ;
5049import net .minecraft .network .protocol .game .ClientboundContainerSetContentPacket ;
@@ -1168,7 +1167,7 @@ protected void tick(HighwayBuilder b) {
11681167 eject = false ;
11691168 break ;
11701169 }
1171- if (stack . has ( DataComponents . FOOD ) && !Modules .get ().get (AutoEat .class ).blacklist .get ().contains (stack .getItem ())) {
1170+ if (Utils . isFood ( stack ) && !Modules .get ().get (AutoEat .class ).blacklist .get ().contains (stack .getItem ())) {
11721171 eject = false ;
11731172 break ;
11741173 }
@@ -1431,7 +1430,7 @@ protected void start(HighwayBuilder b) {
14311430 stop = false ;
14321431 break ;
14331432 }
1434- if (b .restockTask .food && stack . has ( DataComponents . FOOD ) && !Modules .get ().get (AutoEat .class ).blacklist .get ().contains (stack .getItem ())) {
1433+ if (b .restockTask .food && Utils . isFood ( stack ) && !Modules .get ().get (AutoEat .class ).blacklist .get ().contains (stack .getItem ())) {
14351434 stop = false ;
14361435 break ;
14371436 }
@@ -1451,7 +1450,7 @@ protected void start(HighwayBuilder b) {
14511450 boolean restockOccurred = (
14521451 (b .restockTask .materials && (hasItem (b , stack -> stack .getItem () instanceof BlockItem bi && b .blocksToPlace .get ().contains (bi .getBlock ())) || b .blocksToPlace .get ().contains (Blocks .OBSIDIAN ) && countItem (b , itemStack -> itemStack .getItem () == Items .ENDER_CHEST ) > b .saveEchests .get ())) ||
14531452 (b .restockTask .pickaxes && countItem (b , itemStack -> itemStack .is (ItemTags .PICKAXES )) > b .savePickaxes .get ()) ||
1454- (b .restockTask .food && hasItem (b , itemStack -> itemStack . has ( DataComponents . FOOD ) && !Modules .get ().get (AutoEat .class ).blacklist .get ().contains (itemStack .getItem ())))
1453+ (b .restockTask .food && hasItem (b , itemStack -> Utils . isFood ( itemStack ) && !Modules .get ().get (AutoEat .class ).blacklist .get ().contains (itemStack .getItem ())))
14551454 );
14561455
14571456 if (restockOccurred ) {
@@ -1529,7 +1528,7 @@ protected void tick(HighwayBuilder b) {
15291528 if (b .restockTask .pickaxes )
15301529 slotsPulled += countSlots (b , itemStack -> itemStack .is (ItemTags .PICKAXES )) - b .savePickaxes .get ();
15311530 if (b .restockTask .food )
1532- slotsPulled += countSlots (b , itemStack -> itemStack . has ( DataComponents . FOOD ) && !Modules .get ().get (AutoEat .class ).blacklist .get ().contains (itemStack .getItem ()));
1531+ slotsPulled += countSlots (b , itemStack -> Utils . isFood ( itemStack ) && !Modules .get ().get (AutoEat .class ).blacklist .get ().contains (itemStack .getItem ()));
15331532
15341533
15351534 // whether we have pulled the minimum amount of items we want
@@ -1644,7 +1643,7 @@ private boolean restockItems(HighwayBuilder b, Container inv) {
16441643 if (grabFromInventory (inv , itemStack -> itemStack .is (ItemTags .PICKAXES ))) return true ;
16451644 }
16461645 if (b .restockTask .food ) {
1647- return grabFromInventory (inv , itemStack -> itemStack . has ( DataComponents . FOOD ) && !Modules .get ().get (AutoEat .class ).blacklist .get ().contains (itemStack .getItem ()));
1646+ return grabFromInventory (inv , itemStack -> Utils . isFood ( itemStack ) && !Modules .get ().get (AutoEat .class ).blacklist .get ().contains (itemStack .getItem ()));
16481647 }
16491648
16501649 return false ;
@@ -1673,7 +1672,7 @@ private void setShulkerPredicate(HighwayBuilder b) {
16731672 return true ;
16741673 }
16751674 if (b .restockTask .pickaxes && stack .is (ItemTags .PICKAXES )) return true ;
1676- if (b .restockTask .food && stack . has ( DataComponents . FOOD ) && !Modules .get ().get (AutoEat .class ).blacklist .get ().contains (stack .getItem ()))
1675+ if (b .restockTask .food && Utils . isFood ( stack ) && !Modules .get ().get (AutoEat .class ).blacklist .get ().contains (stack .getItem ()))
16771676 return true ;
16781677 }
16791678
0 commit comments