aboutsummaryrefslogtreecommitdiff
path: root/common/src/main/java/dev/isxander/yacl3/api/controller
diff options
context:
space:
mode:
authorCrendgrim <Crendgrim@users.noreply.github.com>2023-08-31 00:06:47 +0200
committerGitHub <noreply@github.com>2023-08-30 23:06:47 +0100
commit554646dbd857e2fab1be8339ce8d0231ef2dbb4c (patch)
treeb55e6f1d282c18e743857bba3c9d5e4f226200ed /common/src/main/java/dev/isxander/yacl3/api/controller
parentc11566072608683034864dbd4e0d3f5afa067537 (diff)
downloadYetAnotherConfigLib-554646dbd857e2fab1be8339ce8d0231ef2dbb4c.tar.gz
YetAnotherConfigLib-554646dbd857e2fab1be8339ce8d0231ef2dbb4c.tar.bz2
YetAnotherConfigLib-554646dbd857e2fab1be8339ce8d0231ef2dbb4c.zip
Add dropdown controllers (#95)
Diffstat (limited to 'common/src/main/java/dev/isxander/yacl3/api/controller')
-rw-r--r--common/src/main/java/dev/isxander/yacl3/api/controller/DropdownStringControllerBuilder.java18
-rw-r--r--common/src/main/java/dev/isxander/yacl3/api/controller/ItemControllerBuilder.java11
2 files changed, 29 insertions, 0 deletions
diff --git a/common/src/main/java/dev/isxander/yacl3/api/controller/DropdownStringControllerBuilder.java b/common/src/main/java/dev/isxander/yacl3/api/controller/DropdownStringControllerBuilder.java
new file mode 100644
index 0000000..3f5fb33
--- /dev/null
+++ b/common/src/main/java/dev/isxander/yacl3/api/controller/DropdownStringControllerBuilder.java
@@ -0,0 +1,18 @@
+package dev.isxander.yacl3.api.controller;
+
+import dev.isxander.yacl3.api.Option;
+import dev.isxander.yacl3.impl.controller.DropdownStringControllerBuilderImpl;
+
+import java.util.List;
+
+public interface DropdownStringControllerBuilder extends StringControllerBuilder {
+ DropdownStringControllerBuilder values(List<String> values);
+ DropdownStringControllerBuilder values(String... values);
+ DropdownStringControllerBuilder allowEmptyValue(boolean allowEmptyValue);
+ DropdownStringControllerBuilder allowAnyValue(boolean allowAnyValue);
+
+
+ static DropdownStringControllerBuilder create(Option<String> option) {
+ return new DropdownStringControllerBuilderImpl(option);
+ }
+}
diff --git a/common/src/main/java/dev/isxander/yacl3/api/controller/ItemControllerBuilder.java b/common/src/main/java/dev/isxander/yacl3/api/controller/ItemControllerBuilder.java
new file mode 100644
index 0000000..5a1f5fa
--- /dev/null
+++ b/common/src/main/java/dev/isxander/yacl3/api/controller/ItemControllerBuilder.java
@@ -0,0 +1,11 @@
+package dev.isxander.yacl3.api.controller;
+
+import dev.isxander.yacl3.api.Option;
+import dev.isxander.yacl3.impl.controller.ItemControllerBuilderImpl;
+import net.minecraft.world.item.Item;
+
+public interface ItemControllerBuilder extends ControllerBuilder<Item> {
+ static ItemControllerBuilder create(Option<Item> option) {
+ return new ItemControllerBuilderImpl(option);
+ }
+}