Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.morefood.mod.gui;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.gui.inventory.GuiContainer;
- import net.minecraft.client.resources.I18n;
- import net.minecraft.entity.player.InventoryPlayer;
- import net.minecraft.util.ResourceLocation;
- import org.lwjgl.opengl.GL11;
- import com.morefood.mod.Morefood;
- import com.morefood.mod.container.ContainerSauceMaker;
- import com.morefood.mod.tileentity.TileEntitySauceMaker;
- public class GuiSauceMaker extends GuiContainer {
- public static final ResourceLocation bground = new ResourceLocation(Morefood.modid + ":" + "textures/gui/GuiSauceMaker.png");
- public TileEntitySauceMaker saucemaker;
- public GuiSauceMaker(InventoryPlayer inventoryPlayer, TileEntitySauceMaker entity) {
- super(new ContainerSauceMaker(inventoryPlayer, entity));
- this.saucemaker = entity;
- this.xSize = 176;
- this.ySize = 166;
- }
- public void drawGuiContainerForegroundLayer(int par1, int par2) {
- String name = "Sauce Maker";
- this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
- this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8 , this.ySize - 96 + 2 , 4210752);
- }
- @Override
- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
- GL11.glColor4f(1F, 1F, 1F, 1F);
- Minecraft.getMinecraft().getTextureManager().bindTexture(bground);
- int k = (this.width - this.xSize) / 2;
- int l = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, this.xSize, this.ySize);
- if (this.saucemaker.isBurning())
- {
- //Fuel Remaining reserve bar
- float time2 = this.saucemaker.getBurnTimeRemainingScaled(16);
- int time = (int) time2;
- if(time2 < 1) {
- time = 1;
- }
- /**
- * guiLeft = pixels measured from the left side
- * guiTop = pixels measured from the top
- */
- this.drawTexturedModalRect(guiLeft + 23, guiTop + 30 + 16 - time, 176, 16 - time, 11, time);
- //Progress bar
- time = this.saucemaker.getCookProgressScaled(44);
- this.drawTexturedModalRect(guiLeft + 47, guiTop + 20, 176, 16, time + 0, 27);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment