If a resource reload fails, for example because a resource pack contains a texture that isn't a valid PNG, the game now crashes with IllegalStateException: A reload is already scheduled! instead of turning off the packs and showing "Resource reload failed". The first reload fails as expected. The crash happens in the recovery reload, which should load the default resources. Regression introduced in 26.4 snapshot 8, in 26.4 snapshot 7 the same pack shows the "Resource reload failed" toast and the game keeps running.
Steps to reproduce
Download and enable the attached resource pack
Wait for the reload to finish.
Observed result:
java.lang.IllegalStateException: A reload is already scheduled!
at net.minecraft.client.renderer.texture.TextureManager$Entry.scheduleLoad(TextureManager.java:156)
at net.minecraft.client.renderer.texture.TextureManager.lambda$reload$0(TextureManager.java:86)
at java.base/java.util.HashMap.forEach(HashMap.java:1430)
at net.minecraft.client.renderer.texture.TextureManager.reload(TextureManager.java:85)
...
at net.minecraft.client.Minecraft.reloadResourcePacks(Minecraft.java:1102)
at net.minecraft.client.Minecraft.clearResourcePacksOnError(Minecraft.java:918)
at net.minecraft.client.Minecraft.rollbackResourcePacks(Minecraft.java:901)
Expected result:
The selected pack fails to load followed by a "Resource reload failed" toast, as in 26.4 Snapshot 7.
Additionally, this appears to be caused by the fix for MC-312399 and MC-312955 which led to TextureManager’s rewrite so that every registered texture is an Entry that reloads itself. And funnily enough those two reports are the reason I found this bug.
Thank you for helping us improve Minecraft! We saved your files: