[BUG] Outvoted causes all structures that spawns Blazes at generation to hang forever
TelepathicGrunt opened this issue ยท 2 comments
When using my mod Repurposed Structures with Outvoted, trying to go to a Nether City will cause the game to deadlock and hang forever.
https://www.curseforge.com/minecraft/mc-mods/repurposed-structures
Here's where the deadlocking occurs. func_213386_a is MobEntity.onInitialSpawn and func_180495_p is IBlockReader.getBlockState.
https://imgur.com/a/0L2K0El
From that and with help of another player, we found Outvoted is calling getBlockState in BlazeEntity's onInitialSpawn which is causing the deadlock. The reason this is dangerous is because any time someone tries to spawn a Blaze mob as part of worldgen or part of structure generation, IBlockReader.getBlockState will try to get the block from the World which will go to the currently generated chunk and wait for it to finish before getting the block. Except, IBlockReader.getBlockState is being called inside that currently generating chunk so them it ends up waiting on itself and deadlocks.
https://github.com/How-Bout-No/Outvoted/blob/1.16.5/src/main/java/io/github/how_bout_no/outvoted/mixin/MixinBlazeEntity.java#L58
Try changing this.world to worldIn? If that still deadlocks, you might need to figure out a better and safer place to set the blaze type or something. Sorry I couldn't be more help than this. But hopefully this should be enough
Yep, thanks for the quick pointer! Changing it to worldIn
fixes the issue.
Pushing v1.1.5 now..