Guest User

GuiSuperHotFurnace

a guest
Dec 2nd, 2014
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. package com.smith.mod.gui;
  2.  
  3. import org.lwjgl.opengl.GL11;
  4.  
  5. import net.minecraft.client.Minecraft;
  6. import net.minecraft.client.gui.inventory.GuiContainer;
  7. import net.minecraft.client.resources.I18n;
  8. import net.minecraft.entity.player.InventoryPlayer;
  9. import net.minecraft.inventory.Container;
  10. import net.minecraft.util.ResourceLocation;
  11.  
  12. import com.smith.mod.container.ContainerSuperHotFurnace;
  13. import com.smith.mod.Smithing;
  14. import com.smith.mod.tileentity.TileEntitySuperHotFurnace;
  15.  
  16. public class GuiSuperHotFurnace extends GuiContainer {
  17.  
  18. public static final ResourceLocation bground = new ResourceLocation(Smithing.modid + ":" + "textures/gui/GuiSuperHotFurnace.png");
  19.  
  20. public TileEntitySuperHotFurnace superHotFurnace;
  21.  
  22. public GuiSuperHotFurnace(InventoryPlayer inventoryPlayer, TileEntitySuperHotFurnace entity) {
  23. super(new ContainerSuperHotFurnace(inventoryPlayer, entity));
  24.  
  25. this.superHotFurnace = entity;
  26.  
  27. this.xSize = 176;
  28. this.ySize = 166;
  29. }
  30.  
  31.  
  32. public void drawGuiContainerForegroundLayer(int par1, int par2) {
  33.  
  34. String name = "Super Hot Furnace";
  35. this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
  36. this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8 , this.ySize - 96 + 2 , 4210752);
  37. }
  38.  
  39. @Override
  40. protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
  41. GL11.glColor4f(1F, 1F, 1F, 1F);
  42.  
  43. Minecraft.getMinecraft().getTextureManager().bindTexture(bground);
  44. drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
  45.  
  46. if(this.superHotFurnace.isBurning()) {
  47. int k = this.superHotFurnace.getBurnTimeRemainingScaled(11);
  48. int j = 11 - k;
  49. drawTexturedModalRect(guiTop + 30, guiLeft + 23, 176, 0, 16 - j, 11);
  50. }
  51.  
  52. int k = this.superHotFurnace.getCookProgressScaled(44);
  53. drawTexturedModalRect(guiLeft + 47, guiTop + 19, 176, 16, k + 1, 16);
  54.  
  55. }
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment