XeNe

TTT

Jan 3rd, 2015
194
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package firstetestmod;
  2.  
  3. import net.minecraft.client.Minecraft;
  4. import net.minecraft.client.gui.inventory.GuiContainer;
  5. import net.minecraft.client.resources.I18n;
  6. import net.minecraft.entity.player.InventoryPlayer;
  7. import net.minecraft.util.ResourceLocation;
  8.  
  9. import org.lwjgl.opengl.GL11;
  10.  
  11. public class GuiCombinerMachine extends GuiContainer
  12. {
  13. public static final ResourceLocation texture = new ResourceLocation("test:textures/gui/container/CombinerMachine.png");
  14.  
  15. public TileEntityCombinerMachine tileCombinerMachine;
  16.  
  17. public GuiCombinerMachine(InventoryPlayer invPlayer, TileEntityCombinerMachine entity) {
  18. super(new ContainerCombinerMachine(invPlayer, entity));
  19.  
  20. Minecraft mc = Minecraft.getMinecraft();
  21. this.tileCombinerMachine = entity;
  22.  
  23. this.xSize = 176;
  24. this.ySize = 165;
  25. }
  26.  
  27. public void drawGuiContainerForegroundLayer(int par1, int par2){
  28. String s = this.tileCombinerMachine.isInventoryName() ? this.tileCombinerMachine.getInventoryName() : I18n.format(this.tileCombinerMachine.getInventoryName());
  29. this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
  30. this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 5, 4210752);
  31. }
  32.  
  33. public void drawGuiContainerBackgroundLayer(float f, int j, int i)
  34. {
  35. GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  36.  
  37. this.mc.getTextureManager().bindTexture(texture);
  38.  
  39. this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, this.xSize, this.ySize);
  40.  
  41. int i1;
  42.  
  43. if(this.tileCombinerMachine.hasPower())
  44.  
  45. {
  46. i1 = this.tileCombinerMachine.getPowerRemainingScaled(45);
  47. this.drawTexturedModalRect(guiLeft + 8, guiTop + 53 - i1, 176, 62 - i1, 16, i1);
  48. }
  49.  
  50. i1 = this.tileCombinerMachine.getCookProgressScaled(24);
  51. this.drawTexturedModalRect(guiLeft + 79, guiTop + 34, 176, 0, i1 + 1, 16);
  52. }
  53. }
RAW Paste Data