Lemonszz / Biome-Makeover

MIT License
28 stars 33 forks source link

Fix thread safety with mob spawning/creation #202

Closed TelepathicGrunt closed 1 year ago

TelepathicGrunt commented 1 year ago

A user was reporting that the Moth in Biome Makeover was crashing when the game was spawning it during worldgen: https://mclo.gs/aUscAv0

Basically you're getting the same issue as this: https://github.com/team-abnormals/savage-and-ravage/issues/119

Short summary, if you are in a spot for entities that could run in the off thread (not server thread such as worldgen which is on its own thread), do not use the level's randomsource. Use the entity's own personal randomsource.

You will need to port the fix to 1.19.3 which should just be a simple easy cherrypicking. Hope this helps

Lemonszz commented 1 year ago

👍 Ah, I already fixed a bunch of these, looks like I missed a few then lol

TelepathicGrunt commented 1 year ago

For more info, it seems C2ME had an update that made this issue more likely to trigger. Right now I had seen 6+ people asking me why Bumblezone is crashing since Better Minecraft modpacks have not yet updated Bumblezone where I temporarily removed the Biome Makeover Moth from spawning in my hanging Garden's structure. I am telling people to put on a datapack to remove the Moth from my allowed Hanging Gardens entity spawning tag as a workaround if people cannot update.

https://github.com/RelativityMC/C2ME-fabric/issues/197

C2ME did recently just put out a change in dev to make the crash no longer a crash and instead, log a warning to the log file so better Minecraft needs to update that. Just keeping you in the loop of what's going on but for now, this isn't a high priority issue as players just needs to update Bumblezone (or C2ME when they release update) to stop the crash. Once the Moth is threadsafe, I'll let it spawn in Bumblezone's hanging gardens by default again