
[1.19.2 Fabric] Drowned Guardian Jockey mixin will deadlock world generation.
TelepathicGrunt opened this issue Β· 10 comments
I am the dev for Repurposed Structures and looked into a deadlock reported to me with All of Fabric 6 modpack. The user was finding the game was locking up and staying stuck forever when certain chunks are attempted to be generated.
I went ahead and performed a thread dump and found this: https://controlc.com/1809dda0
Basically, this code is unsafe and should never be ran during world generation. The reason why is because the chunk is currently generating, tries to spawn a structure, structure tries to spawn a Drowned as part of it, this mod's mixin runs and tries to add Drowned as passenger to Guardian, triggers the onDismounted method, which then calls the getBlockState method for the entity's ServerLevel instead of the WorldGenRegion, now code path is locked up waiting for the currently generating chunk to finish generating except that is itself so it is stuck waiting on itself.
Perhaps you can replace this code with directly setting the passenger and vehicle fields instead in a way that is safe for worldgen. Or look into how vanilla is able to spawn entities with riders safely from nbt files during worldgen. You can test your fix by running your mod with my Repurposed Structures mod, use /locate command to find my Jungle Fortress that spawns Drowned when tunnels are below sea level, and teleport to it. If all the chunks around generates properly and nothing is stuck, the fix works
Hello, thanks for your report! I guess it's the same issue I had with Unstructured on #36. At that time, I didn't understand what would be the issue as I was doing the same thing I found on Minecraft code but it seems I missed something. I will check again soon, thanks again!
Looks like all your jockey code are running the same method and all are unsafe for worldgen jockey spawning:
Hey so I've got the same bug when building myself a modpack.
Steps for reproduction:
- Load the modpack (attached in the end of this message)
- Create a world with seed "test", cheats: on, difficulty: hard. Leave all other settings as is, including the BetterX world type
- Start the game, you should spawn in a green area
- Upon spawning set gamemode to creative
- Enter the following lines to the chat, copying one by one and pressing enter after each:
#allowdiagonalascend true
#allowdiagonaldescend true
#allowparkour true
#goal 10000 10000 10000
#path
I think you know what is Baritone, but just in case: you should see that the bot confirms all these commands. You don't need the /
at the start! Just send these messages into the chat.
- Observe how Baritone navigates you through the world for a while.
- Upon reaching the point shown on the screenshot, roughly about 3400, 72, 3400 you shall encounter this bug and find yourself at the spot shown in the screenshot
Modpack:
Journey's End Light-1.4.zip
This bug has nothing to do with any other mod. The bug is specifically a mixin into drowned spawning code and calling a method that is not worldgen safe. Drowned saved as part of a structure nbt file will spawn during worldgen and trigger this mixin to run. Thatβs what the deadlock is. No need for lithium or whatever. They play no role in this
Oh great! Than that's the explanation.
Let's hope it's fixed asap then! π
EDIT: I've updated my comment and removed the irrelevant info!
Sorry, didn't really read your original post thoroughly at first, you basically explained it there already.
I'm experiencing this as well in my modpack. Traced it back to this mod. Telepathic Grunt is entirely correct.
Yeah. Just a notice: I've left the modpack and reproduction info because it's a 100% reproduction case.
Might be used for verifying the solution if needed.
Thank you for your additional information. I already knew this bug thanks to the issue though, so I will be working on fixing this as soon as I have time. The fix should come with next version =)
Thank you all for your help, this was really helpful =)
This is fixed on 1.20.1 (and newer) versions
@charlyb01 I've found this issue due to a crash report on my mod page for Bygone Nether. When you mention fixing it for 1.20.1, do you not support previous versions? If not, I will list as an incompatibility with mine for those versions.