Temporarily, the item name is a backpack.
public class GuiHandler implements IGuiHandler
{
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
if (ID == 1)
{
return new ContainerBackPack(player.inventory);
}
return null;
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
if (ID == 1)
{
return new GuiBackPack(player.inventory);
}
return null;
}
}
public class GuiBackPack extends GuiContainer
{
private static final ResourceLocation TEXTURE = new ResourceLocation("textures/gui/container/generic_54.png");
public GuiBackPack(InventoryPlayer inventory)
{
super(new ContainerBackPack(inventory));
this.ySize = 222;
}
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(TEXTURE);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
And now I'm wondering how to make "ContainerBackPack".