[FABRIC] Outvoted

[FABRIC] Outvoted

583 Downloads

[BUG] Outvoted causes all structures that spawns Blazes at generation to hang forever

TelepathicGrunt opened this issue ยท 2 comments

commented

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

commented

Yep, thanks for the quick pointer! Changing it to worldIn fixes the issue.
Pushing v1.1.5 now..

commented

Thank you for the info! Once I get back to my PC I'll see what I can do. I guess I didn't really account for mob spawns as a part of the biome variant code ๐Ÿ˜