Guest User

GUIItemInput

a guest
Oct 1st, 2013
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. import net.minecraft.client.gui.inventory.GuiContainer;
  2. import net.minecraft.entity.player.InventoryPlayer;
  3. import net.minecraft.util.ResourceLocation;
  4. import net.minecraft.util.StatCollector;
  5.  
  6. import org.lwjgl.opengl.GL11;
  7.  
  8. import com.awesomesauce.minecraft.digitalcraft.core.common.tileentity.TileEntityItemInput;
  9.  
  10. public class GUIItemInput extends GuiContainer {
  11.  
  12.  
  13. private TileEntityItemInput te;
  14.  
  15. public GUIItemInput(InventoryPlayer inventoryPlayer,
  16. TileEntityItemInput tileEntity) {
  17. //the container is instanciated and passed to the superclass for handling
  18. super(new ContainerItemInput(inventoryPlayer, tileEntity));
  19. te = tileEntity;
  20. }
  21.  
  22. @Override
  23. protected void drawGuiContainerForegroundLayer(int param1, int param2) {
  24. //draw text and stuff here
  25. //the parameters for drawString are: string, x, y, color
  26. fontRenderer.drawString(te.getInvName(), 8, 6, 4210752);
  27. //draws "Inventory" or your regional equivalent
  28. fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 4210752);
  29. }
  30.  
  31. @Override
  32. protected void drawGuiContainerBackgroundLayer(float par1, int par2,
  33. int par3) {
  34. //draw your Gui here, only thing you need to change is the path
  35. GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  36. this.mc.renderEngine.bindTexture(new ResourceLocation("digitalcraft", "gui/items.png"));
  37. int x = (width - xSize) / 2;
  38. int y = (height - ySize) / 2;
  39. this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment