blob: 1e628e992e6f8c946a7f29b123a718d06933fd84 (
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
|
package de.hysky.skyblocker.utils.tooltip;
import net.minecraft.screen.slot.Slot;
import net.minecraft.text.Text;
import java.util.List;
import java.util.regex.Pattern;
/**
* Extend this class and add it to {@link TooltipManager#adders} to add additional text to tooltips.
*/
public abstract class TooltipAdder {
public final Pattern titlePattern;
//Lower priority means it will be applied first
public final int priority;
protected TooltipAdder(String titlePattern, int priority) {
this(Pattern.compile(titlePattern), priority);
}
protected TooltipAdder(Pattern titlePattern, int priority) {
this.titlePattern = titlePattern;
this.priority = priority;
}
/**
* Creates a TooltipAdder that will be applied to all screens.
*/
protected TooltipAdder(int priority) {
this.titlePattern = null;
this.priority = priority;
}
public abstract void addToTooltip(List<Text> lore, Slot focusedSlot);
}
|