Guest User

Untitled

a guest
Nov 9th, 2014
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. package tutorial.generic;
  2.  
  3.  
  4. import cpw.mods.fml.relauncher.Side;
  5. import cpw.mods.fml.relauncher.SideOnly;
  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.ContainerFurnace;
  10. import net.minecraft.tileentity.TileEntityFurnace;
  11. import net.minecraft.util.ResourceLocation;
  12.  
  13. import org.lwjgl.opengl.GL11;
  14.  
  15. @SideOnly(Side.CLIENT)
  16. public class GuiEnderFurnace extends GuiContainer
  17. {
  18. private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("endermod:textures/gui/container/enderfurnace.png");
  19. private TileEntityEnderFurnace tileEnderFurnace;
  20. private static final String __OBFID = "CL_00000758";
  21.  
  22. public GuiEnderFurnace(InventoryPlayer p_i1091_1_, TileEntityEnderFurnace p_i1091_2_)
  23. {
  24. super(new ContainerEnderFurnace(p_i1091_1_, p_i1091_2_));
  25. this.tileEnderFurnace = p_i1091_2_;
  26. }
  27.  
  28. /**
  29. * Draw the foreground layer for the GuiContainer (everything in front of the items)
  30. */
  31. protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
  32. {
  33. String s = this.tileEnderFurnace.hasCustomInventoryName() ? this.tileEnderFurnace.getInventoryName() : I18n.format(this.tileEnderFurnace.getInventoryName(), new Object[0]);
  34. this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
  35. this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
  36. }
  37. @Override
  38. protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
  39. {
  40. GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  41. this.mc.getTextureManager().bindTexture(furnaceGuiTextures);
  42. int k = (this.width - this.xSize) / 2;
  43. int l = (this.height - this.ySize) / 2;
  44. this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
  45. int i1;
  46. if (this.tileEnderFurnace.isBurning())
  47. {
  48. i1 = this.tileEnderFurnace.getBurnTimeRemainingScaled(13);
  49. this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 1);
  50.  
  51. }
  52. i1 = this.tileEnderFurnace.getCookProgressScaled(24);
  53. this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16);
  54.  
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment