aboutsummaryrefslogtreecommitdiff
path: root/common/src/main/java/dev/isxander/yacl/api/OptionDescription.java
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/main/java/dev/isxander/yacl/api/OptionDescription.java')
-rw-r--r--common/src/main/java/dev/isxander/yacl/api/OptionDescription.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/common/src/main/java/dev/isxander/yacl/api/OptionDescription.java b/common/src/main/java/dev/isxander/yacl/api/OptionDescription.java
new file mode 100644
index 0000000..3b28a65
--- /dev/null
+++ b/common/src/main/java/dev/isxander/yacl/api/OptionDescription.java
@@ -0,0 +1,39 @@
+package dev.isxander.yacl.api;
+
+import dev.isxander.yacl.gui.ImageRenderer;
+import dev.isxander.yacl.impl.OptionDescriptionImpl;
+import net.minecraft.network.chat.Component;
+import net.minecraft.resources.ResourceLocation;
+
+import java.nio.file.Path;
+import java.util.Optional;
+import java.util.concurrent.CompletableFuture;
+
+public interface OptionDescription {
+ Component descriptiveName();
+
+ Component description();
+
+ CompletableFuture<Optional<ImageRenderer>> image();
+
+ static Builder createBuilder() {
+ return new OptionDescriptionImpl.BuilderImpl();
+ }
+
+ interface Builder {
+ Builder name(Component name);
+
+ Builder description(Component description);
+
+ Builder image(ResourceLocation image, int width, int height);
+ Builder image(Path path, ResourceLocation uniqueLocation);
+
+ Builder gifImage(ResourceLocation image);
+ Builder gifImage(Path path, ResourceLocation uniqueLocation);
+
+ Builder webpImage(ResourceLocation image, int frameDelayMS);
+ Builder webpImage(Path path, ResourceLocation uniqueLocation, int frameDelayMS);
+
+ OptionDescription build();
+ }
+}