From b1f1c0f4f0372b58ad00463dcd702bc7287f5ca0 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sat, 9 May 2020 16:23:38 +0100 Subject: [PATCH] Possible fix for #331 - Should ensure the server doesn't tick the chunksection while we're editing it - Basically using the old issue with FAWE breaking block ticking by setting this to zero :) --- .../fawe/bukkit/adapter/mc1_14/BukkitGetBlocks_1_14.java | 4 ++++ .../fawe/bukkit/adapter/mc1_15/BukkitGetBlocks_1_15.java | 4 ++++ .../fawe/bukkit/adapter/mc1_15_2/BukkitGetBlocks_1_15_2.java | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitGetBlocks_1_14.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitGetBlocks_1_14.java index bbe859074..32365cfbd 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitGetBlocks_1_14.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitGetBlocks_1_14.java @@ -262,6 +262,10 @@ public class BukkitGetBlocks_1_14 extends CharGetBlocks { char[] setArr = set.load(layer); ChunkSection newSection; ChunkSection existingSection = sections[layer]; + + //ensure that the server doesn't try to tick the chunksection while we're editing it. + BukkitAdapter_1_14.fieldTickingBlockCount.set(existingSection, (short) 0); + if (existingSection == null) { newSection = BukkitAdapter_1_14.newChunkSection(layer, setArr); if (BukkitAdapter_1_14.setSectionAtomic(sections, null, newSection, layer)) { diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15/BukkitGetBlocks_1_15.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15/BukkitGetBlocks_1_15.java index 63b04265e..37ce658a7 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15/BukkitGetBlocks_1_15.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15/BukkitGetBlocks_1_15.java @@ -270,6 +270,10 @@ public class BukkitGetBlocks_1_15 extends CharGetBlocks { char[] setArr = set.load(layer); ChunkSection newSection; ChunkSection existingSection = sections[layer]; + + //ensure that the server doesn't try to tick the chunksection while we're editing it. + BukkitAdapter_1_15.fieldTickingBlockCount.set(existingSection, (short) 0); + if (existingSection == null) { newSection = BukkitAdapter_1_15.newChunkSection(layer, setArr); if (BukkitAdapter_1_15.setSectionAtomic(sections, null, newSection, layer)) { diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15_2/BukkitGetBlocks_1_15_2.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15_2/BukkitGetBlocks_1_15_2.java index 8056f6e21..e8fb25b4a 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15_2/BukkitGetBlocks_1_15_2.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15_2/BukkitGetBlocks_1_15_2.java @@ -282,6 +282,10 @@ public class BukkitGetBlocks_1_15_2 extends CharGetBlocks { char[] setArr = set.load(layer); ChunkSection newSection; ChunkSection existingSection = sections[layer]; + + //ensure that the server doesn't try to tick the chunksection while we're editing it. + BukkitAdapter_1_15_2.fieldTickingBlockCount.set(existingSection, (short) 0); + if (existingSection == null) { newSection = BukkitAdapter_1_15_2.newChunkSection(layer, setArr); if (BukkitAdapter_1_15_2.setSectionAtomic(sections, null, newSection, layer)) {