adv. assembly workbench: Match vanilla getStackInSlot behavior
The vanilla implementation checks for out of bound access and returns null in that case. This fixes the following incompatibility: http://pastie.org/private/mn2yefhc5yddahbkxgcqw
This commit is contained in:
parent
374aa6ebc1
commit
e5c1af707f
1 changed files with 11 additions and 5 deletions
|
@ -45,15 +45,21 @@ public class TileAssemblyAdvancedWorkbench extends TileEntity implements IInvent
|
|||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int par1) {
|
||||
if (tempStacks != null) {
|
||||
if (par1 >= 0 && par1 < 9) {
|
||||
if (bindings[par1] >= 0)
|
||||
if (tempStacks != null) {
|
||||
if (bindings[par1] >= 0) {
|
||||
return tempStacks[bindings[par1]];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// unbound returns null
|
||||
} else {
|
||||
return craftingSlots.getStackInSlot(par1);
|
||||
}
|
||||
}
|
||||
|
||||
// vanilla returns null for out of bound stacks in InventoryCrafting as well
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int par1, ItemStack par2ItemStack) {
|
||||
|
|
Loading…
Reference in a new issue