Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package qwertyasdef.alchemtrans.client.gui;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.gui.inventory.GuiContainer;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.inventory.IInventory;
- import net.minecraft.util.ResourceLocation;
- import qwertyasdef.alchemtrans.AlchemTrans;
- import qwertyasdef.alchemtrans.Tile.TileNetherrackFurnace;
- import qwertyasdef.alchemtrans.inventory.ContainerNetherrackFurnace;
- public class GuiNetherrackFurnace extends GuiContainer {
- private TileNetherrackFurnace tileEntity;
- public GuiNetherrackFurnace(TileNetherrackFurnace tileEntity, ContainerNetherrackFurnace container) {
- super(container);
- this.tileEntity = tileEntity;
- this.xSize = 176;
- this.ySize = 166;
- }
- public void drawScreen(int mouseX, int mouseY, float partialTicks) {
- this.drawDefaultBackground();
- super.drawScreen(mouseX, mouseY, partialTicks);
- this.renderHoveredToolTip(mouseX, mouseY);
- }
- @Override
- protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
- GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(new ResourceLocation(AlchemTrans.MODID, "textures/gui/container/netherrack_furnace.png"));
- int i = (this.width - this.xSize) / 2;
- int j = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);
- int l = this.getCookProgressScaled(24);
- this.drawTexturedModalRect(i + 79, j + 34, 176, 0, l + 1, 16);
- }
- @Override
- protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
- String s = this.tileEntity.getDisplayName().getUnformattedText();
- this.fontRenderer.drawString(s, this.xSize / 2 - this.fontRenderer.getStringWidth(s) / 2, 6, 4210752);
- this.fontRenderer.drawString(Minecraft.getMinecraft().player.inventory.getDisplayName().getUnformattedText(), 8, this.ySize - 96 + 2, 4210752);
- }
- private int getCookProgressScaled(int pixels)
- {
- int i = this.tileEntity.getField(0);
- int j = this.tileEntity.getField(1);
- return j != 0 && i != 0 ? i * pixels / j : 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement