From 36a91f4756917bb647628adc854e730824e46d93 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Tue, 20 Jun 2017 17:33:48 +1000 Subject: [PATCH] * --- .../com/boydti/fawe/object/mask/MaskedTargetBlock.java | 3 +-- .../java/com/sk89q/worldedit/command/tool/BrushTool.java | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/com/boydti/fawe/object/mask/MaskedTargetBlock.java b/core/src/main/java/com/boydti/fawe/object/mask/MaskedTargetBlock.java index db077dcd..380bf4b7 100644 --- a/core/src/main/java/com/boydti/fawe/object/mask/MaskedTargetBlock.java +++ b/core/src/main/java/com/boydti/fawe/object/mask/MaskedTargetBlock.java @@ -1,7 +1,6 @@ package com.boydti.fawe.object.mask; import com.sk89q.worldedit.BlockWorldVector; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.util.TargetBlock; @@ -21,7 +20,7 @@ public class MaskedTargetBlock extends TargetBlock { boolean searchForLastBlock = true; BlockWorldVector lastBlock = null; while (getNextBlock() != null) { - if (mask == null ? world.getBlockType(getCurrentBlock()) == BlockID.AIR : !mask.test(getCurrentBlock())) { + if (!mask.test(getCurrentBlock())) { if (searchForLastBlock) { lastBlock = getCurrentBlock(); if (lastBlock.getBlockY() <= 0 || lastBlock.getBlockY() >= world.getMaxY()) { diff --git a/core/src/main/java/com/sk89q/worldedit/command/tool/BrushTool.java b/core/src/main/java/com/sk89q/worldedit/command/tool/BrushTool.java index 72bc491a..31609892 100644 --- a/core/src/main/java/com/sk89q/worldedit/command/tool/BrushTool.java +++ b/core/src/main/java/com/sk89q/worldedit/command/tool/BrushTool.java @@ -43,6 +43,7 @@ import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.mask.MaskIntersection; +import com.sk89q.worldedit.function.mask.SolidBlockMask; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.session.request.Request; import com.sk89q.worldedit.util.Location; @@ -406,10 +407,9 @@ public class BrushTool implements DoubleActionTraceTool, ScrollTool, MovableTool } private Vector trace(EditSession editSession, Player player, int range, boolean useLastBlock) { - if (targetMask != null) { - new MaskTraverser(targetMask).reset(editSession); - } - MaskedTargetBlock tb = new MaskedTargetBlock(targetMask, player, range, 0.2); + Mask mask = targetMask == null ? new SolidBlockMask(editSession) : targetMask; + new MaskTraverser(mask).reset(editSession); + MaskedTargetBlock tb = new MaskedTargetBlock(mask, player, range, 0.2); return TaskManager.IMP.sync(new RunnableVal() { @Override public void run(Vector value) {