mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-28 21:56:33 +01:00
*
This commit is contained in:
parent
2f8543b25e
commit
36a91f4756
@ -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()) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user