How to make more than 45 slots in the gui?
crash
package com.svk.generateChests.Tile;
import java.util.ArrayList;
import com.svk.generateChests.base.CommonProxy;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
public class TileGenerateChest extends TileEntity implements IInventory
{
public ItemStack[] slots = new ItemStack[60];
public int[] procentSlot = null;
public boolean setGen = false;
public String customName = null;
public TileGenerateChest(){}
public void updateEntity()
{
super.updateEntity();
}
public void readFromNBT(NBTTagCompound nbt)
{
super.readFromNBT(nbt);
NBTTagList nbttaglist = nbt.getTagList("Items", 10);
this.slots = new ItemStack[this.getSizeInventory()];
if (nbt.hasKey("CustomName", )
{
this.customName = nbt.getString("CustomName");
}
for (int i = 0; i < nbttaglist.tagCount(); ++i)
{
NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
int j = nbttagcompound1.getByte("Slot") & 255;
if (j >= 0 && j < this.slots.length)
{
this.slots[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
}
}
this.procentSlot = nbt.getIntArray("procentSlots");
this.setGen = nbt.getBoolean("setGen");
}
public void writeToNBT(NBTTagCompound nbt)
{
super.writeToNBT(nbt);
NBTTagList nbttaglist = new NBTTagList();
for (int i = 0; i < this.slots.length; ++i)
{
if (this.slots[i] != null)
{
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
nbttagcompound1.setByte("Slot", (byte)i);
this.slots[i].writeToNBT(nbttagcompound1);
nbttaglist.appendTag(nbttagcompound1);
}
}
nbt.setTag("Items", nbttaglist);
if (this.hasCustomInventoryName())
{
nbt.setString("CustomName", this.customName);
}
nbt.setIntArray("procentSlots", this.procentSlot);
nbt.setBoolean("setGen",this.setGen);
}
public int getSizeInventory()
{
return 60;
}
@Override
public ItemStack getStackInSlot(int i)
{
return this.slots[i];
}
public ItemStack decrStackSize(int i, int j)
{
if(this.slots[i] != null)
{
ItemStack itemstack;
if(this.slots[i].stackSize < j)
{
itemstack = this.slots[i];
this.slots[i] = null;
return itemstack;
}
else
{
itemstack = this.slots[i].splitStack(j);
if(this.slots[i].stackSize == 0)
{
this.slots[i] = null;
}
return itemstack;
}
}
return null;
}
public ItemStack getStackInSlotOnClosing(int i)
{
if(this.slots[i] != null)
{
ItemStack itemstack = this.slots[i];
this.slots[i] = null;
return itemstack;
}
return null;
}
@Override
public void setInventorySlotContents(int i, ItemStack itemstack)
{
this.slots[i] = itemstack;
if(itemstack != null && itemstack.stackSize > this.getInventoryStackLimit())
{
itemstack.stackSize = this.getInventoryStackLimit();
}
}
public void setInventoryName(String string)
{
}
public String getInventoryName()
{
return "CustomName";
}
@Override
public boolean hasCustomInventoryName()
{
return true;
}
@Override
public int getInventoryStackLimit()
{
return 64;
}
@Override
public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
return false;
}
@Override
public void openInventory()
{
}
@Override
public void closeInventory()
{
}
@Override
public boolean isItemValidForSlot(int slot, ItemStack itemStack)
{
if(slots[slot] != null)
{
return true;
}
else
{
return false;
}
}
}
package com.svk.generateChests.GUI.container;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import com.svk.generateChests.Tile.TileGenerateChest;
import com.svk.generateChests.base.BaseClassMod;
import com.svk.generateChests.base.CommonProxy;
import com.svk.generateChests.packets.PacketsID;
import com.svk.generateChests.util.UtilPackerDataSet;
public class ContainerEditGenerateChest extends Container
{
public ContainerEditGenerateChest(InventoryPlayer inventoryPlayer, TileGenerateChest tileChest)
{
tileChest.openInventory();
this.addCustomSlots(tileChest);
this.addPlayerSlots(inventoryPlayer);
}
public void addCustomSlots(TileGenerateChest chest)
{
for(int i = 0; i < 8; i++)
{
this.addSlotToContainer(new Slot(chest, i, 8, 12 + 18*i));
this.addSlotToContainer(new Slot(chest, i + 8, 53, 12 + 18*i));
}
}
public void addPlayerSlots(InventoryPlayer inventoryPlayer)
{
for(int i = 0; i < 3; i++)
{
for(int j = 0; j < 9; j++)
{
this.addSlotToContainer(new Slot(inventoryPlayer, 9+j+i*9, 8+18*j, 166+i*18));
}
}
for(int i = 0; i < 9; i++)
{
this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 224));
}
}
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_)
{
return null;
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_)
{
return true;
}
}