aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/gui/GT_GUIContainer_BronzeBlastFurnace.java
blob: b92f7e9243c0510f3650286c94e2cb58f9d81112 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package gregtech.common.gui;

import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.InventoryPlayer;

public class GT_GUIContainer_BronzeBlastFurnace extends GT_GUIContainerMetaTile_Machine {

    private final int textColor = this.getTextColorOrDefault("title", 0x404040);

    public GT_GUIContainer_BronzeBlastFurnace(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
        super(
                new GT_Container_BronzeBlastFurnace(aInventoryPlayer, aTileEntity),
                "gregtech:textures/gui/BronzeBlastFurnace.png");
    }

    @Override
    protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
        this.fontRendererObj.drawString("Bronze Blast Furnace", 8, 4, textColor);
    }

    @Override
    protected void drawGuiContainerBackgroundLayer(float parTicks, int mouseX, int mouseY) {
        super.drawGuiContainerBackgroundLayer(parTicks, mouseX, mouseY);
        int x = (this.width - this.xSize) / 2;
        int y = (this.height - this.ySize) / 2;
        drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
        if ((this.mContainer != null) && (this.mContainer.mProgressTime > 0)) {
            drawTexturedModalRect(
                    x + 58,
                    y + 28,
                    176,
                    0,
                    Math.max(
                            0,
                            Math.min(
                                    20,
                                    (this.mContainer.mProgressTime > 0 ? 1 : 0)
                                            + this.mContainer.mProgressTime
                                                    * 20
                                                    / (this.mContainer.mMaxProgressTime < 1
                                                            ? 1
                                                            : this.mContainer.mMaxProgressTime))),
                    11);
        }
    }
}