return true;
}
if(metadata == 6)
{
TileEntityBin bin = (TileEntityBin)world.getTileEntity(x, y, z);
if(bin.getItemCount() < bin.MAX_STORAGE)
{
if(bin.addTicks == 0 && entityplayer.getCurrentEquippedItem() != null)
{
if(entityplayer.getCurrentEquippedItem() != null)
{
ItemStack remain = bin.add(entityplayer.getCurrentEquippedItem());
entityplayer.setCurrentItemOrArmor(0, remain);
bin.addTicks = 5;
}
}
else if(bin.addTicks > 0 && bin.getItemCount() > 0)
{
ItemStack[] inv = entityplayer.inventory.mainInventory;
for(int i = 0; i < inv.length; i++)
{
if(bin.getItemCount() == bin.MAX_STORAGE)
{
break;
}
if(inv[i] != null)
{
ItemStack remain = bin.add(inv[i]);
inv[i] = remain;
bin.addTicks = 5;
}
((EntityPlayerMP)entityplayer).sendContainerAndContentsToPlayer(entityplayer.openContainer, entityplayer.openContainer.getInventory());