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 :)
This commit is contained in:
dordsor21 2020-05-09 16:23:38 +01:00
parent 8f60544aad
commit b1f1c0f4f0
3 changed files with 12 additions and 0 deletions

View File

@ -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)) {

View File

@ -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)) {

View File

@ -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)) {