Rain Be Gone Ritual (Fabric)

Rain Be Gone Ritual (Fabric)

229k Downloads

Server hang + crash on chunk generation `onBeeSpawn`

Trynthlas opened this issue ยท 3 comments

commented

Full crash log here: https://pastebin.com/HwCipQfE

This is with modded forge setup, a custom pack I am working on. Trying to pregen some chunks and consistently getting a crash in the process.

commented
commented

@ricksouth i am going to answer here because it makes everyones life easier.
So from what i have seen in your code (Jar download FYI) is technically there is nothing wrong with your code but i think there is a deadlock that can happen.
Basically a chunk tries to finalize its loading process and the Chunk gets requested. The ExecutorThread is stuck though with the processing of finishing the Chunk thats why it can not execute the ChunkRequest, causing a deadlock.
A simple fix to that would be to check if the chunk already exists or keep track yourself of loaded chunks since onChunkLoad event is called directly after all entities were added.

So you could have a Map<World, LongSet> and everytime a bee tries to spawn you check if the Chunk is actually loaded in there.
If that is not the case you can just go through every entity that spawns during the ChunkLoad Event.

Otherwise I have no idea what this causes but i can tell you already you have a very unique case where i have never seen a mod that spawns entity on spawning a Entity.

I hope that helps.

commented

Thanks Speiger! I've added a check whether the chunk is loaded. Fixed in version 1.1 of the mod.

https://www.curseforge.com/minecraft/mc-mods/realistic-bees