From 2191df7918cdd08bbc1e2d1fc038cf82ebd2ab64 Mon Sep 17 00:00:00 2001 From: Justin Aquadro Date: Mon, 5 Sep 2016 00:29:53 -0400 Subject: [PATCH] Fix controller not starting empty slot when existing slot is full --- .../block/tile/TileEntityController.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/com/jaquadro/minecraft/storagedrawers/block/tile/TileEntityController.java b/src/com/jaquadro/minecraft/storagedrawers/block/tile/TileEntityController.java index b89e737..ac129a7 100644 --- a/src/com/jaquadro/minecraft/storagedrawers/block/tile/TileEntityController.java +++ b/src/com/jaquadro/minecraft/storagedrawers/block/tile/TileEntityController.java @@ -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; + } } }