From cc01d517d5dc81324c0b100b9a602b58a3b41dd1 Mon Sep 17 00:00:00 2001 From: Hileb <107909747+Ecdcaeb@users.noreply.github.com> Date: Wed, 1 May 2024 17:51:46 +0800 Subject: [PATCH 1/9] cache and load textures --- .../fml/client/SplashProgress.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java index cd609923c..2d84c94bd 100644 --- a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java +++ b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java @@ -405,6 +405,7 @@ public void run() Display.sync(100); } } + SplashFontRenderer.clear(); clearGL(); } @@ -893,19 +894,22 @@ public void texCoord(int frame, float u, float v) } } - private static class SplashFontRenderer extends FontRenderer + public static class SplashFontRenderer extends FontRenderer { + public static final HashMap CACHED_IMAGES = new HashMap<>(); public SplashFontRenderer() { - super(Minecraft.getMinecraft().gameSettings, fontTexture.getLocation(), null, false); + super(Minecraft.getMinecraft().gameSettings, fontTexture.getLocation(), null, true); super.onResourceManagerReload(null); } @Override protected void bindTexture(@Nonnull ResourceLocation location) { - if(location != locationFontTexture) throw new IllegalArgumentException(); - fontTexture.bind(); + if (!CACHED_IMAGES.containsKey(location)) { + CACHED_IMAGES.put(location, new Texture(location, null)); + } + CACHED_IMAGES.get(location).bind(); } @Nonnull @@ -915,6 +919,12 @@ protected IResource getResource(@Nonnull ResourceLocation location) throws IOExc DefaultResourcePack pack = Minecraft.getMinecraft().defaultResourcePack; return new SimpleResource(pack.getPackName(), location, pack.getInputStream(location), null, null); } + public static void clear(){ + for(Texture texture : CACHED_IMAGES.values()){ + texture.delete(); + } + CACHED_IMAGES.clear(); + } } public static void drawVanillaScreen(TextureManager renderEngine) throws LWJGLException From 89f3eda48f597f9a113c664b9e578f6c75247f74 Mon Sep 17 00:00:00 2001 From: Hileb <107909747+Ecdcaeb@users.noreply.github.com> Date: Wed, 1 May 2024 18:02:23 +0800 Subject: [PATCH 2/9] fix import --- src/main/java/net/minecraftforge/fml/client/SplashProgress.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java index 2d84c94bd..8b0e6edbd 100644 --- a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java +++ b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java @@ -35,6 +35,7 @@ import java.lang.Thread.UncaughtExceptionHandler; import java.nio.IntBuffer; import java.nio.charset.StandardCharsets; +import java.util.HashMap; import java.util.Iterator; import java.util.Properties; import java.util.concurrent.Semaphore; From d20de65bcd5e06e6fc4715f0dd294c3b8f87817a Mon Sep 17 00:00:00 2001 From: Hileb <107909747+Ecdcaeb@users.noreply.github.com> Date: Wed, 1 May 2024 18:07:58 +0800 Subject: [PATCH 3/9] make it un-static --- .../fml/client/SplashProgress.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java index 8b0e6edbd..eae29edf2 100644 --- a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java +++ b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java @@ -406,7 +406,7 @@ public void run() Display.sync(100); } } - SplashFontRenderer.clear(); + fontRenderer.clear(); clearGL(); } @@ -897,7 +897,7 @@ public void texCoord(int frame, float u, float v) public static class SplashFontRenderer extends FontRenderer { - public static final HashMap CACHED_IMAGES = new HashMap<>(); + public final HashMap cachedImages = new HashMap<>(); public SplashFontRenderer() { super(Minecraft.getMinecraft().gameSettings, fontTexture.getLocation(), null, true); @@ -907,10 +907,10 @@ public SplashFontRenderer() @Override protected void bindTexture(@Nonnull ResourceLocation location) { - if (!CACHED_IMAGES.containsKey(location)) { - CACHED_IMAGES.put(location, new Texture(location, null)); + if (!cachedImages.containsKey(location)) { + cachedImages.put(location, new Texture(location, null)); } - CACHED_IMAGES.get(location).bind(); + cachedImages.get(location).bind(); } @Nonnull @@ -920,11 +920,11 @@ protected IResource getResource(@Nonnull ResourceLocation location) throws IOExc DefaultResourcePack pack = Minecraft.getMinecraft().defaultResourcePack; return new SimpleResource(pack.getPackName(), location, pack.getInputStream(location), null, null); } - public static void clear(){ - for(Texture texture : CACHED_IMAGES.values()){ + public void clear(){ + for(Texture texture : cachedImages.values()){ texture.delete(); } - CACHED_IMAGES.clear(); + cachedImages.clear(); } } From 32f7e2e8042af3415071d268b4fb04348bde934b Mon Sep 17 00:00:00 2001 From: Hileb <107909747+Ecdcaeb@users.noreply.github.com> Date: Wed, 1 May 2024 18:23:16 +0800 Subject: [PATCH 4/9] set default not forced unicode --- .../java/net/minecraftforge/fml/client/SplashProgress.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java index eae29edf2..6c3ee3e86 100644 --- a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java +++ b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java @@ -261,7 +261,7 @@ public void run() logoTexture = new Texture(logoLoc, null, false); forgeTexture = new Texture(forgeLoc, forgeFallbackLoc); glEnable(GL_TEXTURE_2D); - fontRenderer = new SplashFontRenderer(); + fontRenderer = new SplashFontRenderer(false); glDisable(GL_TEXTURE_2D); while(!done) { @@ -898,9 +898,9 @@ public void texCoord(int frame, float u, float v) public static class SplashFontRenderer extends FontRenderer { public final HashMap cachedImages = new HashMap<>(); - public SplashFontRenderer() + public SplashFontRenderer(boolean isForcedUnicode) { - super(Minecraft.getMinecraft().gameSettings, fontTexture.getLocation(), null, true); + super(Minecraft.getMinecraft().gameSettings, fontTexture.getLocation(), null, isForcedUnicode); super.onResourceManagerReload(null); } From df88d6340a7b8b4484195c108c509fc3c01203a4 Mon Sep 17 00:00:00 2001 From: Hileb <107909747+Ecdcaeb@users.noreply.github.com> Date: Thu, 2 May 2024 07:28:54 +0800 Subject: [PATCH 5/9] fix npe --- .../minecraftforge/fml/client/SplashProgress.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java index 6c3ee3e86..17b93531c 100644 --- a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java +++ b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java @@ -897,7 +897,7 @@ public void texCoord(int frame, float u, float v) public static class SplashFontRenderer extends FontRenderer { - public final HashMap cachedImages = new HashMap<>(); + public HashMap cachedImages; public SplashFontRenderer(boolean isForcedUnicode) { super(Minecraft.getMinecraft().gameSettings, fontTexture.getLocation(), null, isForcedUnicode); @@ -907,6 +907,7 @@ public SplashFontRenderer(boolean isForcedUnicode) @Override protected void bindTexture(@Nonnull ResourceLocation location) { + if(cachedImages == null) cachedImages = new HashMap<>(); if (!cachedImages.containsKey(location)) { cachedImages.put(location, new Texture(location, null)); } @@ -921,10 +922,13 @@ protected IResource getResource(@Nonnull ResourceLocation location) throws IOExc return new SimpleResource(pack.getPackName(), location, pack.getInputStream(location), null, null); } public void clear(){ - for(Texture texture : cachedImages.values()){ - texture.delete(); + if(cachedImages != null){ + for(Texture texture : cachedImages.values()){ + texture.delete(); + } + cachedImages.clear(); + cachedImages = null; } - cachedImages.clear(); } } From 89dbd6b6b97fad214a8a1c566ecf320e9501e4b9 Mon Sep 17 00:00:00 2001 From: Hileb <107909747+Ecdcaeb@users.noreply.github.com> Date: Fri, 30 Aug 2024 13:18:52 +0800 Subject: [PATCH 6/9] Update SplashProgress make it implements Closeable --- .../fml/client/SplashProgress.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java index 17b93531c..4ff0fe8f1 100644 --- a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java +++ b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java @@ -745,7 +745,7 @@ private static IResourcePack createResourcePack(File file) private static final IntBuffer buf = BufferUtils.createIntBuffer(4 * 1024 * 1024); @SuppressWarnings("unused") - private static class Texture + private static class Texture implements Closeable { private final ResourceLocation location; private final int name; @@ -893,9 +893,14 @@ public void texCoord(int frame, float u, float v) { glTexCoord2f(getU(frame, u), getV(frame, v)); } + + @Override + public void close(){ + this.delete(); + } } - public static class SplashFontRenderer extends FontRenderer + public static class SplashFontRenderer extends FontRenderer implements Closeable { public HashMap cachedImages; public SplashFontRenderer(boolean isForcedUnicode) @@ -921,6 +926,7 @@ protected IResource getResource(@Nonnull ResourceLocation location) throws IOExc DefaultResourcePack pack = Minecraft.getMinecraft().defaultResourcePack; return new SimpleResource(pack.getPackName(), location, pack.getInputStream(location), null, null); } + public void clear(){ if(cachedImages != null){ for(Texture texture : cachedImages.values()){ @@ -930,6 +936,11 @@ public void clear(){ cachedImages = null; } } + + @Override + public void close(){ + this.clear(); + } } public static void drawVanillaScreen(TextureManager renderEngine) throws LWJGLException @@ -981,4 +992,4 @@ private static int bytesToMb(long bytes) { return (int) (bytes / 1024L / 1024L); } -} \ No newline at end of file +} From 72fdbbf5d93ffb16de08ed2c982ca8f1c6368e7d Mon Sep 17 00:00:00 2001 From: Hileb <107909747+Ecdcaeb@users.noreply.github.com> Date: Fri, 30 Aug 2024 22:29:34 +0800 Subject: [PATCH 7/9] fix import --- src/main/java/net/minecraftforge/fml/client/SplashProgress.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java index 4ff0fe8f1..aeccecdba 100644 --- a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java +++ b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java @@ -23,6 +23,7 @@ import static org.lwjgl.opengl.GL12.*; import java.awt.image.BufferedImage; +import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; From 1f92dc8a02233cab6eb65f862973d0b99d152565 Mon Sep 17 00:00:00 2001 From: Hileb <107909747+Ecdcaeb@users.noreply.github.com> Date: Fri, 22 Aug 2025 14:58:35 +0800 Subject: [PATCH 8/9] Update SplashProgress.java --- .../fml/client/SplashProgress.java | 289 +++++++++--------- 1 file changed, 147 insertions(+), 142 deletions(-) diff --git a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java index aeccecdba..522216138 100644 --- a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java +++ b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java @@ -262,152 +262,153 @@ public void run() logoTexture = new Texture(logoLoc, null, false); forgeTexture = new Texture(forgeLoc, forgeFallbackLoc); glEnable(GL_TEXTURE_2D); - fontRenderer = new SplashFontRenderer(false); - glDisable(GL_TEXTURE_2D); - while(!done) - { - framecount++; - ProgressBar first = null, penult = null, last = null; - Iterator i = ProgressManager.barIterator(); - while(i.hasNext()) + try (SplashFontRenderer splashFontRenderer = new SplashFontRenderer(false)){ + fontRenderer = splashFontRenderer; + glDisable(GL_TEXTURE_2D); + while(!done) { - if(first == null) first = i.next(); - else + framecount++; + ProgressBar first = null, penult = null, last = null; + Iterator i = ProgressManager.barIterator(); + while(i.hasNext()) { - penult = last; - last = i.next(); + if(first == null) first = i.next(); + else + { + penult = last; + last = i.next(); + } } - } - glClear(GL_COLOR_BUFFER_BIT); - - // matrix setup - int w = Display.getWidth(); - int h = Display.getHeight(); - glViewport(0, 0, w, h); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(320 - w/2, 320 + w/2, 240 + h/2, 240 - h/2, -1, 1); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - // mojang logo - setColor(backgroundColor); - glEnable(GL_TEXTURE_2D); - logoTexture.bind(); - glBegin(GL_QUADS); - logoTexture.texCoord(0, 0, 0); - glVertex2f(320 - 256, 240 - 256); - logoTexture.texCoord(0, 0, 1); - glVertex2f(320 - 256, 240 + 256); - logoTexture.texCoord(0, 1, 1); - glVertex2f(320 + 256, 240 + 256); - logoTexture.texCoord(0, 1, 0); - glVertex2f(320 + 256, 240 - 256); - glEnd(); - glDisable(GL_TEXTURE_2D); + glClear(GL_COLOR_BUFFER_BIT); + + // matrix setup + int w = Display.getWidth(); + int h = Display.getHeight(); + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(320 - w/2, 320 + w/2, 240 + h/2, 240 - h/2, -1, 1); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + // mojang logo + setColor(backgroundColor); + glEnable(GL_TEXTURE_2D); + logoTexture.bind(); + glBegin(GL_QUADS); + logoTexture.texCoord(0, 0, 0); + glVertex2f(320 - 256, 240 - 256); + logoTexture.texCoord(0, 0, 1); + glVertex2f(320 - 256, 240 + 256); + logoTexture.texCoord(0, 1, 1); + glVertex2f(320 + 256, 240 + 256); + logoTexture.texCoord(0, 1, 0); + glVertex2f(320 + 256, 240 - 256); + glEnd(); + glDisable(GL_TEXTURE_2D); // memory usage - if (showMemory) - { - glPushMatrix(); - glTranslatef(320 - (float) barWidth / 2, 20, 0); - drawMemoryBar(); - glPopMatrix(); - } - - // bars - if(first != null) - { - glPushMatrix(); - glTranslatef(320 - (float)barWidth / 2, 310, 0); - drawBar(first); - if(penult != null) + if (showMemory) { - glTranslatef(0, barOffset, 0); - drawBar(penult); + glPushMatrix(); + glTranslatef(320 - (float) barWidth / 2, 20, 0); + drawMemoryBar(); + glPopMatrix(); } - if(last != null) + + // bars + if(first != null) { - glTranslatef(0, barOffset, 0); - drawBar(last); + glPushMatrix(); + glTranslatef(320 - (float)barWidth / 2, 310, 0); + drawBar(first); + if(penult != null) + { + glTranslatef(0, barOffset, 0); + drawBar(penult); + } + if(last != null) + { + glTranslatef(0, barOffset, 0); + drawBar(last); + } + glPopMatrix(); } - glPopMatrix(); - } - angle += 1; - - // forge logo - glColor4f(1, 1, 1, 1); - float fw = (float)forgeTexture.getWidth() / 2; - float fh = (float)forgeTexture.getHeight() / 2; - if(rotate) - { - float sh = Math.max(fw, fh); - glTranslatef(320 + w/2 - sh - logoOffset, 240 + h/2 - sh - logoOffset, 0); - glRotatef(angle, 0, 0, 1); - } - else - { - glTranslatef(320 + w/2 - fw - logoOffset, 240 + h/2 - fh - logoOffset, 0); - } - int f = (angle / 5) % forgeTexture.getFrames(); - glEnable(GL_TEXTURE_2D); - forgeTexture.bind(); - glBegin(GL_QUADS); - forgeTexture.texCoord(f, 0, 0); - glVertex2f(-fw, -fh); - forgeTexture.texCoord(f, 0, 1); - glVertex2f(-fw, fh); - forgeTexture.texCoord(f, 1, 1); - glVertex2f(fw, fh); - forgeTexture.texCoord(f, 1, 0); - glVertex2f(fw, -fh); - glEnd(); - glDisable(GL_TEXTURE_2D); + angle += 1; - // We use mutex to indicate safely to the main thread that we're taking the display global lock - // So the main thread can skip processing messages while we're updating. - // There are system setups where this call can pause for a while, because the GL implementation - // is trying to impose a framerate or other thing is occurring. Without the mutex, the main - // thread would delay waiting for the same global display lock - mutex.acquireUninterruptibly(); - long updateStart = System.nanoTime(); - Display.update(); - // As soon as we're done, we release the mutex. The other thread can now ping the processmessages - // call as often as it wants until we get get back here again - long dur = System.nanoTime() - updateStart; - if (framecount < TIMING_FRAME_COUNT) { - updateTiming += dur; - } - mutex.release(); - if(pause) - { - clearGL(); - setGL(); - } - // Such a hack - if the time taken is greater than 10 milliseconds, we're gonna guess that we're on a - // system where vsync is forced through the swapBuffers call - so we have to force a sleep and let the - // loading thread have a turn - some badly designed mods access Keyboard and therefore GlobalLock.lock - // during splash screen, and mutex against the above Display.update call as a result. - // 4 milliseconds is a guess - but it should be enough to trigger in most circumstances. (Maybe if - // 240FPS is possible, this won't fire?) - if (framecount >= TIMING_FRAME_COUNT && updateTiming > TIMING_FRAME_THRESHOLD) { - if (!isDisplayVSyncForced) + // forge logo + glColor4f(1, 1, 1, 1); + float fw = (float)forgeTexture.getWidth() / 2; + float fh = (float)forgeTexture.getHeight() / 2; + if(rotate) { - isDisplayVSyncForced = true; - FMLLog.log.info("Using alternative sync timing : {} frames of Display.update took {} nanos", TIMING_FRAME_COUNT, updateTiming); + float sh = Math.max(fw, fh); + glTranslatef(320 + w/2 - sh - logoOffset, 240 + h/2 - sh - logoOffset, 0); + glRotatef(angle, 0, 0, 1); } - try { Thread.sleep(16); } catch (InterruptedException ie) {} - } else - { - if (framecount ==TIMING_FRAME_COUNT) { - FMLLog.log.info("Using sync timing. {} frames of Display.update took {} nanos", TIMING_FRAME_COUNT, updateTiming); + else + { + glTranslatef(320 + w/2 - fw - logoOffset, 240 + h/2 - fh - logoOffset, 0); + } + int f = (angle / 5) % forgeTexture.getFrames(); + glEnable(GL_TEXTURE_2D); + forgeTexture.bind(); + glBegin(GL_QUADS); + forgeTexture.texCoord(f, 0, 0); + glVertex2f(-fw, -fh); + forgeTexture.texCoord(f, 0, 1); + glVertex2f(-fw, fh); + forgeTexture.texCoord(f, 1, 1); + glVertex2f(fw, fh); + forgeTexture.texCoord(f, 1, 0); + glVertex2f(fw, -fh); + glEnd(); + glDisable(GL_TEXTURE_2D); + + // We use mutex to indicate safely to the main thread that we're taking the display global lock + // So the main thread can skip processing messages while we're updating. + // There are system setups where this call can pause for a while, because the GL implementation + // is trying to impose a framerate or other thing is occurring. Without the mutex, the main + // thread would delay waiting for the same global display lock + mutex.acquireUninterruptibly(); + long updateStart = System.nanoTime(); + Display.update(); + // As soon as we're done, we release the mutex. The other thread can now ping the processmessages + // call as often as it wants until we get get back here again + long dur = System.nanoTime() - updateStart; + if (framecount < TIMING_FRAME_COUNT) { + updateTiming += dur; + } + mutex.release(); + if(pause) + { + clearGL(); + setGL(); + } + // Such a hack - if the time taken is greater than 10 milliseconds, we're gonna guess that we're on a + // system where vsync is forced through the swapBuffers call - so we have to force a sleep and let the + // loading thread have a turn - some badly designed mods access Keyboard and therefore GlobalLock.lock + // during splash screen, and mutex against the above Display.update call as a result. + // 4 milliseconds is a guess - but it should be enough to trigger in most circumstances. (Maybe if + // 240FPS is possible, this won't fire?) + if (framecount >= TIMING_FRAME_COUNT && updateTiming > TIMING_FRAME_THRESHOLD) { + if (!isDisplayVSyncForced) + { + isDisplayVSyncForced = true; + FMLLog.log.info("Using alternative sync timing : {} frames of Display.update took {} nanos", TIMING_FRAME_COUNT, updateTiming); + } + try { Thread.sleep(16); } catch (InterruptedException ie) {} + } else + { + if (framecount ==TIMING_FRAME_COUNT) { + FMLLog.log.info("Using sync timing. {} frames of Display.update took {} nanos", TIMING_FRAME_COUNT, updateTiming); + } + Display.sync(100); } - Display.sync(100); } } - fontRenderer.clear(); clearGL(); } @@ -903,7 +904,8 @@ public void close(){ public static class SplashFontRenderer extends FontRenderer implements Closeable { - public HashMap cachedImages; + protected HashMap cachedImages; + public SplashFontRenderer(boolean isForcedUnicode) { super(Minecraft.getMinecraft().gameSettings, fontTexture.getLocation(), null, isForcedUnicode); @@ -913,11 +915,18 @@ public SplashFontRenderer(boolean isForcedUnicode) @Override protected void bindTexture(@Nonnull ResourceLocation location) { - if(cachedImages == null) cachedImages = new HashMap<>(); - if (!cachedImages.containsKey(location)) { - cachedImages.put(location, new Texture(location, null)); + if (cachedImages == null) { + cachedImages = new HashMap<>(); + var texture = new Texture(location, null) + cachedImages.put(location, texture = new Texture(location, null)); + texture.bind(); + } else { + var texture = cachedImages.get(location); + if (texture == null) { + cachedImages.put(location, texture = new Texture(location, null)); + } + texture.bind(); } - cachedImages.get(location).bind(); } @Nonnull @@ -927,21 +936,17 @@ protected IResource getResource(@Nonnull ResourceLocation location) throws IOExc DefaultResourcePack pack = Minecraft.getMinecraft().defaultResourcePack; return new SimpleResource(pack.getPackName(), location, pack.getInputStream(location), null, null); } - - public void clear(){ + + @Override + public void close() { if(cachedImages != null){ - for(Texture texture : cachedImages.values()){ + for(Texture texture : cachedImages.values()) { texture.delete(); } cachedImages.clear(); cachedImages = null; } } - - @Override - public void close(){ - this.clear(); - } } public static void drawVanillaScreen(TextureManager renderEngine) throws LWJGLException From b970d25c2e944d0f77f92fd26c13805516fcaea8 Mon Sep 17 00:00:00 2001 From: Hileb <107909747+Ecdcaeb@users.noreply.github.com> Date: Fri, 22 Aug 2025 15:04:27 +0800 Subject: [PATCH 9/9] Update SplashProgress.java --- src/main/java/net/minecraftforge/fml/client/SplashProgress.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java index 522216138..dc54bbe4d 100644 --- a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java +++ b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java @@ -917,7 +917,7 @@ protected void bindTexture(@Nonnull ResourceLocation location) { if (cachedImages == null) { cachedImages = new HashMap<>(); - var texture = new Texture(location, null) + var texture = new Texture(location, null); cachedImages.put(location, texture = new Texture(location, null)); texture.bind(); } else {