Fix NPE in ACT

Closes #1270
This commit is contained in:
CovertJaguar 2013-10-11 06:06:11 -07:00
parent 54b2e5de88
commit 9cb53f9405

View file

@ -72,7 +72,6 @@ public class TileAdvancedCraftingTable extends TileEntity implements IInventory,
if (useRecipeStack || tempStacks == null) { if (useRecipeStack || tempStacks == null) {
return craftingSlots.getStackInSlot(slot); return craftingSlots.getStackInSlot(slot);
} else { } else {
if (bindings[slot] >= 0) { if (bindings[slot] >= 0) {
return tempStacks[bindings[slot]]; return tempStacks[bindings[slot]];
} }
@ -85,14 +84,14 @@ public class TileAdvancedCraftingTable extends TileEntity implements IInventory,
@Override @Override
public void setInventorySlotContents(int slot, ItemStack par2ItemStack) { public void setInventorySlotContents(int slot, ItemStack par2ItemStack) {
if (tempStacks != null && slot >= 0 && slot < 9) { if (tempStacks != null && slot >= 0 && slot < 9 && bindings[slot] >= 0) {
tempStacks[bindings[slot]] = par2ItemStack; tempStacks[bindings[slot]] = par2ItemStack;
} }
} }
@Override @Override
public ItemStack decrStackSize(int slot, int amount) { public ItemStack decrStackSize(int slot, int amount) {
if (tempStacks != null && slot >= 0 && slot < 9) { if (tempStacks != null && slot >= 0 && slot < 9 && bindings[slot] >= 0) {
if (tempStacks[bindings[slot]].stackSize <= amount) { if (tempStacks[bindings[slot]].stackSize <= amount) {
ItemStack result = tempStacks[bindings[slot]]; ItemStack result = tempStacks[bindings[slot]];
tempStacks[bindings[slot]] = null; tempStacks[bindings[slot]] = null;