diff options
author | isXander <xander@isxander.dev> | 2024-05-29 22:42:46 +0100 |
---|---|---|
committer | isXander <xander@isxander.dev> | 2024-05-29 22:42:46 +0100 |
commit | 646c7bac69dba476b3f9171568091eb23a86edaa (patch) | |
tree | 83727744315b956120fb573f9ecd883837b63099 /src/main/java/dev/isxander/yacl3/gui/utils | |
parent | 41253828df7c2066b5df29a32aa8e512f34ad85a (diff) | |
download | YetAnotherConfigLib-646c7bac69dba476b3f9171568091eb23a86edaa.tar.gz YetAnotherConfigLib-646c7bac69dba476b3f9171568091eb23a86edaa.tar.bz2 YetAnotherConfigLib-646c7bac69dba476b3f9171568091eb23a86edaa.zip |
1.21 compat
Diffstat (limited to 'src/main/java/dev/isxander/yacl3/gui/utils')
-rw-r--r-- | src/main/java/dev/isxander/yacl3/gui/utils/ItemRegistryHelper.java | 5 | ||||
-rw-r--r-- | src/main/java/dev/isxander/yacl3/gui/utils/YACLRenderHelper.java | 8 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/dev/isxander/yacl3/gui/utils/ItemRegistryHelper.java b/src/main/java/dev/isxander/yacl3/gui/utils/ItemRegistryHelper.java index 3c4f03a..bb6c664 100644 --- a/src/main/java/dev/isxander/yacl3/gui/utils/ItemRegistryHelper.java +++ b/src/main/java/dev/isxander/yacl3/gui/utils/ItemRegistryHelper.java @@ -1,6 +1,7 @@ package dev.isxander.yacl3.gui.utils; +import dev.isxander.yacl3.platform.YACLPlatform; import net.minecraft.ResourceLocationException; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; @@ -26,7 +27,7 @@ public final class ItemRegistryHelper { */ public static boolean isRegisteredItem(String identifier) { try { - ResourceLocation itemIdentifier = new ResourceLocation(identifier.toLowerCase()); + ResourceLocation itemIdentifier = YACLPlatform.parseRl(identifier.toLowerCase()); return BuiltInRegistries.ITEM.containsKey(itemIdentifier); } catch (ResourceLocationException e) { return false; @@ -43,7 +44,7 @@ public final class ItemRegistryHelper { */ public static Item getItemFromName(String identifier, Item defaultItem) { try { - ResourceLocation itemIdentifier = new ResourceLocation(identifier.toLowerCase()); + ResourceLocation itemIdentifier = YACLPlatform.parseRl(identifier.toLowerCase()); if (BuiltInRegistries.ITEM.containsKey(itemIdentifier)) { return BuiltInRegistries.ITEM.get(itemIdentifier); } diff --git a/src/main/java/dev/isxander/yacl3/gui/utils/YACLRenderHelper.java b/src/main/java/dev/isxander/yacl3/gui/utils/YACLRenderHelper.java index b49557b..b8293fb 100644 --- a/src/main/java/dev/isxander/yacl3/gui/utils/YACLRenderHelper.java +++ b/src/main/java/dev/isxander/yacl3/gui/utils/YACLRenderHelper.java @@ -8,10 +8,10 @@ import net.minecraft.resources.ResourceLocation; public class YACLRenderHelper { /*? if >1.20.1 {*/ private static final net.minecraft.client.gui.components.WidgetSprites SPRITES = new net.minecraft.client.gui.components.WidgetSprites( - new ResourceLocation("widget/button"), // normal - new ResourceLocation("widget/button_disabled"), // disabled & !focused - new ResourceLocation("widget/button_highlighted"), // !disabled & focused - new ResourceLocation("widget/slider_highlighted") // disabled & focused + YACLPlatform.mcRl("widget/button"), // normal + YACLPlatform.mcRl("widget/button_disabled"), // disabled & !focused + YACLPlatform.mcRl("widget/button_highlighted"), // !disabled & focused + YACLPlatform.mcRl("widget/slider_highlighted") // disabled & focused ); /*?} else {*//* private static final ResourceLocation SLIDER_LOCATION = new ResourceLocation("textures/gui/slider.png"); |