Fixed stack issue with Quantum/Digital Chest
This commit is contained in:
parent
7e07320844
commit
d9654782fe
2 changed files with 6 additions and 7 deletions
|
@ -54,7 +54,7 @@ public class TileDigitalChest extends TileMachineBase implements IInventory,
|
|||
|
||||
if (getStackInSlot(0) != null)
|
||||
{
|
||||
if (storedItem == null && getStackInSlot(1) == null)
|
||||
if (storedItem == null)
|
||||
{
|
||||
storedItem = getStackInSlot(0);
|
||||
setInventorySlotContents(0, null);
|
||||
|
|
|
@ -54,7 +54,7 @@ public class TileQuantumChest extends TileMachineBase implements IInventory,
|
|||
|
||||
if (getStackInSlot(0) != null)
|
||||
{
|
||||
if (storedItem == null && getStackInSlot(1) == null)
|
||||
if (storedItem == null)
|
||||
{
|
||||
storedItem = getStackInSlot(0);
|
||||
setInventorySlotContents(0, null);
|
||||
|
@ -75,7 +75,8 @@ public class TileQuantumChest extends TileMachineBase implements IInventory,
|
|||
itemStack.stackSize = itemStack.getMaxStackSize();
|
||||
setInventorySlotContents(1, itemStack);
|
||||
storedItem.stackSize -= itemStack.getMaxStackSize();
|
||||
} else if (ItemUtils.isItemEqual(getStackInSlot(1), storedItem, true, true))
|
||||
}
|
||||
else if (ItemUtils.isItemEqual(getStackInSlot(1), storedItem, true, true))
|
||||
{
|
||||
int wanted = getStackInSlot(1).getMaxStackSize() - getStackInSlot(1).stackSize;
|
||||
if (storedItem.stackSize >= wanted)
|
||||
|
@ -100,10 +101,8 @@ public class TileQuantumChest extends TileMachineBase implements IInventory,
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net,
|
||||
S35PacketUpdateTileEntity packet) {
|
||||
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord,
|
||||
yCoord, zCoord);
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) {
|
||||
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
|
||||
readFromNBT(packet.func_148857_g());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue