diff --git a/common/buildcraft/core/inventory/TransactorSimple.java b/common/buildcraft/core/inventory/TransactorSimple.java index d077b8da..13f23974 100644 --- a/common/buildcraft/core/inventory/TransactorSimple.java +++ b/common/buildcraft/core/inventory/TransactorSimple.java @@ -63,12 +63,12 @@ public class TransactorSimple extends Transactor { } protected int getEmptySlot(ItemStack stack, ForgeDirection orientation, int slotIndex) { - return getEmptySlot(0, inventory.getSizeInventory()); + return getEmptySlot(stack, 0, inventory.getSizeInventory()); } - protected int getEmptySlot(int startSlot, int endSlot) { + protected int getEmptySlot(ItemStack stack, int startSlot, int endSlot) { for (int i = startSlot; i < endSlot; i++) - if (inventory.getStackInSlot(i) == null) + if (inventory.getStackInSlot(i) == null && inventory.isStackValidForSlot(i, stack)) return i; return -1; diff --git a/common/buildcraft/core/inventory/TransactorVanillaSided.java b/common/buildcraft/core/inventory/TransactorVanillaSided.java index faa862ef..c586b6c0 100644 --- a/common/buildcraft/core/inventory/TransactorVanillaSided.java +++ b/common/buildcraft/core/inventory/TransactorVanillaSided.java @@ -32,7 +32,7 @@ public class TransactorVanillaSided extends TransactorSimple { if (slotIndex >= sideSlots.length) return -1; int targetSlot = sideSlots[slotIndex]; - return sided.canInsertItem(targetSlot, stack, orientation.ordinal()) ? targetSlot : -1; + return sided.isStackValidForSlot(targetSlot, stack) && sided.canInsertItem(targetSlot, stack, orientation.ordinal()) ? targetSlot : -1; } }