Fix crash when mods ask for the inventory without a specific side

This commit is contained in:
mezz committed 2016-06-15 00:03:20 -07:00
1 parent ce9081249f
commit 21d0b832b9
1 file changed
+4 -10
@@ -154,27 +154,21 @@ public class InventoryAdapter implements IInventoryAdapter, IStreamable {
}
/* ISIDEDINVENTORY */
private int[][] slotMap;
private int[] slotMap;
@Override
public int[] getSlotsForFace(EnumFacing side) {
if (allowAutomation) {
return slotMap[side.ordinal()];
return slotMap;
}
return Constants.SLOTS_NONE;
}
private void configureSided() {
slotMap = new int[6][0];
int count = getSizeInventory();
int[] slots = new int[count];
slotMap = new int[count];
for (int i = 0; i < count; i++) {
slots[i] = i;
}
for (EnumFacing side : EnumFacing.VALUES) {
slotMap[side.getIndex()] = slots;
slotMap[i] = i;
}
}