Fix controller not starting empty slot when existing slot is full

This commit is contained in:
Justin Aquadro committed 2016-09-05 00:29:53 -04:00
1 parent 0bebb18c91
commit 2191df7918
1 file changed
+14 -4
@@ -782,8 +782,13 @@ public class TileEntityController extends TileEntity implements IDrawerGroup, IP
continue;
IDrawerInventory candidateInventory = candidateGroup.getDrawerInventory();
if (candidateInventory.canInsertItem(candidate.slot, stack))
return false;
if (candidateInventory.canInsertItem(candidate.slot, stack)) {
IDrawer drawer = candidateGroup.getDrawer(candidate.slot);
if (drawer instanceof IVoidable && ((IVoidable) drawer).isVoid())
return false;
if (drawer.getRemainingCapacity() > 0)
return false;
}
}
}
@@ -889,8 +894,13 @@ public class TileEntityController extends TileEntity implements IDrawerGroup, IP
continue;
IDrawerInventory candidateInventory = candidateGroup.getDrawerInventory();
if (candidateInventory.isItemValidForSlot(candidate.slot, stack))
return false;
if (candidateInventory.isItemValidForSlot(candidate.slot, stack)) {
IDrawer drawer = candidateGroup.getDrawer(candidate.slot);
if (drawer instanceof IVoidable && ((IVoidable) drawer).isVoid())
return false;
if (drawer.getRemainingCapacity() > 0)
return false;
}
}
}