Advertisement
Guest User

GuiSmallFryer

a guest
Jul 19th, 2014
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.12 KB | None | 0 0
  1. package GravityBurger.FriedChicken.gui;
  2.  
  3. import org.lwjgl.opengl.GL11;
  4.  
  5. import net.minecraft.client.gui.inventory.GuiContainer;
  6. import net.minecraft.client.resources.I18n;
  7. import net.minecraft.entity.player.InventoryPlayer;
  8. import net.minecraft.util.ResourceLocation;
  9. import GravityBurger.FriedChicken.gui.container.ContainerSmallFryer;
  10. import GravityBurger.FriedChicken.tileentity.TileEntitySmallFryer;
  11. import cpw.mods.fml.relauncher.Side;
  12. import cpw.mods.fml.relauncher.SideOnly;
  13.  
  14.  
  15. @SideOnly(Side.CLIENT)
  16. public class GuiSmallFryer extends GuiContainer{
  17.     private static final ResourceLocation fryerGuiTextures = new ResourceLocation("textures/gui/container/smallfryer.png");
  18.     private TileEntitySmallFryer tileFurnace;
  19.    
  20.     public GuiSmallFryer(InventoryPlayer invPlayer, TileEntitySmallFryer tile) {
  21.         super(new ContainerSmallFryer(invPlayer, tile));
  22.         this.tileFurnace = tile;
  23.     }
  24.  
  25.     protected void drawGuiContainerForegroundLayer(int par1, int par2){
  26.         String string = this.tileFurnace.hasCustomInventoryName() ? this.tileFurnace.getInventoryName() : I18n.format(this.tileFurnace.getInventoryName(), new Object[0]);
  27.         this.fontRendererObj.drawString(string, this.xSize / 2 - this.fontRendererObj.getStringWidth(string), 6, 4210752);
  28.         this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 94, 4210752);
  29.     }
  30.        
  31.    
  32.     @Override
  33.     protected void drawGuiContainerBackgroundLayer(float var1, int var2,int var3) {
  34.          GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  35.             this.mc.getTextureManager().bindTexture(fryerGuiTextures);
  36.             int k = (this.width - this.xSize) / 2;
  37.             int l = (this.height - this.ySize) / 2;
  38.             this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
  39.             int i1;
  40.            
  41.             if(this.tileFurnace.isBurning()){
  42.                 i1 = this.tileFurnace.getBurnTimeRemainingScaled(12);
  43.                 this.drawTexturedModalRect(k + 56, l + 32 + 12 - i1, 176, 17 - i1, 19, i1 + 2);
  44.             }
  45.    
  46.  
  47.                 i1 = this.tileFurnace.getCookProgressScaled(24);
  48.                 this.drawTexturedModalRect(k + 84, l + 33, 176, 1, i1 + 1, 16);
  49.            
  50.        
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement