Guest User

GUI Carpenter Bench

a guest
Aug 24th, 2014
9
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package minefantasy.mf2.block.crafting;
  2.  
  3. import minefantasy.mf2.block.list.BlockListMF;
  4. import minefantasy.mf2.block.tileentity.TileEntityCarpenter;
  5. import net.minecraft.client.gui.FontRenderer;
  6. import net.minecraft.client.gui.inventory.GuiContainer;
  7. import net.minecraft.entity.player.InventoryPlayer;
  8. import net.minecraft.util.StatCollector;
  9.  
  10. import org.lwjgl.opengl.GL11;
  11.  
  12.  
  13. public class GUICarpenterBench extends GuiContainer{
  14.  
  15. protected int xSize = 256;
  16. protected int ySize = 256;
  17.  
  18. public GUICarpenterBench(InventoryPlayer inv, TileEntityCarpenter tec) {
  19. super(new ContainerCarpenterBench(tec, inv));
  20.  
  21. }
  22.  
  23. protected void drawGuiContainerForegoundLayer() {
  24. FontRenderer fontRenderer = this.mc.fontRenderer;
  25. fontRenderer.drawString("Carpenters Bench", 6, 6, 0xffffff);
  26. // This draws the caption for the players inventory this is not needed as the above but is sometimes nice
  27. fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 6, ySize - 96 + 2, 0xffffff);
  28. }
  29.  
  30.  
  31. @Override
  32. protected void drawGuiContainerBackgroundLayer(float var1, int var2,
  33. int var3) {
  34. GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
  35.  
  36. this.mc.getTextureManager().bindTexture(BlockListMF.GUICARPENTERBENCH);
  37. int x = (width - this.xSize)/2;
  38. int y = (height - this.ySize) /2;
  39. this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
  40.  
  41. }
  42.  
  43. }
RAW Paste Data