Initial stab at 1.11
About halfway.
This commit is contained in:
parent
ce52aea512
commit
00d6f8eb46
157 changed files with 1036 additions and 1554 deletions
|
@ -61,7 +61,7 @@ public class TileInventory extends TileBase implements IInventory
|
|||
|
||||
if (j >= 0 && j < inventory.length)
|
||||
{
|
||||
inventory[j] = ItemStack.loadItemStackFromNBT(data);
|
||||
inventory[j] = new ItemStack(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ public class TileInventory extends TileBase implements IInventory
|
|||
|
||||
for (int i = 0; i < inventory.length; i++)
|
||||
{
|
||||
if ((inventory[i] != null) && !isSyncedSlot(i))
|
||||
if ((!inventory[i].isEmpty()) && !isSyncedSlot(i))
|
||||
{
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setByte("Slot", (byte) i);
|
||||
|
@ -115,7 +115,7 @@ public class TileInventory extends TileBase implements IInventory
|
|||
if (!getWorld().isRemote)
|
||||
getWorld().notifyBlockUpdate(getPos(), getWorld().getBlockState(getPos()), getWorld().getBlockState(getPos()), 3);
|
||||
|
||||
if (inventory[index].stackSize <= count)
|
||||
if (inventory[index].getCount() <= count)
|
||||
{
|
||||
ItemStack itemStack = inventory[index];
|
||||
inventory[index] = null;
|
||||
|
@ -124,7 +124,7 @@ public class TileInventory extends TileBase implements IInventory
|
|||
}
|
||||
|
||||
ItemStack itemStack = inventory[index].splitStack(count);
|
||||
if (inventory[index].stackSize == 0)
|
||||
if (inventory[index].getCount() == 0)
|
||||
inventory[index] = null;
|
||||
|
||||
markDirty();
|
||||
|
@ -150,8 +150,8 @@ public class TileInventory extends TileBase implements IInventory
|
|||
public void setInventorySlotContents(int slot, ItemStack stack)
|
||||
{
|
||||
inventory[slot] = stack;
|
||||
if (stack != null && stack.stackSize > getInventoryStackLimit())
|
||||
stack.stackSize = getInventoryStackLimit();
|
||||
if (!stack.isEmpty() && stack.getCount() > getInventoryStackLimit())
|
||||
stack.setCount(getInventoryStackLimit());
|
||||
markDirty();
|
||||
if (!getWorld().isRemote)
|
||||
getWorld().notifyBlockUpdate(getPos(), getWorld().getBlockState(getPos()), getWorld().getBlockState(getPos()), 3);
|
||||
|
@ -163,12 +163,6 @@ public class TileInventory extends TileBase implements IInventory
|
|||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory(EntityPlayer player)
|
||||
{
|
||||
|
@ -211,6 +205,20 @@ public class TileInventory extends TileBase implements IInventory
|
|||
this.inventory = new ItemStack[size];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
for (ItemStack stack : inventory)
|
||||
if (!stack.isEmpty())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUsableByPlayer(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// IWorldNameable
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue