Decide an official policy in case random things conflicts with Sponge async lighting
liach opened this issue ยท 0 comments
Currently, the spectre illuminator is not compatible with Sponge's async lighting system.
Example stacktrace:
[22:24:23] [Sponge - Async Light Thread/ERROR] [Sponge]: Attempted to call MapStorage#setData from off the main thread!
java.lang.Exception: Dummy exception
at net.minecraft.world.storage.MapStorage.handler$onSetData$zof000(SourceFile:1057) ~[bfm.class:?]
at net.minecraft.world.storage.MapStorage.func_75745_a(SourceFile) ~[bfm.class:?]
at lumien.randomthings.handler.spectreilluminator.SpectreIlluminationHandler.get(SpectreIlluminationHandler.java:43) ~[SpectreIlluminationHandler.class:?]
at lumien.randomthings.handler.AsmHandler.overrideLightValue(AsmHandler.java:120) ~[AsmHandler.class:?]
at net.minecraft.block.Block.getLightValue(Block.java) ~[aow.class:?]
at net.minecraft.block.state.BlockStateContainer$StateImplementation.getLightValue(BlockStateContainer.java:510) ~[awu$a.class:?]
at org.spongepowered.common.SpongeImplHooks.getChunkPosLight(SpongeImplHooks.java:1341) ~[SpongeImplHooks.class:1.12.2-2768-7.1.5]
at net.minecraft.world.WorldServer.getRawBlockLightAsync(WorldServer.java:4304) ~[oo.class:?]
at net.minecraft.world.WorldServer.checkLightAsync(WorldServer.java:4135) ~[oo.class:?]
at net.minecraft.world.WorldServer.lambda$updateLightAsync$0(WorldServer.java:4244) ~[oo.class:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
The cause is that spectre illuminator expects lighting to be processed on the server thread while sponge does it in another thread.
Proposed solutions:
- Migrate the light storage for spectre illuminator to something not attached to a world to prevent off-thread access to a world.
- Notify users to disable Sponge async lighting when using with Sponge.
This is not really a bug; I just want to hear your stance on this.