From 646c7bac69dba476b3f9171568091eb23a86edaa Mon Sep 17 00:00:00 2001 From: isXander Date: Wed, 29 May 2024 22:42:46 +0100 Subject: 1.21 compat --- .../dev/isxander/yacl3/platform/YACLPlatform.java | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/main/java/dev/isxander/yacl3/platform') diff --git a/src/main/java/dev/isxander/yacl3/platform/YACLPlatform.java b/src/main/java/dev/isxander/yacl3/platform/YACLPlatform.java index bfb0586..e330324 100644 --- a/src/main/java/dev/isxander/yacl3/platform/YACLPlatform.java +++ b/src/main/java/dev/isxander/yacl3/platform/YACLPlatform.java @@ -14,8 +14,28 @@ import net.minecraft.resources.ResourceLocation; import java.nio.file.Path; public final class YACLPlatform { + public static ResourceLocation parseRl(String rl) { + /*? if >1.20.6 {*//* + return ResourceLocation.parse(rl); + *//*?} else {*/ + return new ResourceLocation(rl); + /*?}*/ + } + public static ResourceLocation rl(String path) { - return new ResourceLocation("yet_another_config_lib_v3", path); + return rl("yet_another_config_lib_v3", path); + } + + public static ResourceLocation mcRl(String path) { + return rl("minecraft", path); + } + + public static ResourceLocation rl(String namespace, String path) { + /*? if >1.20.6 {*//* + return ResourceLocation.fromNamespaceAndPath(namespace, path); + *//*?} else {*/ + return new ResourceLocation(namespace, path); + /*?}*/ } public static Env getEnvironment() { -- cgit