Guest User

Untitled

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