aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/isxander/yacl3/gui/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/dev/isxander/yacl3/gui/utils')
-rw-r--r--src/main/java/dev/isxander/yacl3/gui/utils/YACLRenderHelper.java (renamed from src/main/java/dev/isxander/yacl3/gui/utils/ButtonTextureRenderer.java)13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/main/java/dev/isxander/yacl3/gui/utils/ButtonTextureRenderer.java b/src/main/java/dev/isxander/yacl3/gui/utils/YACLRenderHelper.java
index aa52a3f..b49557b 100644
--- a/src/main/java/dev/isxander/yacl3/gui/utils/ButtonTextureRenderer.java
+++ b/src/main/java/dev/isxander/yacl3/gui/utils/YACLRenderHelper.java
@@ -1,10 +1,11 @@
package dev.isxander.yacl3.gui.utils;
import com.mojang.blaze3d.systems.RenderSystem;
+import dev.isxander.yacl3.platform.YACLPlatform;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.resources.ResourceLocation;
-public class ButtonTextureRenderer {
+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
@@ -16,7 +17,7 @@ public class ButtonTextureRenderer {
private static final ResourceLocation SLIDER_LOCATION = new ResourceLocation("textures/gui/slider.png");
*//*?}*/
- public static void render(GuiGraphics graphics, int x, int y, int width, int height, boolean enabled, boolean focused) {
+ public static void renderButtonTexture(GuiGraphics graphics, int x, int y, int width, int height, boolean enabled, boolean focused) {
/*? if >1.20.1 {*/
graphics.blitSprite(SPRITES.get(enabled, focused), x, y, width, height);
/*?} else {*//*
@@ -31,4 +32,12 @@ public class ButtonTextureRenderer {
graphics.blitNineSliced(SLIDER_LOCATION, x, y, width, height, 20, 4, 200, 20, 0, textureV);
*//*?}*/
}
+
+ public static ResourceLocation getSpriteLocation(String path) {
+ /*? if >1.20.3 {*/
+ return YACLPlatform.rl(path);
+ /*? } else {*//*
+ return YACLPlatform.rl("textures/gui/sprites/" + path + ".png");
+ *//*?}*/
+ }
}