aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/isxander/yacl3/platform
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/dev/isxander/yacl3/platform')
-rw-r--r--src/main/java/dev/isxander/yacl3/platform/YACLConfig.java18
-rw-r--r--src/main/java/dev/isxander/yacl3/platform/YACLPlatform.java5
2 files changed, 23 insertions, 0 deletions
diff --git a/src/main/java/dev/isxander/yacl3/platform/YACLConfig.java b/src/main/java/dev/isxander/yacl3/platform/YACLConfig.java
new file mode 100644
index 0000000..0d14b41
--- /dev/null
+++ b/src/main/java/dev/isxander/yacl3/platform/YACLConfig.java
@@ -0,0 +1,18 @@
+package dev.isxander.yacl3.platform;
+
+import dev.isxander.yacl3.config.v2.api.ConfigClassHandler;
+import dev.isxander.yacl3.config.v2.api.SerialEntry;
+import dev.isxander.yacl3.config.v2.api.serializer.GsonConfigSerializerBuilder;
+
+public class YACLConfig {
+ public static final ConfigClassHandler<YACLConfig> HANDLER = ConfigClassHandler.createBuilder(YACLConfig.class)
+ .id(YACLPlatform.rl("config"))
+ .serializer(config -> GsonConfigSerializerBuilder.create(config)
+ .setPath(YACLPlatform.getConfigDir().resolve("yacl.json5"))
+ .setJson5(true)
+ .build())
+ .build();
+
+ @SerialEntry
+ public boolean showColorPickerIndicator = true;
+}
diff --git a/src/main/java/dev/isxander/yacl3/platform/YACLPlatform.java b/src/main/java/dev/isxander/yacl3/platform/YACLPlatform.java
index d134e70..0a4fc04 100644
--- a/src/main/java/dev/isxander/yacl3/platform/YACLPlatform.java
+++ b/src/main/java/dev/isxander/yacl3/platform/YACLPlatform.java
@@ -2,6 +2,7 @@ package dev.isxander.yacl3.platform;
/*?if fabric {*/
import net.fabricmc.loader.api.FabricLoader;
+import net.minecraft.resources.ResourceLocation;
/*?} elif neoforge {*//*
import net.neoforged.fml.loading.FMLEnvironment;
import net.neoforged.fml.loading.FMLPaths;
@@ -13,6 +14,10 @@ import net.minecraftforge.fml.loading.FMLPaths;
import java.nio.file.Path;
public final class YACLPlatform {
+ public static ResourceLocation rl(String path) {
+ return new ResourceLocation("yet_another_config_lib_v3", path);
+ }
+
public static Env getEnvironment() {
/*?if fabric {*/
return switch (FabricLoader.getInstance().getEnvironmentType()) {