aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/isxander/yacl3/gui/utils/MiscUtil.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/dev/isxander/yacl3/gui/utils/MiscUtil.java')
-rw-r--r--src/main/java/dev/isxander/yacl3/gui/utils/MiscUtil.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/dev/isxander/yacl3/gui/utils/MiscUtil.java b/src/main/java/dev/isxander/yacl3/gui/utils/MiscUtil.java
new file mode 100644
index 0000000..354b38e
--- /dev/null
+++ b/src/main/java/dev/isxander/yacl3/gui/utils/MiscUtil.java
@@ -0,0 +1,14 @@
+package dev.isxander.yacl3.gui.utils;
+
+import net.minecraft.core.Registry;
+import net.minecraft.resources.ResourceLocation;
+
+public class MiscUtil {
+ public static <T> T getFromRegistry(Registry<T> registry, ResourceLocation identifier) {
+ //? if >=1.21.2 {
+ return registry.getValue(identifier);
+ //?} else {
+ /*return registry.get(identifier);
+ *///?}
+ }
+}