From cd84dc9e5d25574c769bc5f9683d064bbcbda462 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 23 Apr 2020 01:37:30 -0400 Subject: [PATCH] Don't fire BlockFade on worldgen threads - Fixes #3208 Caused a deadlock --- ...t-fire-BlockFade-on-worldgen-threads.patch | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Spigot-Server-Patches/Don-t-fire-BlockFade-on-worldgen-threads.patch diff --git a/Spigot-Server-Patches/Don-t-fire-BlockFade-on-worldgen-threads.patch b/Spigot-Server-Patches/Don-t-fire-BlockFade-on-worldgen-threads.patch new file mode 100644 index 00000000000..d7d88520b78 --- /dev/null +++ b/Spigot-Server-Patches/Don-t-fire-BlockFade-on-worldgen-threads.patch @@ -0,0 +1,20 @@ +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/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java +index b41de95a63..9e501514f3 100644 +--- a/src/main/java/net/minecraft/server/BlockFire.java ++++ b/src/main/java/net/minecraft/server/BlockFire.java +@@ -0,0 +0,0 @@ public class BlockFire extends Block { + @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((IBlockAccess) generatoraccess, blockposition).set(BlockFire.AGE, iblockdata.get(BlockFire.AGE)) : Blocks.AIR.getBlockData(); // Paper - don't fire events in world generation + if (!iblockdata.canPlace(generatoraccess, blockposition)) { + CraftBlockState blockState = CraftBlockState.getBlockState(generatoraccess, blockposition); + blockState.setData(Blocks.AIR.getBlockData()); +-- \ No newline at end of file