Guest User

Untitled

a guest
Sep 28th, 2014
59
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.crilleslo.gui;
  2.  
  3. import org.lwjgl.opengl.GL11;
  4.  
  5. import com.crilleslo.container.ContainerWindmill;
  6. import com.crilleslo.tileentity.TileEntityWindmill;
  7. import com.sun.imageio.plugins.common.I18N;
  8.  
  9. import net.minecraft.client.Minecraft;
  10. import net.minecraft.client.gui.GuiButton;
  11. import net.minecraft.client.gui.GuiScreen;
  12. import net.minecraft.client.gui.GuiTextField;
  13. import net.minecraft.client.gui.inventory.GuiContainer;
  14. import net.minecraft.entity.player.EntityPlayer;
  15. import net.minecraft.entity.player.InventoryPlayer;
  16. import net.minecraft.inventory.Container;
  17. import net.minecraft.util.ResourceLocation;
  18.  
  19. public class GuiWindmill extends GuiContainer {
  20.  
  21. ResourceLocation texture = new ResourceLocation("factorycraft", "textures/gui/windmillGui.png");
  22. private TileEntityWindmill tileEntity = null;
  23.  
  24. public GuiWindmill(InventoryPlayer inventoryPlayer, TileEntityWindmill tileEntity) {
  25. super(new ContainerWindmill(inventoryPlayer, tileEntity));
  26. this.tileEntity = tileEntity;
  27. }
  28.  
  29. protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
  30. fontRendererObj.drawString("Windmill", 70, 6, 4210752);
  31. fontRendererObj.drawString("Inventory", 8, this.ySize - 96 + 2, 4210752);
  32. }
  33.  
  34. public boolean doesGuiPauseGame() {
  35. return false;
  36. }
  37.  
  38. protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
  39. GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  40.  
  41. Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
  42. int x = (width - xSize) / 2;
  43. int y = (height - ySize) / 2;
  44. this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
  45.  
  46. if(tileEntity.isActive()) {
  47. this.drawTexturedModalRect(x + 9, y + 9, 176, 0, 16, 16);
  48. }
  49.  
  50. int progress = tileEntity.getEnergyStoredScaled(62);
  51. this.drawTexturedModalRect(x + 97, y + 77, 197, 77, -21, -progress);
  52. }
  53.  
  54. }
Advertisement
Add Comment
Please, Sign In to add comment