From 43d5459595fa5f23c0860e7f300301b2e244bf29 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 17 Aug 2018 19:21:45 +1000 Subject: [PATCH] Fix __reserved__ being solid --- .../fawe/bukkit/v0/BukkitQueue_All.java | 23 +++++++++++++++++-- .../worldedit/bukkit/BukkitBlockRegistry.java | 1 + .../boydti/fawe/object/brush/ImageBrush.java | 2 +- .../java/com/sk89q/worldedit/EditSession.java | 1 + 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitQueue_All.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitQueue_All.java index 850bb695c..a6642288d 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitQueue_All.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitQueue_All.java @@ -1,5 +1,6 @@ package com.boydti.fawe.bukkit.v0; +import com.boydti.fawe.Fawe; import com.boydti.fawe.FaweCache; import com.boydti.fawe.bukkit.util.BukkitReflectionUtils; import com.boydti.fawe.config.Settings; @@ -21,6 +22,7 @@ import java.lang.reflect.Method; import java.util.ArrayDeque; import java.util.Map; import java.util.concurrent.ConcurrentMap; +import java.util.function.Supplier; import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.world.block.BlockStateHolder; @@ -65,7 +67,7 @@ public class BukkitQueue_All extends BukkitQueue_0 tryGetSnasphot(chunk)); + if (snapshot == null) { + snapshot = chunk.getChunkSnapshot(false, true, false); + } + } + } chunkCache.put(MathMan.pairInt(chunk.getX(), chunk.getZ()), snapshot); return snapshot; } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java index 93a84096a..c6cfc83ce 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java @@ -49,6 +49,7 @@ public class BukkitBlockRegistry extends BundledBlockRegistry { public BlockMaterial getMaterial(BlockType blockType) { Material type = BukkitAdapter.adapt(blockType); if (type == null) { + if (blockType == BlockTypes.__RESERVED__) return new PassthroughBlockMaterial(super.getMaterial(BlockTypes.AIR)); return new PassthroughBlockMaterial(null); } return materialMap.computeIfAbsent(type, m -> new BukkitBlockMaterial(BukkitBlockRegistry.super.getMaterial(blockType), m)); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/ImageBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/ImageBrush.java index 39505426a..670fb66f0 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/ImageBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/ImageBrush.java @@ -121,7 +121,7 @@ public class ImageBrush implements Brush { if (color != 0) { BlockType block = texture.getNearestBlock(color); if (block != null) { - editSession.setBlock(vector.getBlockX(), vector.getBlockY(), vector.getBlockZ(), block.getDefaultState()); + editSession.setBlock(vector, block.getDefaultState()); } } return true; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index ebd4b64d1..995dfbef8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -1012,6 +1012,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, @Override public boolean setBlock(Vector position, BlockStateHolder block) throws MaxChangedBlocksException { + this.changes++; try { return this.extent.setBlock(position, block); } catch (MaxChangedBlocksException e) {