Guest User

Untitled

a guest
Nov 11th, 2016
34
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package thecraft.mod.common;
  2.  
  3. import org.lwjgl.opengl.GL11;
  4.  
  5. import net.minecraft.client.gui.inventory.GuiContainer;
  6. import net.minecraft.client.resources.I18n;
  7. import net.minecraft.entity.player.InventoryPlayer;
  8. import net.minecraft.inventory.Container;
  9. import net.minecraft.inventory.IInventory;
  10. import net.minecraft.util.ResourceLocation;
  11.  
  12. public class GuiEwiliteChest extends GuiContainer
  13. {
  14. private static final ResourceLocation textures = new ResourceLocation(ewifaction.MODID, "textures/gui/container/cupboard.png");
  15. private TileEntityEwiliteChest tileewilite;
  16. private IInventory playerInv;
  17.  
  18. public GuiEwiliteChest(TileEntityEwiliteChest tile, InventoryPlayer inventory)
  19. {
  20. super(new ContainerEwiliteChest(tile, inventory));
  21. this.tileewilite = tile;
  22. this.playerInv = inventory;
  23. this.allowUserInput = false;
  24. this.ySize = 170;
  25. }
  26.  
  27. @Override
  28. protected void drawGuiContainerBackgroundLayer(float partialRenderTick, int x, int y)
  29. {
  30. String tileName = this.tileewilite.hasCustomInventoryName() ? this.tileewilite.getInventoryName() : I18n.format(this.tileewilite.getInventoryName());
  31. this.fontRendererObj.drawString(tileName, (this.xSize - this.fontRendererObj.getStringWidth(tileName)) / 2, 6, 0);
  32. String invName = this.playerInv.hasCustomInventoryName() ? this.playerInv.getInventoryName() : I18n.format(this.playerInv.getInventoryName());
  33. this.fontRendererObj.drawString(invName, (this.xSize - this.fontRendererObj.getStringWidth(invName)) / 2, this.ySize - 96, 0);
  34. GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  35. this.mc.getTextureManager().bindTexture(textures);
  36. int k = (this.width - this.xSize) / 2;
  37. int l = (this.height - this.ySize) / 2;
  38. this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
  39. }
  40. }
RAW Paste Data