Jump to content

ButterChuckles

Members
  • Posts

    1
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

ButterChuckles's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I am making a mod and I have coded a very simple GUI to appear when I open a chest. Now I need help adding slots to the gui. If you could help me that would be great. Also it would be great if you could let me know about any extra code I need to add so I can properly make the chest work. My coding for the chest looks like this public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { if (p_149727_1_.isRemote) { return true; } else { IInventory iinventory = this.func_149951_m(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_); if (iinventory != null) { Minecraft.getMinecraft().displayGuiScreen(new GuiChest()); } return true; } My coding for the gui looks like this public class GuiChest extends GuiScreen{ int guiWidth = 182; int guiHeight = 187; @Override public void drawScreen(int x, int y, float ticks) { int guiX = (width - guiWidth) / 2; int guiY = (height - guiHeight) / 2; GL11.glColor4f(1, 1, 1, 1); drawDefaultBackground(); mc.renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID, "textures/gui/chestGui.png")); drawTexturedModalRect(guiX, guiY, 35, 39, guiWidth, guiHeight); fontRendererObj.drawString("Grass Chest", guiX + 40, guiY + 5, 0x601959); super.drawScreen(x, y, ticks); } protected void keyTyped(char c, int key) { switch(key){ case Keyboard.KEY_E: mc.displayGuiScreen(null); super.keyTyped(c, key); } } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.