diff --git a/src/com/jaquadro/minecraft/storagedrawers/block/tile/TileEntityDrawersComp.java b/src/com/jaquadro/minecraft/storagedrawers/block/tile/TileEntityDrawersComp.java index 359129d..864a0aa 100644 --- a/src/com/jaquadro/minecraft/storagedrawers/block/tile/TileEntityDrawersComp.java +++ b/src/com/jaquadro/minecraft/storagedrawers/block/tile/TileEntityDrawersComp.java @@ -212,6 +212,9 @@ public class TileEntityDrawersComp extends TileEntityDrawers protoStack[slot] = stack.copy(); //centralInventory.setStoredItem(slot, stack, 0); //getDrawer(slot).setStoredItem(stack, 0); + + if (worldObj != null && worldObj.isRemote) + getWorldObj().func_147479_m(xCoord, yCoord, zCoord); // markBlockForRenderUpdate } private ItemStack findHigherTier (ItemStack stack) { @@ -341,7 +344,7 @@ public class TileEntityDrawersComp extends TileEntityDrawers } if (match != null) { - setupLookup(lookup1, stack); + setupLookup(lookup1, output); List compMatches = findAllMatchingRecipes(lookup1); for (ItemStack comp : compMatches) { if (DrawerData.areItemsEqual(match, comp, true) && comp.stackSize == recipe.getRecipeSize()) { diff --git a/src/com/jaquadro/minecraft/storagedrawers/block/tile/TileEntitySlave.java b/src/com/jaquadro/minecraft/storagedrawers/block/tile/TileEntitySlave.java index 3377922..8dba8de 100644 --- a/src/com/jaquadro/minecraft/storagedrawers/block/tile/TileEntitySlave.java +++ b/src/com/jaquadro/minecraft/storagedrawers/block/tile/TileEntitySlave.java @@ -4,6 +4,7 @@ import com.jaquadro.minecraft.storagedrawers.api.inventory.IDrawerInventory; import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawer; import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawerGroup; import com.jaquadro.minecraft.storagedrawers.api.storage.IPriorityGroup; +import com.jaquadro.minecraft.storagedrawers.api.storage.ISmartGroup; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; @@ -14,7 +15,7 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.Constants; -public class TileEntitySlave extends TileEntity implements IDrawerGroup, IPriorityGroup, ISidedInventory +public class TileEntitySlave extends TileEntity implements IDrawerGroup, IPriorityGroup, ISmartGroup, ISidedInventory { private BlockCoord controllerCoord; private BlockCoord selfCoord; @@ -256,6 +257,24 @@ public class TileEntitySlave extends TileEntity implements IDrawerGroup, IPriori return controller.getDrawerInventory(); } + @Override + public Iterable enumerateDrawersForInsertion (ItemStack stack, boolean strict) { + TileEntityController controller = getController(); + if (controller == null || !controller.isValidSlave(selfCoord)) + return null; + + return controller.enumerateDrawersForInsertion(stack, strict); + } + + @Override + public Iterable enumerateDrawersForExtraction (ItemStack stack, boolean strict) { + TileEntityController controller = getController(); + if (controller == null || !controller.isValidSlave(selfCoord)) + return null; + + return controller.enumerateDrawersForExtraction(stack, strict); + } + @Override public void markDirty () { TileEntityController controller = getController();