palmerjj01

GuiYoshiOven

Oct 11th, 2014
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. package palmerjj01.YoshiCraft.Gui;
  2.  
  3. import net.minecraft.client.Minecraft;
  4. import net.minecraft.client.gui.inventory.GuiContainer;
  5. import net.minecraft.client.resources.I18n;
  6. import net.minecraft.entity.player.InventoryPlayer;
  7. import net.minecraft.util.ResourceLocation;
  8.  
  9. import org.lwjgl.opengl.GL11;
  10.  
  11. import palmerjj01.YoshiCraft.Container.ContainerYoshiOven;
  12. import palmerjj01.YoshiCraft.TileEntity.TileEntityYoshiOven;
  13.  
  14.  
  15. public class GuiYoshiOven extends GuiContainer {
  16.  
  17. public static final ResourceLocation bground = new ResourceLocation("yc:textures/gui/guiyoshiOven.png");
  18.  
  19. public TileEntityYoshiOven yoshiOven;
  20.  
  21. public GuiYoshiOven(InventoryPlayer inventoryPlayer, TileEntityYoshiOven entity) {
  22. super(new ContainerYoshiOven(inventoryPlayer, entity));
  23.  
  24. this.yoshiOven = entity;
  25.  
  26. this.xSize = 176;
  27. this.ySize = 166;
  28. }
  29.  
  30.  
  31. public void drawGuiContainerForegroundLayer(int par1, int par2) {
  32.  
  33. String name = this.yoshiOven.hasCustomInventoryName() ? this.yoshiOven.getInventoryName() : I18n.format(this.yoshiOven.getInventoryName(), new Object[0]);
  34. this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
  35. this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 118, this.ySize - 96 + 2, 4210752);
  36. }
  37.  
  38. @Override
  39. protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
  40. GL11.glColor4f(1F, 1F, 1F, 1F);
  41.  
  42. Minecraft.getMinecraft().getTextureManager().bindTexture(bground);
  43. drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
  44.  
  45. if(this.yoshiOven.isBurning()) {
  46. int k = this.yoshiOven.getBurnTimeRemainingScaled(40);
  47. int j = 40 - k;
  48. drawTexturedModalRect(guiLeft + 29, guiTop + 65, 176, 0, 40 - j, 10);
  49. }
  50.  
  51. int k = this.yoshiOven.getCookProgressScaled(24);
  52. drawTexturedModalRect(guiLeft + 79, guiTop + 34, 176, 10, k + 1, 16);
  53. }
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment