Guest User

guiClass

a guest
Apr 23rd, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.84 KB | None | 0 0
  1. package net.codecraft.mod.gui;
  2.  
  3. import org.lwjgl.opengl.GL11;
  4.  
  5. import net.codecraft.mod.Codecraft;
  6. import net.codecraft.mod.tileentity.TileEntityCodeOven;
  7. import net.minecraft.client.Minecraft;
  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.inventory.Container;
  12. import net.minecraft.util.ResourceLocation;
  13. import net.codecraft.mod.container.ContainerCodeOven;
  14.  
  15. public class GuiCodeOven extends GuiContainer {
  16.    
  17.     public static final ResourceLocation bground = new ResourceLocation(Codecraft.MODID + ":" + "textures/gui/GuiCodeOven.png");
  18.    
  19.     public TileEntityCodeOven codeOven;
  20.  
  21.     public GuiCodeOven(InventoryPlayer inventoryPlayer, TileEntityCodeOven entity) {
  22.         super(new ContainerCodeOven(inventoryPlayer, entity));
  23.        
  24.         this.codeOven = entity;
  25.        
  26.         this.xSize = 176;
  27.         this.ySize = 166;
  28.     }
  29.    
  30.     public void drawGuiContainerForegroundLayer(int par1, int par2){
  31.         String name = "Code Oven";
  32.         this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
  33.         this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 118, this.ySize - 96 + 2, 4210752);
  34.     }
  35.  
  36.     @Override
  37.     protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
  38.         GL11.glColor4f(1F, 1F, 1F, 1F);
  39.        
  40.         Minecraft.getMinecraft().getTextureManager().bindTexture(bground);
  41.         drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
  42.        
  43.         if(this.codeOven.isBurning()){
  44.             int k = this.codeOven.getBurnTimeRemainingScaled(40);
  45.             int j = 40 - k;
  46.             drawTexturedModalRect(guiLeft + 29, guiTop + 67, 176, 0, 40 - j, 7);
  47.         }
  48.        
  49.         int k = this.codeOven.getCookProgressScaled(24);
  50.         drawTexturedModalRect(guiLeft + 79, guiTop + 34, 176, 7, k + 1, 16);
  51.     }
  52.  
  53. }
Advertisement
Add Comment
Please, Sign In to add comment