From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 23 Apr 2020 01:36:39 -0400 Subject: [PATCH] Don't fire BlockFade on worldgen threads Caused a deadlock diff --git a/src/main/java/net/minecraft/world/level/block/BlockFire.java b/src/main/java/net/minecraft/world/level/block/BlockFire.java index d2d59cc1acc7f67de62ac8d765f2b6b491b69053..f940d93c5bceb4b130a40c1cde06ab8d2e82cd74 100644 --- a/src/main/java/net/minecraft/world/level/block/BlockFire.java +++ b/src/main/java/net/minecraft/world/level/block/BlockFire.java @@ -93,6 +93,7 @@ public class BlockFire extends BlockFireAbstract { @Override public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { // CraftBukkit start + if (!(generatoraccess instanceof WorldServer)) return this.canPlace(iblockdata, generatoraccess, blockposition) ? (IBlockData) this.a(generatoraccess, blockposition, (Integer) iblockdata.get(BlockFire.AGE)) : Blocks.AIR.getBlockData(); // Paper - don't fire events in world generation if (!this.canPlace(iblockdata, generatoraccess, blockposition)) { // Suppress during worldgen if (!(generatoraccess instanceof World)) { @@ -108,7 +109,7 @@ public class BlockFire extends BlockFireAbstract { return blockState.getHandle(); } } - return this.a(generatoraccess, blockposition, (Integer) iblockdata.get(BlockFire.AGE)); + return this.a(generatoraccess, blockposition, (Integer) iblockdata.get(BlockFire.AGE)); // Paper - diff on change, see "don't fire events in world generation" // CraftBukkit end }