aboutsummaryrefslogtreecommitdiff
path: root/fabric/src
diff options
context:
space:
mode:
authorisXander <xandersmith2008@gmail.com>2023-08-12 23:56:06 +0100
committerisXander <xandersmith2008@gmail.com>2023-08-12 23:56:06 +0100
commitd37e147dbb4db44a921533b572aed3e54b5c6a42 (patch)
tree0c72e58da081135d3819c4af7365f08c2af7fdb6 /fabric/src
parent3083aebe47f63661238ee2b521b0451af2d95e9f (diff)
downloadYetAnotherConfigLib-d37e147dbb4db44a921533b572aed3e54b5c6a42.tar.gz
YetAnotherConfigLib-d37e147dbb4db44a921533b572aed3e54b5c6a42.tar.bz2
YetAnotherConfigLib-d37e147dbb4db44a921533b572aed3e54b5c6a42.zip
Config API v2
Diffstat (limited to 'fabric/src')
-rw-r--r--fabric/src/main/java/dev/isxander/yacl3/platform/fabric/YACLPlatformImpl.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/fabric/src/main/java/dev/isxander/yacl3/platform/fabric/YACLPlatformImpl.java b/fabric/src/main/java/dev/isxander/yacl3/platform/fabric/YACLPlatformImpl.java
new file mode 100644
index 0000000..7842f97
--- /dev/null
+++ b/fabric/src/main/java/dev/isxander/yacl3/platform/fabric/YACLPlatformImpl.java
@@ -0,0 +1,23 @@
+package dev.isxander.yacl3.platform.fabric;
+
+import dev.isxander.yacl3.platform.Env;
+import net.fabricmc.loader.api.FabricLoader;
+
+import java.nio.file.Path;
+
+public class YACLPlatformImpl {
+ public static Env getEnvironment() {
+ return switch (FabricLoader.getInstance().getEnvironmentType()) {
+ case CLIENT -> Env.CLIENT;
+ case SERVER -> Env.SERVER;
+ };
+ }
+
+ public static boolean isDevelopmentEnv() {
+ return FabricLoader.getInstance().isDevelopmentEnvironment();
+ }
+
+ public static Path getConfigDir() {
+ return FabricLoader.getInstance().getConfigDir();
+ }
+}