Skip to content

Commit

Permalink
Fixed Double Chest Order not being respected
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryLoenwind committed Mar 31, 2016
1 parent 91a4936 commit 64fde2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'EnderCore'
10 changes: 8 additions & 2 deletions src/main/java/com/enderio/core/common/util/ItemUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -450,19 +450,25 @@ public static IInventory getInventory(IInventory inv) {
if (inv instanceof TileEntityChest) {
TileEntityChest chest = (TileEntityChest) inv;
TileEntityChest neighbour = null;
boolean reverse = false;
if (chest.adjacentChestXNeg != null) {
neighbour = chest.adjacentChestXNeg;
reverse = true;
} else if (chest.adjacentChestXPos != null) {
neighbour = chest.adjacentChestXPos;
} else if (chest.adjacentChestZNeg != null) {
neighbour = chest.adjacentChestZNeg;
reverse = true;
} else if (chest.adjacentChestZPos != null) {
neighbour = chest.adjacentChestZPos;
}
if (neighbour != null) {
return new InventoryLargeChest("", (ILockableContainer)inv, (ILockableContainer)neighbour);
if (reverse) {
return new InventoryLargeChest("", (ILockableContainer) neighbour, (ILockableContainer) inv);
} else {
return new InventoryLargeChest("", (ILockableContainer) inv, (ILockableContainer) neighbour);
}
}
return inv;
}
return inv;
}
Expand Down

0 comments on commit 64fde2f

Please sign in to comment.