mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-28 07:55:41 +00:00
Fixed crash when opening new UI.
This commit is contained in:
1 parent
afebe7c2f3
commit
7640bb298a
2 files changed
+24
-22
No files matched your search
@@ -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) {
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user