blob: 7fbc466c3911a72fa514307610d145e36389f604 (
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
|
package dev.isxander.yacl.api;
import dev.isxander.yacl.api.utils.Dimension;
import dev.isxander.yacl.gui.AbstractWidget;
import dev.isxander.yacl.gui.YACLScreen;
import net.minecraft.text.Text;
import org.jetbrains.annotations.ApiStatus;
/**
* Provides a widget to control the option.
*/
public interface Controller<T> {
/**
* Gets the dedicated {@link Option} for this controller
*/
Option<T> option();
/**
* Gets the formatted value based on {@link Option#pendingValue()}
*/
Text formatValue();
/**
* Provides a widget to display
*
* @param screen parent screen
*/
AbstractWidget provideWidget(YACLScreen screen, Dimension<Integer> widgetDimension);
}
|