From 110347214ef39f892110d61768ebdc9f1d99c6f4 Mon Sep 17 00:00:00 2001 From: IronApollo Date: Tue, 31 Mar 2020 20:29:03 -0400 Subject: [PATCH 1/3] Update SingleThreadQueueExtent.java --- .../beta/implementation/queue/SingleThreadQueueExtent.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/queue/SingleThreadQueueExtent.java b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/queue/SingleThreadQueueExtent.java index 1f3ed59de..62a199e6a 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/queue/SingleThreadQueueExtent.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/queue/SingleThreadQueueExtent.java @@ -156,7 +156,12 @@ public class SingleThreadQueueExtent extends ExtentBatchProcessorHolder implemen } if (Fawe.isMainThread()) { - return (V) chunk.call(); + V result = (V)chunk.call(); + if (result == null){ + return (V) (Future) Futures.immediateFuture(null); + }else{ + return result; + } } return (V) Fawe.get().getQueueHandler().submit(chunk); From 16df4abd18af535c860bda0a77c20dd9f0c579b3 Mon Sep 17 00:00:00 2001 From: IronApollo Date: Wed, 1 Apr 2020 00:20:25 -0400 Subject: [PATCH 2/3] Reflection field name changes Old ones were outdated. Brush visualization is still WIP and can result in client being kicked from the server for bad packets. --- .../fawe/bukkit/adapter/mc1_15_2/MapChunkUtil_1_15_2.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15_2/MapChunkUtil_1_15_2.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15_2/MapChunkUtil_1_15_2.java index e12648f4a..7a7bac16c 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15_2/MapChunkUtil_1_15_2.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15_2/MapChunkUtil_1_15_2.java @@ -9,9 +9,9 @@ public class MapChunkUtil_1_15_2 extends MapChunkUtil { fieldZ = PacketPlayOutMapChunk.class.getDeclaredField("b"); fieldBitMask = PacketPlayOutMapChunk.class.getDeclaredField("c"); fieldHeightMap = PacketPlayOutMapChunk.class.getDeclaredField("d"); - fieldChunkData = PacketPlayOutMapChunk.class.getDeclaredField("e"); - fieldBlockEntities = PacketPlayOutMapChunk.class.getDeclaredField("f"); - fieldFull = PacketPlayOutMapChunk.class.getDeclaredField("g"); + fieldChunkData = PacketPlayOutMapChunk.class.getDeclaredField("f"); + fieldBlockEntities = PacketPlayOutMapChunk.class.getDeclaredField("g"); + fieldFull = PacketPlayOutMapChunk.class.getDeclaredField("h"); fieldX.setAccessible(true); fieldZ.setAccessible(true); fieldBitMask.setAccessible(true); From 755ea097973de1e3ec1ad86ee1d63fe3a8d1f7dc Mon Sep 17 00:00:00 2001 From: IronApollo Date: Wed, 1 Apr 2020 00:26:11 -0400 Subject: [PATCH 3/3] Fix #390 Turns out the FilterBlock's getOrdinal value is from the "get", and does not share the same reference as setOrdinal, whose value is from the "set", would modify. Because of this, even if #getOrdinal returns 0, we still must update the set with 0 by #setOrdinal. --- .../src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java index 7aea7c97a..7cb88c422 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java @@ -108,7 +108,7 @@ public class MaskingExtent extends AbstractDelegateExtent implements IBatchProce @Override public void applyBlock(FilterBlock block) { int ordinal = block.getOrdinal(); - if (ordinal != 0 && !mask.test(getExtent(), block)) { + if (!mask.test(getExtent(), block)) { block.setOrdinal(0); } }