Guest User

GrinderGui.java

a guest
Aug 19th, 2015
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.08 KB | None | 0 0
  1. package com.xenocorpse.wulfenite.gui;
  2.  
  3. import org.lwjgl.opengl.GL11;
  4.  
  5. import com.xenocorpse.wulfenite.inventory.ContainerGrinder;
  6. import com.xenocorpse.wulfenite.tileentities.TileEntityGrinder;
  7.  
  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.util.ResourceLocation;
  12. import net.minecraftforge.fml.relauncher.SideOnly;
  13. import net.minecraftforge.fml.relauncher.Side;
  14.  
  15. @SideOnly(Side.CLIENT)
  16. public class GrinderGui extends GuiContainer{
  17.    
  18.     private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("textures/gui/container/furnace.png");
  19.     private TileEntityGrinder tileFurnace;
  20.  
  21.     public GrinderGui(InventoryPlayer invPlayer, TileEntityGrinder tile) {
  22.         super(new ContainerGrinder(invPlayer, tile));
  23.         this.tileFurnace = tile;
  24.        
  25.     }
  26.    
  27.     protected void drawGuiContainerForegroundLayer(int par1, int par2){
  28.         String string = this.tileFurnace.hasCustomName() ? this.tileFurnace.getName() : I18n.format(this.tileFurnace.getName(), new Object[0]);
  29.         this.fontRendererObj.drawString(string, this.xSize / 2 - this.fontRendererObj.getStringWidth(string), 6, 4210752);
  30.         this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 94, 4210752);
  31.     }
  32.  
  33.     @Override
  34.     protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
  35.          GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  36.             this.mc.getTextureManager().bindTexture(furnaceGuiTextures);
  37.             int k = (this.width - this.xSize) / 2;
  38.             int l = (this.height - this.ySize) / 2;
  39.             this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
  40.             int i1;
  41.  
  42.             if (this.tileFurnace.isBurning())
  43.             {
  44.                 i1 = this.tileFurnace.getBurnTimeRemainingScaled(12);
  45.                 this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2);
  46.             }
  47.  
  48.             i1 = this.tileFurnace.getCookProgressScaled(24);
  49.             this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16);
  50.     }
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment