Advertisement
Guest User

Gui

a guest
May 2nd, 2015
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1.  
  2. package firstetestmod;
  3.  
  4. import org.lwjgl.opengl.GL11;
  5.  
  6. import net.minecraft.client.Minecraft;
  7. import net.minecraft.client.gui.inventory.GuiContainer;
  8. import net.minecraft.client.resources.I18n;
  9. import net.minecraft.entity.player.InventoryPlayer;
  10. import net.minecraft.util.ResourceLocation;
  11.  
  12. public class GuiMatterMachine extends GuiContainer{
  13. public static final ResourceLocation texture = new ResourceLocation("test:textures/gui/container/MatterMachine.png");
  14.  
  15. public TileEntityMatterMachine MatterMachine;
  16.  
  17. public GuiMatterMachine(InventoryPlayer invPlayer, TileEntityMatterMachine entity) {
  18. super(new ContainerMatterMachine(invPlayer, entity));
  19.  
  20. this.MatterMachine = entity;
  21.  
  22. this.xSize = 176;
  23. this.ySize = 165;
  24. }
  25.  
  26. public void drawGuiContainerForegroundLayer(int par1, int par2){
  27. String s = this.MatterMachine.isInvNameLocalized() ? this.MatterMachine.getInvName() : I18n.format(this.MatterMachine.getInvName());
  28. this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
  29. this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 5, 4210752);
  30. }
  31.  
  32.  
  33. public void drawGuiContainerBackgroundLayer(float f, int j, int i) {
  34. GL11.glColor4f(1F, 1F, 1F, 1F);
  35.  
  36. Minecraft.getMinecraft().getTextureManager().
  37. bindTexture(texture);
  38.  
  39. drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
  40.  
  41. int i1;
  42.  
  43. if(this.MatterMachine.hasPower()){
  44. i1 = this.MatterMachine.getPowerRemainingScaled(47);
  45. this.drawTexturedModalRect(guiLeft + 8, guiTop + 53 - i1, 176, 64 - i1, 17, i1);
  46. }
  47.  
  48. i1 = this.MatterMachine.getCookProgressScaled(24);
  49. this.drawTexturedModalRect(guiLeft + 79, guiTop + 34, 176, 0, i1 + 1, 16);
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement