Disable copying entities (WorldEdit 7), and enable removing entities (WorldEdit 6)

- Fixes security problem of #273:
    - Throw item into a region
    - Rent/buy the region -> it gets saved as schematic
    - Pick up items
    - Unrent/sell the region -> items appear again
    - Pick up second set of items, they got duplicated
This commit is contained in:
Thijs Wiefferink 2018-08-11 22:31:15 +02:00
parent bdea9448a4
commit 36d2ce60b9
2 changed files with 2 additions and 0 deletions

View File

@ -100,6 +100,7 @@ public class WorldEditHandler6 extends WorldEditInterface {
// Build operation
BlockTransformExtent extent = new BlockTransformExtent(clipboardHolder.getClipboard(), clipboardHolder.getTransform(), editSession.getWorld().getWorldData().getBlockRegistry());
ForwardExtentCopy copy = new ForwardExtentCopy(extent, clipboard.getRegion(), clipboard.getOrigin(), editSession, origin);
copy.setRemovingEntities(true);
copy.setTransform(clipboardHolder.getTransform());
// Mask to region (for polygon and other weird shaped regions)
// TODO make this more efficient (especially for polygon regions)

View File

@ -117,6 +117,7 @@ public class WorldEditHandler7 extends WorldEditInterface {
// Build operation
BlockTransformExtent extent = new BlockTransformExtent(clipboardHolder.getClipboard(), clipboardHolder.getTransform());
ForwardExtentCopy copy = new ForwardExtentCopy(extent, clipboard.getRegion(), clipboard.getOrigin(), editSession, origin);
copy.setCopyingEntities(false);
copy.setTransform(clipboardHolder.getTransform());
// Mask to region (for polygon and other weird shaped regions)
// TODO make this more efficient (especially for polygon regions)