The bug
The game freezes because of being caught in an endless loop if splash text 231 (This message will never appear on the splash screen, isn't that weird?) is the only splash text in the splashes.txt
file.
How to reproduce
Download the attached resource pack
Put the resource pack into the resource pack folder of Minecraft
Start up Minecraft and activate the resource pack
Restart Minecraft; the game will freeze as soon as it tries to load into the main menu
(Simply remove the resource pack from the resource pack folder to get Minecraft to work again)
Code analysis
The following code analysis is based on a decompiled version of Minecraft 1.12.2 using MCP 9.40pre-1 with new mappings.
@unknown: The constructor of net.minecraft.client.gui.GuiMainMenu
simply picks a random splash from the splashes.txt
file until it finds one which doesn't have the Java hashCode()
"125780783". So, if there is only one splash text in the splashes file and it has this hash code, the game will stay in a while(true)
-loop forever. (or until the JVM process is killed, heh)
Suggested fix
Splash texts which should be ignored (like the one with hash code 125780783) should already be skipped when filling the list of splash texts from the text file. Then there is no loop needed when randomly picking a text from this list.
Attachments
Comments 5
I made a pack with nothing but line 231 as the only splash there (says "test") and the game didn't lock up. I guess they fixed it in 1.13 but I may be wrong/did something incorrectly.
I'm still able to reproduce using the attached resource pack (jstack for 18w30b). You need to use the contents of the existing splash 231, which is "This message will never appear on the splash screen, isn't that weird?" or similar. Note that when using the attached resource pack, you'll need to restart the game after enabling it (I think).
Please note that the fix in the code analysis part probably won't solve the problem if the
splashes.txt
file only contains splash text 231, but more than once.