Advertisement
TechMage66

GuiInfuser

Nov 21st, 2014
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.13 KB | None | 0 0
  1. package com.techmage.magetech.client.gui.inventory;
  2.  
  3. import com.techmage.magetech.inventory.ContainerInfuser;
  4. import com.techmage.magetech.reference.Names;
  5. import com.techmage.magetech.reference.Textures;
  6. import com.techmage.magetech.tileentity.TileEntityInfuser;
  7. import cpw.mods.fml.relauncher.Side;
  8. import cpw.mods.fml.relauncher.SideOnly;
  9. import net.minecraft.client.gui.inventory.GuiContainer;
  10. import net.minecraft.entity.player.InventoryPlayer;
  11. import net.minecraft.util.StatCollector;
  12. import org.lwjgl.opengl.GL11;
  13.  
  14. @SideOnly(Side.CLIENT)
  15. public class GuiInfuser extends GuiContainer
  16. {
  17.     private TileEntityInfuser tileEntityInfuser;
  18.  
  19.     public GuiInfuser(InventoryPlayer inventoryPlayer, TileEntityInfuser tileEntityInfuser)
  20.     {
  21.         super(new ContainerInfuser(inventoryPlayer, tileEntityInfuser));
  22.         ySize = 239;
  23.         this.tileEntityInfuser = tileEntityInfuser;
  24.     }
  25.  
  26.     @Override
  27.     protected void drawGuiContainerForegroundLayer(int x, int y)
  28.     {
  29.         String containerName = StatCollector.translateToLocal(tileEntityInfuser.getInventoryName());
  30.         fontRendererObj.drawString(containerName, xSize / 2 - fontRendererObj.getStringWidth(containerName) / 2, 6, 4210752);
  31.         fontRendererObj.drawString(StatCollector.translateToLocal(Names.Containers.VANILLA_INVENTORY), 8, ySize - 96 + 2, 4210752);
  32.     }
  33.  
  34.     @Override
  35.     protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y)
  36.     {
  37.         GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  38.  
  39.         this.mc.getTextureManager().bindTexture(Textures.Gui.INFUSER);
  40.  
  41.         int xStart = (width - xSize) / 2;
  42.         int yStart = (height - ySize) / 2;
  43.         this.drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize);
  44.  
  45.         int i1 = this.tileEntityInfuser.getEssenceScale(46);
  46.         this.drawTexturedModalRect (xStart + 12, yStart + 56 + 46 - i1, 177, 46 - i1, 9, i1 + 1);
  47.  
  48.         if (this.tileEntityInfuser.isInfusing())
  49.         {
  50.             i1 = this.tileEntityInfuser.getInfusionProgressScale(46);
  51.             this.drawTexturedModalRect (xStart + 155, yStart + 56 + 46 - i1, 187, 46 - i1, 9, i1 + 1);
  52.         }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement