From 72a44d65fd6cf8c41f75c5aa73ebd307307ee3ae Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sun, 14 Apr 2019 13:07:02 +1000 Subject: [PATCH] Fix other ProtocolSupport compatibility issues --- .../fawe/bukkit/v1_13/BukkitChunk_1_13.java | 10 +++-- .../fawe/bukkit/v1_13/BukkitQueue_1_13.java | 38 +++++++++++-------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_13/BukkitChunk_1_13.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_13/BukkitChunk_1_13.java index 2fa21a314..4e7d2eeef 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_13/BukkitChunk_1_13.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_13/BukkitChunk_1_13.java @@ -439,10 +439,11 @@ public class BukkitChunk_1_13 extends IntFaweChunk { } if (this.sectionPalettes != null && this.sectionPalettes[j] != null) { section = sections[j] = this.sectionPalettes[j]; - getParent().setCount(0, count - this.getAir(j), section); +// getParent().setCount(0, count - this.getAir(j), section); continue; } else { - sections[j] = getParent().newChunkSection(j << 4, flag, array); + section = sections[j] = getParent().newChunkSection(j << 4, flag, array); +// getParent().setCount(0, count - this.getAir(j), section); continue; } } else if (count >= 4096) { @@ -452,10 +453,11 @@ public class BukkitChunk_1_13 extends IntFaweChunk { } if (this.sectionPalettes != null && this.sectionPalettes[j] != null) { section = sections[j] = this.sectionPalettes[j]; - getParent().setCount(0, count - this.getAir(j), section); +// getParent().setCount(0, count - this.getAir(j), section); continue; } else { - sections[j] = getParent().newChunkSection(j << 4, flag, array); + section = sections[j] = getParent().newChunkSection(j << 4, flag, array); +// getParent().setCount(0, count - this.getAir(j), section); continue; } } diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_13/BukkitQueue_1_13.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_13/BukkitQueue_1_13.java index b6469c5d0..c9bc8b23d 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_13/BukkitQueue_1_13.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_13/BukkitQueue_1_13.java @@ -87,6 +87,7 @@ public class BukkitQueue_1_13 extends BukkitQueue_0> 6; if (num_palette == 1) { - // Set a value, because minecraft needs it for some reason even if the array is empty for (int i = 0; i < blockBitArrayEnd; i++) blockstates[i] = 0; } else { BitArray4096 bitArray = new BitArray4096(blockstates, bitsPerEntry); bitArray.fromRaw(blocksCopy); } - // set palette & data bits DataPaletteBlock dataPaletteBlocks = section.getBlocks(); // private DataPalette h; @@ -892,7 +898,7 @@ public class BukkitQueue_1_13 extends BukkitQueue_0 palette; -// DataPaletteHash hash = new DataPaletteHash<>(Block.REGISTRY_ID, num_palette, dataPaletteBlocks, GameProfileSerializer::d, GameProfileSerializer::a); +// palette = new DataPaletteHash<>(Block.REGISTRY_ID, bitsPerEntry, dataPaletteBlocks, GameProfileSerializer::d, GameProfileSerializer::a); palette = new DataPaletteLinear<>(Block.REGISTRY_ID, bitsPerEntry, dataPaletteBlocks, GameProfileSerializer::d); // set palette for (int i = 0; i < num_palette; i++) {