setContents method, remove applyUpgradeItem
applyUpgradeItem is no longer needed because it's now being completely done from ItemChestChanger setContents added for ItemChestChanger
This commit is contained in:
parent
b4dd5d1a67
commit
a29c12ab84
|
@ -60,6 +60,16 @@ public class TileEntityIronChest extends TileEntityLockable implements IUpdatePl
|
||||||
return chestContents;
|
return chestContents;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setContents(ItemStack[] contents) {
|
||||||
|
chestContents = new ItemStack[getSizeInventory()];
|
||||||
|
for (int i = 0; i < contents.length; i ++) {
|
||||||
|
if (i < chestContents.length) {
|
||||||
|
chestContents[i] = contents[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
inventoryTouched = true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSizeInventory()
|
public int getSizeInventory()
|
||||||
{
|
{
|
||||||
|
@ -402,27 +412,6 @@ public class TileEntityIronChest extends TileEntityLockable implements IUpdatePl
|
||||||
this.facing = facing2;
|
this.facing = facing2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TileEntityIronChest applyUpgradeItem(ItemChestChanger itemChestChanger)
|
|
||||||
{
|
|
||||||
if (numUsingPlayers > 0)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (!itemChestChanger.getType().canUpgrade(this.getType()))
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
TileEntityIronChest newEntity = IronChestType.makeEntity(itemChestChanger.getTargetChestOrdinal(getType().ordinal()));
|
|
||||||
int newSize = newEntity.chestContents.length;
|
|
||||||
System.arraycopy(chestContents, 0, newEntity.chestContents, 0, Math.min(newSize, chestContents.length));
|
|
||||||
BlockIronChest block = IronChest.ironChestBlock;
|
|
||||||
block.dropContent(newSize, this, this.worldObj, pos);
|
|
||||||
newEntity.setFacing(facing);
|
|
||||||
newEntity.sortTopStacks();
|
|
||||||
newEntity.ticksSinceSync = -1;
|
|
||||||
return newEntity;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack[] getTopItemStacks()
|
public ItemStack[] getTopItemStacks()
|
||||||
{
|
{
|
||||||
return topStacks;
|
return topStacks;
|
||||||
|
|
Loading…
Reference in New Issue