diff options
author | Crendgrim <Crendgrim@users.noreply.github.com> | 2023-08-31 00:06:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-30 23:06:47 +0100 |
commit | 554646dbd857e2fab1be8339ce8d0231ef2dbb4c (patch) | |
tree | b55e6f1d282c18e743857bba3c9d5e4f226200ed /common/src/main/java/dev/isxander/yacl3/api/controller | |
parent | c11566072608683034864dbd4e0d3f5afa067537 (diff) | |
download | YetAnotherConfigLib-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.java | 18 | ||||
-rw-r--r-- | common/src/main/java/dev/isxander/yacl3/api/controller/ItemControllerBuilder.java | 11 |
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); + } +} |