Naturally Charged Creepers (Fabric)

Naturally Charged Creepers (Fabric)

87.6k Downloads

Nether Portal Spread Crash Bug ( PendingBlockTicks Tree/Hashmap)

mactso opened this issue ยท 4 comments

commented

Information

Minecraft version: 1.16.1 (and later)
Forge version: 32.0.108 (and later)
Environment: Multiplayer

Mod name: Nether Portal Spread
Mod version: netherportalspread_1.16-3.5.jar

Description

The pending blocks tree / hashmap are getting out of sync.
The root cause was updating these lists from a different thread than minecraft with a call to set blocks based on scheduled ticks. The list should only be modified in the main thread.

Lupicus says when the main threads server thread checks the two lists in the middle of your update, the two lists are in different states and it crashes. The work needs to be scheduled in the main thread with enqueue apparently.

Crash report

BlockPos{x=100, y=56, z=460}
[02:00:20] [Server thread/WARN]: Skipping Entity with id clumps:xp_orb_big
[02:03:41] [Server thread/ERROR]: Encountered an unexpected exception
net.minecraft.crash.ReportedException: Exception ticking world
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:856) ~[?:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:286) ~[?:?]
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:788) ~[?:?]
at net.minecraft.server.MinecraftServer.func_240802v(MinecraftServer.java:643) ~[?:?]
at net.minecraft.server.MinecraftServer.lambda$func_240784a$0(MinecraftServer.java:230) ~[?:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
Caused by: java.lang.IllegalStateException: TickNextTick list out of synch
at net.minecraft.world.server.ServerTickList.func_205365_a(SourceFile:54) ~[?:?]
at net.minecraft.world.server.ServerWorld.func_72835_b(ServerWorld.java:329) ~[?:?]
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:852) ~[?:?]
... 5 more

commented

Saw a similar crash report for 15.2 for the same crash reported to RandomPatches which has NetherPortalSpread in the modlist. So it might be happening in 15.2 as well.

https://gist.github.com/OldDogy/8f4d22f4077536672c3a05e32e8abc4a

commented

Oh and unrelated to the crash- what do you think about a little randomness to spread so it isn't a perfect sphere. Maybe perlin noise.

commented

Mod name: NetherPortalSpread

commented

Thanks for opening the issue. It took an almost complete rewrite of the code, but I've just released version 4.0 of the mod which should solve this issue. All code is now run on the main thread. I've also made the mod a lot more efficient. Hope you'll give it another try!

For now I'm keeping the spread effect as a sphere, kind of like the corruption is coming from a single point. But I'll keep the idea in mind!

https://www.curseforge.com/minecraft/mc-mods/nether-portal-spread