aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/gui/widgets/GT_GuiSlotTooltip.java
blob: 015c8c76978ccbd50634f2dce25cc7f5c9613444 (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
package gregtech.api.gui.widgets;

import java.awt.Rectangle;

import net.minecraft.inventory.Slot;

import gregtech.api.util.GT_TooltipDataCache.TooltipData;

public class GT_GuiSlotTooltip extends GT_GuiTooltip {

    private final Slot slot;

    public GT_GuiSlotTooltip(Slot slot, TooltipData data) {
        super(new Rectangle(slot.xDisplayPosition - 1, slot.yDisplayPosition - 1, 18, 18), data);
        this.slot = slot;
    }

    @Override
    protected void onTick() {
        super.onTick();
        // If disabled by super, stay disabled.
        this.enabled = this.enabled && this.slot.getStack() == null;
    }
}