Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-07 20:10:06 +01:00
Apply source function after source mask in ForwardExtentCopy.
The source function should only get applied to actually copied blocks.
Dieser Commit ist enthalten in:
Ursprung
f46c70093c
Commit
e53962dadd
@ -1252,7 +1252,7 @@ public class EditSession implements Extent, AutoCloseable {
|
|||||||
BlockVector3 to = region.getMinimumPoint();
|
BlockVector3 to = region.getMinimumPoint();
|
||||||
|
|
||||||
// Remove the original blocks
|
// Remove the original blocks
|
||||||
com.sk89q.worldedit.function.pattern.Pattern pattern = replacement != null ?
|
Pattern pattern = replacement != null ?
|
||||||
replacement :
|
replacement :
|
||||||
new BlockPattern(BlockTypes.AIR.getDefaultState());
|
new BlockPattern(BlockTypes.AIR.getDefaultState());
|
||||||
BlockReplace remove = new BlockReplace(this, pattern);
|
BlockReplace remove = new BlockReplace(this, pattern);
|
||||||
|
@ -262,11 +262,12 @@ public class RegionCommands {
|
|||||||
@Command(
|
@Command(
|
||||||
aliases = { "/move" },
|
aliases = { "/move" },
|
||||||
usage = "[count] [direction] [leave-id]",
|
usage = "[count] [direction] [leave-id]",
|
||||||
flags = "s",
|
flags = "sa",
|
||||||
desc = "Move the contents of the selection",
|
desc = "Move the contents of the selection",
|
||||||
help =
|
help =
|
||||||
"Moves the contents of the selection.\n" +
|
"Moves the contents of the selection.\n" +
|
||||||
"The -s flag shifts the selection to the target location.\n" +
|
"The -s flag shifts the selection to the target location.\n" +
|
||||||
|
"The -a flag skips air blocks.\n" +
|
||||||
"Optionally fills the old location with <leave-id>.",
|
"Optionally fills the old location with <leave-id>.",
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 3
|
max = 3
|
||||||
@ -278,9 +279,10 @@ public class RegionCommands {
|
|||||||
@Optional("1") @Range(min = 1) int count,
|
@Optional("1") @Range(min = 1) int count,
|
||||||
@Optional(Direction.AIM) @Direction(includeDiagonals = true) BlockVector3 direction,
|
@Optional(Direction.AIM) @Direction(includeDiagonals = true) BlockVector3 direction,
|
||||||
@Optional("air") Pattern replace,
|
@Optional("air") Pattern replace,
|
||||||
@Switch('s') boolean moveSelection) throws WorldEditException {
|
@Switch('s') boolean moveSelection,
|
||||||
|
@Switch('a') boolean ignoreAirBlocks) throws WorldEditException {
|
||||||
|
|
||||||
int affected = editSession.moveRegion(region, direction, count, true, replace);
|
int affected = editSession.moveRegion(region, direction, count, !ignoreAirBlocks, replace);
|
||||||
|
|
||||||
if (moveSelection) {
|
if (moveSelection) {
|
||||||
try {
|
try {
|
||||||
|
@ -248,9 +248,9 @@ public class ForwardExtentCopy implements Operation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ExtentBlockCopy blockCopy = new ExtentBlockCopy(source, from, destination, to, currentTransform);
|
ExtentBlockCopy blockCopy = new ExtentBlockCopy(source, from, destination, to, currentTransform);
|
||||||
RegionMaskingFilter filter = new RegionMaskingFilter(sourceMask, blockCopy);
|
RegionMaskingFilter filteredFunction = new RegionMaskingFilter(sourceMask,
|
||||||
RegionFunction function = sourceFunction != null ? new CombinedRegionFunction(filter, sourceFunction) : filter;
|
sourceFunction == null ? blockCopy : new CombinedRegionFunction(blockCopy, sourceFunction));
|
||||||
RegionVisitor blockVisitor = new RegionVisitor(region, function);
|
RegionVisitor blockVisitor = new RegionVisitor(region, filteredFunction);
|
||||||
|
|
||||||
lastVisitor = blockVisitor;
|
lastVisitor = blockVisitor;
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren