2020-05-06 09:48:49 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2020-04-23 05:37:30 +00:00
From: Aikar <aikar@aikar.co>
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
2020-08-25 02:22:08 +00:00
index acd0ec4bf30c5d559d99ec449fef166ce59076e6..5ef90510b8bdac2dcf58cabfa78ba48a30a22a97 100644
2020-04-23 05:37:30 +00:00
--- a/src/main/java/net/minecraft/server/BlockFire.java
+++ b/src/main/java/net/minecraft/server/BlockFire.java
2020-08-25 02:22:08 +00:00
@@ -73,6 +73,7 @@ public class BlockFire extends BlockFireAbstract {
2020-04-23 05:37:30 +00:00
@Override
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
// CraftBukkit start
2020-06-26 01:53:21 +00:00
+ 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)) {
2020-06-27 05:12:11 +00:00
// Suppress during worldgen
if (!(generatoraccess instanceof World)) {
2020-08-25 02:22:08 +00:00
@@ -88,7 +89,7 @@ public class BlockFire extends BlockFireAbstract {
2020-06-26 01:53:21 +00:00
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
}