Skip to content

Commit dc77488

Browse files
committed
Fix to crash
1 parent a8394c1 commit dc77488

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

src/main/java/llc/redstone/hysentials/util/Renderer.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,12 +479,23 @@ private float getStringWidth(String s) {
479479
public static class Frame {
480480
int width, height;
481481
BufferedImage image;
482-
DynamicTexture texture;
482+
ITextureObject texture;
483483
public Frame(BufferedImage image) {
484484
this.image = image;
485485
this.width = image.getWidth();
486486
this.height = image.getHeight();
487487
this.texture = new DynamicTexture(image);
488488
}
489+
490+
public Frame(ResourceLocation location) {
491+
Minecraft.getMinecraft().getTextureManager().loadTexture(location, new SimpleTexture(location));
492+
this.texture = Minecraft.getMinecraft().getTextureManager().getTexture(location);
493+
try {
494+
this.image = ImageIO.read(Minecraft.getMinecraft().getResourceManager().getResource(location).getInputStream());
495+
this.width = image.getWidth();
496+
this.height = image.getHeight();
497+
} catch (IOException e) {
498+
}
499+
}
489500
}
490501
}

src/main/kotlin/llc/redstone/hysentials/updateGui/RequestUpdateGui.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ class RequestUpdateGui(private var inGame: Boolean, private var deleteOld: Boole
139139
updateImage = if (updateNotes?.image != null) {
140140
Frame(ImageIO.read(URL(updateNotes.image)))
141141
} else if (updateNotes != null) {
142-
Frame(ImageIO.read(URL("https://i.imgur.com/Qq9kXpe.png")))
142+
Frame(ResourceLocation("hysentials:gui/updater_background.png"))
143143
} else {
144-
Frame(ImageIO.read(URL("https://i.imgur.com/Qq9kXpe.png")))
144+
Frame(ResourceLocation("hysentials:gui/updater_background.png"))
145145
}
146146
} catch (e: IOException) {
147147
e.printStackTrace()
7.85 KB
Loading

0 commit comments

Comments
 (0)