aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/gui/widgets/GT_GuiSlotTooltip.java
blob: 1fb25ecb1add182bca84e345b03bdf84d365f411 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package gregtech.api.gui.widgets;

import java.awt.Rectangle;

import gregtech.api.util.GT_TooltipDataCache.TooltipData;
import net.minecraft.inventory.Slot;

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;
    }
}