This commit is contained in:
Jesse Boyd 2017-06-20 17:33:48 +10:00
parent 2f8543b25e
commit 36a91f4756
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
2 changed files with 5 additions and 6 deletions

View File

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

View File

@ -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<Vector>() {
@Override
public void run(Vector value) {