Guest User

GuiAlloyOven Class

a guest
Oct 22nd, 2014
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.67 KB | None | 0 0
  1. package com.arucraft.gui;
  2.  
  3. import org.lwjgl.opengl.GL11;
  4.  
  5. import net.minecraft.client.Minecraft;
  6. import net.minecraft.client.gui.inventory.GuiContainer;
  7. import net.minecraft.client.resources.I18n;
  8. import net.minecraft.entity.player.InventoryPlayer;
  9. import net.minecraft.util.ResourceLocation;
  10.  
  11. import com.arucraft.ArucraftMain;
  12. import com.arucraft.container.ContainerAlloyOven;
  13. import com.arucraft.tileentity.TileEntityAlloyOven;
  14.  
  15. public class GuiAlloyOven extends GuiContainer {
  16.    
  17.     private ResourceLocation texture = new ResourceLocation(ArucraftMain.modID + ":" + "/textures/gui/AlloyOvenGui.png");
  18.     private TileEntityAlloyOven alloyOven;
  19.  
  20.     public GuiAlloyOven(InventoryPlayer invPlayer, TileEntityAlloyOven teAlloyOven) {
  21.         super(new ContainerAlloyOven(invPlayer, teAlloyOven));
  22.         alloyOven = teAlloyOven;
  23.        
  24.         this.xSize = 176;
  25.         this.ySize = 166;
  26.     }
  27.    
  28.     protected void drawGuiContainerForegroundLayer(int i, int j) {
  29.         String name = this.alloyOven.hasCustomInventoryName() ? this.alloyOven.getInventoryName() : I18n.format(this.alloyOven.getInventoryName());
  30.        
  31.         this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
  32.         this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 5, 4210752);
  33.     }
  34.  
  35.     @Override
  36.     protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
  37.         GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  38.         Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
  39.         drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
  40.        
  41.         //do the thing with the power
  42.        
  43.         //do the thing with the progress bar
  44.        
  45.     }
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment