aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/isxander/yacl3/gui/YACLTooltip.java
blob: 7c1e7e1501f412ad3290bc03dbddd8510f149e03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package dev.isxander.yacl3.gui;

import net.minecraft.client.gui.components.Tooltip;
import net.minecraft.client.gui.navigation.ScreenRectangle;
import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipPositioner;
import net.minecraft.network.chat.Component;

public class YACLTooltip extends Tooltip {
    private final net.minecraft.client.gui.components.AbstractWidget widget;

    public YACLTooltip(Component tooltip, net.minecraft.client.gui.components.AbstractWidget widget) {
        super(tooltip, tooltip);
        this.widget = widget;
    }

    //? if >1.20.1 && <=1.20.4 {
    /*@Override
    protected ClientTooltipPositioner createTooltipPositioner(boolean bl, boolean bl2, ScreenRectangle screenRectangle) {
        return new YACLTooltipPositioner(widget);
    }
    *///?}
}