Add support for copying entities between Extents.

This commit is contained in:
sk89q
2014-07-10 22:22:35 -07:00
parent 52f1a7d2d4
commit 0ce7954dc9
23 changed files with 768 additions and 108 deletions

View File

@ -582,15 +582,10 @@ public class EditSession implements Extent {
return getBlock(position).isAir() && setBlock(position, block);
}
@Override
public List<Entity> getEntities() {
return world.getEntities();
}
@Override
@Nullable
public Entity createEntity(com.sk89q.worldedit.util.Location location, BaseEntity entity) {
return world.createEntity(location, entity);
return bypassNone.createEntity(location, entity);
}
/**
@ -649,6 +644,16 @@ public class EditSession implements Extent {
return getWorld().getMaximumPoint();
}
@Override
public List<? extends Entity> getEntities(Region region) {
return bypassNone.getEntities(region);
}
@Override
public List<? extends Entity> getEntities() {
return bypassNone.getEntities();
}
/**
* Finish off the queue.
*/
@ -1160,6 +1165,7 @@ public class EditSession implements Extent {
ForwardExtentCopy copy = new ForwardExtentCopy(this, region, buffer, to);
copy.setTransform(new AffineTransform().translate(dir.multiply(distance)));
copy.setSourceFunction(remove); // Remove
copy.setRemovingEntities(true);
if (!copyAir) {
copy.setSourceMask(new ExistingBlockMask(this));
}