mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-10 06:38:35 +00:00
Added //gmask to set a *GLOBAL* mask that affects nearly ALL operations. Now you can confine //sphere to a region or create //walls that do not replace existing blocks.
This commit is contained in:
@ -33,6 +33,7 @@ import com.sk89q.worldedit.regions.*;
|
||||
import com.sk89q.worldedit.util.TreeGenerator;
|
||||
import com.sk89q.worldedit.bags.*;
|
||||
import com.sk89q.worldedit.blocks.*;
|
||||
import com.sk89q.worldedit.masks.Mask;
|
||||
import com.sk89q.worldedit.patterns.*;
|
||||
|
||||
/**
|
||||
@ -108,6 +109,11 @@ public class EditSession {
|
||||
* List of missing blocks;
|
||||
*/
|
||||
private Set<Integer> missingBlocks = new HashSet<Integer>();
|
||||
|
||||
/**
|
||||
* Mask to cover operations.
|
||||
*/
|
||||
private Mask mask;
|
||||
|
||||
/**
|
||||
* Construct the object with a maximum number of blocks.
|
||||
@ -162,6 +168,12 @@ public class EditSession {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mask != null) {
|
||||
if (!mask.matches(this, pt)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
int existing = world.getBlockType(pt);
|
||||
|
||||
// Clear the container block so that it doesn't drop items
|
||||
@ -2245,4 +2257,22 @@ public class EditSession {
|
||||
public int getBlockChangeCount() {
|
||||
return original.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the mask.
|
||||
*
|
||||
* @return mask, may be null
|
||||
*/
|
||||
public Mask getMask() {
|
||||
return mask;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a mask.
|
||||
*
|
||||
* @param mask mask or null
|
||||
*/
|
||||
public void setMask(Mask mask) {
|
||||
this.mask = mask;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user