aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0489-Don-t-fire-BlockFade-on-worldgen-threads.patch
blob: b9ea27eb3c3cad699ce5f8ce5602c5b6c47d07d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
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
index b41de95a6390910ba8bb21bfa12ab61c85900218..9e501514f30de00d68736d9593582a5e7c8b3cff 100644
--- a/src/main/java/net/minecraft/server/BlockFire.java
+++ b/src/main/java/net/minecraft/server/BlockFire.java
@@ -44,6 +44,7 @@ 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());