diff --git a/common/crazypants/enderio/conduit/gui/ExternalConnectionContainer.java b/common/crazypants/enderio/conduit/gui/ExternalConnectionContainer.java index 8a4b6788..04c66937 100644 --- a/common/crazypants/enderio/conduit/gui/ExternalConnectionContainer.java +++ b/common/crazypants/enderio/conduit/gui/ExternalConnectionContainer.java @@ -32,10 +32,31 @@ public class ExternalConnectionContainer extends Container { this.dir = dir; itemConduit = bundle.getConduit(IItemConduit.class); - if(itemConduit == null) { - return; + if(itemConduit != null) { + addFilterSlots(dir); } + int topY = 113; + // add players inventory + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 9; ++j) { + int x = 8 + j * 18; + int y = topY + i * 18; + addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, x, y)); + slotLocations.add(new Point(x, y)); + } + } + + int y = 171; + for (int i = 0; i < 9; ++i) { + int x = 8 + i * 18; + addSlotToContainer(new Slot(playerInv, i, x, y)); + slotLocations.add(new Point(x, y)); + } + + } + + private void addFilterSlots(ForgeDirection dir) { boolean isAdvanced = itemConduit.getMetaData() == 1; inputFilter = itemConduit.getInputFilter(dir); @@ -76,25 +97,6 @@ public class ExternalConnectionContainer extends Container { index++; } } - - topY = 113; - // add players inventory - for (int i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - int x = 8 + j * 18; - int y = topY + i * 18; - addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, x, y)); - slotLocations.add(new Point(x, y)); - } - } - - int y = 171; - for (int i = 0; i < 9; ++i) { - int x = 8 + i * 18; - addSlotToContainer(new Slot(playerInv, i, x, y)); - slotLocations.add(new Point(x, y)); - } - } public void setInputSlotsVisible(boolean visible) { diff --git a/common/crazypants/enderio/machine/painter/BlockCustomStair.java b/common/crazypants/enderio/machine/painter/BlockCustomStair.java index 22f82c67..e0917fb9 100644 --- a/common/crazypants/enderio/machine/painter/BlockCustomStair.java +++ b/common/crazypants/enderio/machine/painter/BlockCustomStair.java @@ -154,7 +154,7 @@ public class BlockCustomStair extends BlockStairs implements ITileEntityProvider TileEntity te = world.getBlockTileEntity(x, y, z); if(te instanceof TileEntityCustomBlock) { TileEntityCustomBlock tef = (TileEntityCustomBlock) te; - if(tef.getSourceBlockId() > 0 && tef.getSourceBlockId() < Block.blocksList.length) { + if(tef.getSourceBlockId() > 0 && tef.getSourceBlockId() < Block.blocksList.length && blocksList[tef.getSourceBlockId()] != null) { return blocksList[tef.getSourceBlockId()].getIcon(blockSide, tef.getSourceBlockMetadata()); } }