mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-05 12:36:40 +00:00
Allow copyEntities to be used in ForwardExtentCopy again.
The -e flag should now work for //copy and //cut as it used to. Fixes WORLDEDIT-3557.
This commit is contained in:
@ -58,6 +58,7 @@ public class ForwardExtentCopy implements Operation {
|
||||
private int repetitions = 1;
|
||||
private Mask sourceMask = Masks.alwaysTrue();
|
||||
private boolean removingEntities;
|
||||
private boolean copyingEntities = true; // default to true for backwards compatibility, sort of
|
||||
private RegionFunction sourceFunction = null;
|
||||
private Transform transform = new Identity();
|
||||
private Transform currentTransform = null;
|
||||
@ -183,6 +184,24 @@ public class ForwardExtentCopy implements Operation {
|
||||
this.repetitions = repetitions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether entities should be copied along with blocks.
|
||||
*
|
||||
* @return true if copying
|
||||
*/
|
||||
public boolean isCopyingEntities() {
|
||||
return copyingEntities;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether entities should be copied along with blocks.
|
||||
*
|
||||
* @param copyingEntities true if copying
|
||||
*/
|
||||
public void setCopyingEntities(boolean copyingEntities) {
|
||||
this.copyingEntities = copyingEntities;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether entities that are copied should be removed.
|
||||
*
|
||||
@ -229,14 +248,18 @@ public class ForwardExtentCopy implements Operation {
|
||||
RegionFunction function = sourceFunction != null ? new CombinedRegionFunction(filter, sourceFunction) : filter;
|
||||
RegionVisitor blockVisitor = new RegionVisitor(region, function);
|
||||
|
||||
ExtentEntityCopy entityCopy = new ExtentEntityCopy(from, destination, to, currentTransform);
|
||||
entityCopy.setRemoving(removingEntities);
|
||||
List<? extends Entity> entities = source.getEntities(region);
|
||||
EntityVisitor entityVisitor = new EntityVisitor(entities.iterator(), entityCopy);
|
||||
|
||||
lastVisitor = blockVisitor;
|
||||
currentTransform = currentTransform.combine(transform);
|
||||
return new DelegateOperation(this, new OperationQueue(blockVisitor, entityVisitor));
|
||||
|
||||
if (copyingEntities) {
|
||||
ExtentEntityCopy entityCopy = new ExtentEntityCopy(from, destination, to, currentTransform);
|
||||
entityCopy.setRemoving(removingEntities);
|
||||
List<? extends Entity> entities = source.getEntities(region);
|
||||
EntityVisitor entityVisitor = new EntityVisitor(entities.iterator(), entityCopy);
|
||||
return new DelegateOperation(this, new OperationQueue(blockVisitor, entityVisitor));
|
||||
} else {
|
||||
return new DelegateOperation(this, blockVisitor);
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user