-
Notifications
You must be signed in to change notification settings - Fork 308
Expand file tree
/
Copy pathSwitchOption.java
More file actions
30 lines (23 loc) · 857 Bytes
/
SwitchOption.java
File metadata and controls
30 lines (23 loc) · 857 Bytes
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
package net.vulkanmod.config;
import net.minecraft.client.gui.components.AbstractWidget;
import net.vulkanmod.config.widget.OptionWidget;
import net.vulkanmod.config.widget.SwitchOptionWidget;
import java.util.function.Consumer;
import java.util.function.Supplier;
public class SwitchOption extends Option<Boolean> {
public SwitchOption(String name, Consumer<Boolean> setter, Supplier<Boolean> getter) {
super(name, setter, getter);
}
@Override
public AbstractWidget createWidget(int x, int y, int width, int height) {
return null;
}
@Override
public OptionWidget createOptionWidget(int x, int y, int width, int height) {
return new SwitchOptionWidget(this, x, y, width, height, this.name);
}
@Override
public void setValue(Boolean aBoolean) {
this.newValue = aBoolean;
}
}