From 035c01e2229a1a67e56bc860d0e8004708f5af1e Mon Sep 17 00:00:00 2001 From: Richard Freimer Date: Sun, 3 May 2020 16:34:26 -0400 Subject: [PATCH] Fixed Hoppers not inserting fully into custom contains with slots that can hold more then max stack (#6631) --- .../minecraftforge/items/VanillaInventoryCodeHooks.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/minecraftforge/items/VanillaInventoryCodeHooks.java b/src/main/java/net/minecraftforge/items/VanillaInventoryCodeHooks.java index 7be6ec8427..440fb4b9a1 100644 --- a/src/main/java/net/minecraftforge/items/VanillaInventoryCodeHooks.java +++ b/src/main/java/net/minecraftforge/items/VanillaInventoryCodeHooks.java @@ -194,15 +194,13 @@ public class VanillaInventoryCodeHooks if (!destinationHopper.mayTransfer()) { int k = 0; -/* TODO TileEntityHopper patches - if (source instanceof TileEntityHopper) + if (source instanceof HopperTileEntity) { - if (destinationHopper.getLastUpdateTime() >= ((TileEntityHopper) source).getLastUpdateTime()) + if (destinationHopper.getLastUpdateTime() >= ((HopperTileEntity) source).getLastUpdateTime()) { k = 1; } } -*/ destinationHopper.setTransferCooldown(8 - k); } } @@ -225,7 +223,7 @@ public class VanillaInventoryCodeHooks for (int slot = 0; slot < itemHandler.getSlots(); slot++) { ItemStack stackInSlot = itemHandler.getStackInSlot(slot); - if (stackInSlot.isEmpty() || stackInSlot.getCount() != stackInSlot.getMaxStackSize()) + if (stackInSlot.isEmpty() || stackInSlot.getCount() < itemHandler.getSlotLimit(slot)) { return false; }