From a1182f214a2ac8ce1dfaa8e8d85b430dec23f952 Mon Sep 17 00:00:00 2001 From: LostLuma Date: Fri, 18 Oct 2024 21:12:09 +0200 Subject: [PATCH] Fix GUI textures not being rendered anymore from snapshot changes --- .../main/java/dynamic_fps/impl/DynamicFPSMod.java | 2 +- .../impl/feature/battery/BatteryToast.java | 12 ++++++------ .../java/dynamic_fps/impl/util/HudInfoRenderer.java | 6 +++--- .../{ => gui/sprites}/battery/icon/charging_0.png | Bin .../{ => gui/sprites}/battery/icon/charging_1.png | Bin .../{ => gui/sprites}/battery/icon/charging_10.png | Bin .../{ => gui/sprites}/battery/icon/charging_2.png | Bin .../{ => gui/sprites}/battery/icon/charging_3.png | Bin .../{ => gui/sprites}/battery/icon/charging_4.png | Bin .../{ => gui/sprites}/battery/icon/charging_5.png | Bin .../{ => gui/sprites}/battery/icon/charging_6.png | Bin .../{ => gui/sprites}/battery/icon/charging_7.png | Bin .../{ => gui/sprites}/battery/icon/charging_8.png | Bin .../{ => gui/sprites}/battery/icon/charging_9.png | Bin .../{ => gui/sprites}/battery/icon/draining_0.png | Bin .../{ => gui/sprites}/battery/icon/draining_1.png | Bin .../{ => gui/sprites}/battery/icon/draining_10.png | Bin .../{ => gui/sprites}/battery/icon/draining_2.png | Bin .../{ => gui/sprites}/battery/icon/draining_3.png | Bin .../{ => gui/sprites}/battery/icon/draining_4.png | Bin .../{ => gui/sprites}/battery/icon/draining_5.png | Bin .../{ => gui/sprites}/battery/icon/draining_6.png | Bin .../{ => gui/sprites}/battery/icon/draining_7.png | Bin .../{ => gui/sprites}/battery/icon/draining_8.png | Bin .../{ => gui/sprites}/battery/icon/draining_9.png | Bin .../textures/{ => gui/sprites}/battery/license.txt | 0 .../{ => gui/sprites}/battery/toast/background.png | Bin .../sprites}/battery/toast/background_icon.png | Bin .../{ => gui/sprites}/battery/toast/charging.png | Bin .../{ => gui/sprites}/battery/toast/draining.png | Bin .../{ => gui/sprites}/battery/toast/reminder.png | Bin 31 files changed, 10 insertions(+), 10 deletions(-) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/charging_0.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/charging_1.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/charging_10.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/charging_2.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/charging_3.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/charging_4.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/charging_5.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/charging_6.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/charging_7.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/charging_8.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/charging_9.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/draining_0.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/draining_1.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/draining_10.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/draining_2.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/draining_3.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/draining_4.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/draining_5.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/draining_6.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/draining_7.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/draining_8.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/icon/draining_9.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/license.txt (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/toast/background.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/toast/background_icon.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/toast/charging.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/toast/draining.png (100%) rename platforms/common/src/main/resources/assets/dynamic_fps/textures/{ => gui/sprites}/battery/toast/reminder.png (100%) diff --git a/platforms/common/src/main/java/dynamic_fps/impl/DynamicFPSMod.java b/platforms/common/src/main/java/dynamic_fps/impl/DynamicFPSMod.java index 8a1afbc9..a8e3f56a 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/DynamicFPSMod.java +++ b/platforms/common/src/main/java/dynamic_fps/impl/DynamicFPSMod.java @@ -211,7 +211,7 @@ private static void showNotification(String titleTranslationKey, String iconPath } Component title = localized("toast", titleTranslationKey); - ResourceLocation icon = ResourceLocations.of("dynamic_fps", "textures/battery/toast/" + iconPath + ".png"); + ResourceLocation icon = ResourceLocations.of("dynamic_fps", "battery/toast/" + iconPath); BatteryToast.queueToast(title, icon); } diff --git a/platforms/common/src/main/java/dynamic_fps/impl/feature/battery/BatteryToast.java b/platforms/common/src/main/java/dynamic_fps/impl/feature/battery/BatteryToast.java index 8e03db04..200ff3a3 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/feature/battery/BatteryToast.java +++ b/platforms/common/src/main/java/dynamic_fps/impl/feature/battery/BatteryToast.java @@ -23,8 +23,8 @@ public class BatteryToast implements Toast { private static BatteryToast queuedToast; - private static final ResourceLocation MOD_ICON = ResourceLocations.of("dynamic_fps", "textures/battery/toast/background_icon.png"); - private static final ResourceLocation BACKGROUND_IMAGE = ResourceLocations.of("dynamic_fps", "textures/battery/toast/background.png"); + private static final ResourceLocation MOD_ICON = ResourceLocations.of("dynamic_fps", "battery/toast/background_icon"); + private static final ResourceLocation BACKGROUND_IMAGE = ResourceLocations.of("dynamic_fps", "battery/toast/background"); private BatteryToast(Component title, ResourceLocation icon) { this.title = title; @@ -74,11 +74,11 @@ public void render(GuiGraphics graphics, Font font, long currentTime) { this.description = localized("toast", "battery_charge", BatteryTracker.charge()); } - // resource, x, y, z, ?, ?, width, height, width, height - graphics.blit(RenderType::guiTextured, BACKGROUND_IMAGE, 0, 0, 0, 0.0f, 0, this.width(), this.height(), this.width(), this.height()); + // type, resource, x, y, width, height + graphics.blitSprite(RenderType::guiTextured, BACKGROUND_IMAGE, 0, 0, this.width(), this.height()); - graphics.blit(RenderType::guiTextured, MOD_ICON, 2, 2, 0, 0.0f, 0, 8, 8, 8, 8); - graphics.blit(RenderType::guiTextured, this.icon, 8, 8, 0, 0.0f, 0, 16, 16, 16, 16); + graphics.blitSprite(RenderType::guiTextured, MOD_ICON, 2, 2, 8, 8); + graphics.blitSprite(RenderType::guiTextured, this.icon, 8, 8, 16, 16); graphics.drawString(Minecraft.getInstance().font, this.title, 30, 7, 0x5f3315, false); graphics.drawString(Minecraft.getInstance().font, this.description, 30, 18, -16777216, false); diff --git a/platforms/common/src/main/java/dynamic_fps/impl/util/HudInfoRenderer.java b/platforms/common/src/main/java/dynamic_fps/impl/util/HudInfoRenderer.java index 2c2dc560..1df6e16c 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/util/HudInfoRenderer.java +++ b/platforms/common/src/main/java/dynamic_fps/impl/util/HudInfoRenderer.java @@ -52,13 +52,13 @@ private static void drawBatteryOverlay(GuiGraphics graphics) { int index = BatteryTracker.charge() / 10; String type = BatteryUtil.isCharging(BatteryTracker.status()) ? "charging" : "draining"; - ResourceLocation icon = ResourceLocations.of("dynamic_fps", "textures/battery/icon/" + type + "_" + index + ".png"); + ResourceLocation icon = ResourceLocations.of("dynamic_fps", "battery/icon/" + type + "_" + index); // pair of coordinates int[] position = config.placement().get(graphics); - // resource, x, y, z, ?, ?, width, height, width, height - graphics.blit(RenderType::guiTextured, icon, position[0], position[1], 0, 0.0f, 0, 16, 16, 16, 16); + // type, resource, x, y, width, height + graphics.blitSprite(RenderType::guiTextured, icon, position[0], position[1], 16, 16); // font, text, x, y, text color graphics.drawString(minecraft.font, BatteryTracker.charge() + "%", position[0] + 20, position[1] + 4, 0xFFFFFF); } diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_0.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_0.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_0.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_0.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_1.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_1.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_1.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_1.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_10.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_10.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_10.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_10.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_2.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_2.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_2.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_2.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_3.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_3.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_3.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_3.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_4.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_4.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_4.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_4.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_5.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_5.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_5.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_5.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_6.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_6.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_6.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_6.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_7.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_7.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_7.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_7.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_8.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_8.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_8.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_8.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_9.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_9.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/charging_9.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/charging_9.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_0.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_0.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_0.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_0.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_1.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_1.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_1.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_1.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_10.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_10.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_10.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_10.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_2.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_2.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_2.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_2.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_3.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_3.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_3.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_3.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_4.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_4.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_4.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_4.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_5.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_5.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_5.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_5.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_6.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_6.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_6.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_6.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_7.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_7.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_7.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_7.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_8.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_8.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_8.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_8.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_9.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_9.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/icon/draining_9.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/icon/draining_9.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/license.txt b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/license.txt similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/license.txt rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/license.txt diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/toast/background.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/toast/background.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/toast/background.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/toast/background.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/toast/background_icon.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/toast/background_icon.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/toast/background_icon.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/toast/background_icon.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/toast/charging.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/toast/charging.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/toast/charging.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/toast/charging.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/toast/draining.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/toast/draining.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/toast/draining.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/toast/draining.png diff --git a/platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/toast/reminder.png b/platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/toast/reminder.png similarity index 100% rename from platforms/common/src/main/resources/assets/dynamic_fps/textures/battery/toast/reminder.png rename to platforms/common/src/main/resources/assets/dynamic_fps/textures/gui/sprites/battery/toast/reminder.png