aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/gui/GT_GUIContainer_PrimitiveBlastFurnace.java
blob: 060b93674aa0940d7af01ff95d07f7de89747f24 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package gregtech.common.gui;

import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.gui.widgets.GT_GuiIcon;
import gregtech.api.gui.widgets.GT_GuiTabLine.GT_GuiTabIconSet;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.nei.NEI_TransferRectHost;
import java.awt.*;
import net.minecraft.entity.player.InventoryPlayer;

public class GT_GUIContainer_PrimitiveBlastFurnace extends GT_GUIContainerMetaTile_Machine
        implements NEI_TransferRectHost {
    private String name;
    public String mNEI;
    private static final GT_GuiTabIconSet TAB_ICONSET = new GT_GuiTabIconSet(
            GT_GuiIcon.TAB_NORMAL_BRICK, GT_GuiIcon.TAB_HIGHLIGHT_BRICK, GT_GuiIcon.TAB_DISABLED_BRICK);
    private final int textColor = this.getTextColorOrDefault("title", 0x404040);

    public GT_GUIContainer_PrimitiveBlastFurnace(
            InventoryPlayer inventoryPlayer, IGregTechTileEntity tileEntity, String name, String aNEI) {
        super(
                new GT_Container_PrimitiveBlastFurnace(inventoryPlayer, tileEntity),
                String.format("gregtech:textures/gui/%s.png", name.replace(" ", "")));
        this.name = name;
        this.mNEI = aNEI;
    }

    @Override
    protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
        this.fontRendererObj.drawString(name, 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,
                                    (1)
                                            + this.mContainer.mProgressTime
                                                    * 20
                                                    / (Math.max(this.mContainer.mMaxProgressTime, 1)))),
                    11);
        }
    }

    @Override
    protected GT_GuiTabIconSet getTabBackground() {
        return TAB_ICONSET;
    }

    @Override
    public String getNeiTransferRectString() {
        return mNEI;
    }

    @Override
    public String getNeiTransferRectTooltip() {
        return "Recipes";
    }

    @Override
    public Object[] getNeiTransferRectArgs() {
        return new Object[0];
    }

    @Override
    public Rectangle getNeiTransferRect() {
        return new Rectangle(51, 10, 24, 24);
    }
}