Fixed decrStackSize bug on crafting table
This commit is contained in:
parent
40eb640386
commit
f5cd8053e4
1 changed files with 8 additions and 12 deletions
|
@ -63,18 +63,14 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
|
||||
ItemStack newStack = stackList[i].copy();
|
||||
newStack.stackSize = j;
|
||||
|
||||
stackList[i].stackSize -= j;
|
||||
|
||||
if (stackList[i].stackSize == 0) {
|
||||
stackList[i] = null;
|
||||
}
|
||||
|
||||
return newStack;
|
||||
public ItemStack decrStackSize(int slotId, int count) {
|
||||
if (stackList[slotId] == null)
|
||||
return null;
|
||||
if (stackList[slotId].stackSize > count)
|
||||
return stackList[slotId].splitStack(count);
|
||||
ItemStack stack = stackList[slotId];
|
||||
stackList[slotId] = null;
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue