From 037bf3249e12f0977c4710d0459d2e06a35759b2 Mon Sep 17 00:00:00 2001 From: XyperCode Date: Sun, 1 Sep 2024 15:11:41 +0200 Subject: [PATCH] Fix toast notifications --- .../main/java/com/ultreon/devices/api/app/component/Image.java | 1 + .../com/ultreon/devices/core/client/ClientNotification.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/ultreon/devices/api/app/component/Image.java b/common/src/main/java/com/ultreon/devices/api/app/component/Image.java index 866626b7..bcb4f004 100644 --- a/common/src/main/java/com/ultreon/devices/api/app/component/Image.java +++ b/common/src/main/java/com/ultreon/devices/api/app/component/Image.java @@ -456,6 +456,7 @@ public void setup(final Image image) { OnlineRequest.checkURLForSuspicions(url); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestProperty("User-Agent", "Mozilla/5.0"); + conn.setRequestProperty("Accept", "image/png"); InputStream connIn = conn.getInputStream(); byte[] bytes = connIn.readAllBytes(); connIn.close(); diff --git a/common/src/main/java/com/ultreon/devices/core/client/ClientNotification.java b/common/src/main/java/com/ultreon/devices/core/client/ClientNotification.java index 386230cc..288ecc32 100644 --- a/common/src/main/java/com/ultreon/devices/core/client/ClientNotification.java +++ b/common/src/main/java/com/ultreon/devices/core/client/ClientNotification.java @@ -44,7 +44,7 @@ public Visibility render(@NotNull GuiGraphics graphics, ToastComponent toastComp } RenderSystem.setShaderTexture(0, icon.getIconAsset()); - RenderUtil.drawRectWithTexture(null, graphics, 6, 6, icon.getGridWidth(), icon.getGridHeight(), icon.getU(), icon.getV(), icon.getSourceWidth(), icon.getSourceHeight(), icon.getIconSize(), icon.getIconSize()); + graphics.blit(icon.getIconAsset(), 6, 6, icon.getGridWidth(), icon.getGridHeight(), icon.getU(), icon.getV(), icon.getIconSize(), icon.getIconSize(), icon.getSourceWidth(), icon.getSourceHeight()); return timeSinceLastVisible >= 5000L ? Visibility.HIDE : Visibility.SHOW; }