Advertisement
ButterAleks

chest gui

Jan 20th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. package com.ButterAleks.RandomIdeas.blocks.gui;
  2.  
  3. import com.ButterAleks.RandomIdeas.blocks.container.ContainerRainbowChestBlock;
  4. import com.ButterAleks.RandomIdeas.blocks.tileentity.TileEntityRainbowChestBlock;
  5. import com.ButterAleks.RandomIdeas.util.Reference;
  6.  
  7. import net.minecraft.client.gui.inventory.GuiContainer;
  8. import net.minecraft.client.renderer.GlStateManager;
  9. import net.minecraft.entity.player.EntityPlayer;
  10. import net.minecraft.entity.player.InventoryPlayer;
  11. import net.minecraft.inventory.Container;
  12. import net.minecraft.util.ResourceLocation;
  13.  
  14. public class GuiRainbowChestBlock extends GuiContainer
  15. {
  16. public GuiRainbowChestBlock(InventoryPlayer playerInventory, TileEntityRainbowChestBlock chestInventory, EntityPlayer player)
  17. {
  18.  
  19. super(new ContainerRainbowChestBlock(playerInventory, chestInventory, player));
  20. this.playerInventory = playerInventory;
  21. this.te = chestInventory;
  22. this.xSize = 179;
  23. this.ySize = 256;
  24. }
  25. private static final ResourceLocation GUI_CHEST = new ResourceLocation(Reference.MOD_ID + ":textures/gui/rainbow_chest_block.png");
  26. private final InventoryPlayer playerInventory;
  27. private final TileEntityRainbowChestBlock te;
  28. @Override
  29. protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
  30. {
  31. this.fontRenderer.drawString(this.te.getDisplayName().getUnformattedText(), 8, 6, 65793);
  32. this.fontRenderer.drawString(this.playerInventory.getDisplayName().getUnformattedText(), 8, this.ySize - 92, 65793);
  33. }
  34. @Override
  35. protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
  36. {
  37. GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
  38. this.mc.getTextureManager().bindTexture(GUI_CHEST);
  39. this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement