Ruins (Structure Spawning System)

Ruins (Structure Spawning System)

23M Downloads

[Dynamic Lights] 1.18.1 Deadlock on World Creation

Darkosto opened this issue ยท 6 comments

commented

Hey AtomicStryker,

I've run across a bit of an issue involving Dynamic Lights. This is a bit of a difficult issue to replicate, but after spending quite some time we've identified what's going on.

After loading up a MC client and creating a new world, the game will deadlock and won't proceed. You have to kill the instance and start again to get into a world. The issue will not be on every world load, so it's tough to debug right away. After narrowing it down to Dynamic Lights, we did a thread dump and discovered that it's most likely Dynamic Lights accessing Entity#level#getBlockState before worker threads are available and before the chunk is finished.

It should be fixable by inserting: if(!entity.level.isLoaded(pos)) return; at https://github.com/AtomicStryker/atomicstrykers-minecraft-mods/blob/1.18/DynamicLights/src/main/java/atomicstryker/dynamiclights/server/modules/DroppedItemsLightSource.java#L135

MC: 1.18.1
Forge: 39.1.0
Dynamic Lights: 1.18.3

Let me know if I can provide any further info to help out or test. Thank you!
Darkosto

commented

Thanks for the report, i've pushed 1.18.4 to curse (for MC 1.18.2)
59c114e
If you need a build for 1.18.1, i guess i could make one

commented

1.18.2 breaks a lot of things for a lot of mods, manually due to major changes to how registration is loaded now.
So a lot of mods is still "stuck" on 1.18.1, so a 1.18.1 version would be much appreciated :)

commented

Sure thing. 1.18.1 version built and sent to curse

commented

So that didn't actually appear to fix it...
It's passing the check and then still deadlocking, which should be technically impossible since passing isLoaded means the chunk is already present.

Do you think you could possibly drop the getBlockState entirely and defer to entity#isInWater like you do here https://github.com/AtomicStryker/atomicstrykers-minecraft-mods/blob/1.18/DynamicLights/src/main/java/atomicstryker/dynamiclights/server/modules/DroppedItemsLightSource.java#L168

commented

7cbf42d

OK, pushed 1.18.5 for MC 1.18.1 to curse

commented

Everything is working great after the update. Thank you very much!