mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-02 10:57:11 +00:00
Added a SolidBlockMask (#solid).
This commit is contained in:
parent
02de320980
commit
627e029fbb
@ -84,6 +84,7 @@ import com.sk89q.worldedit.masks.InvertedMask;
|
||||
import com.sk89q.worldedit.masks.Mask;
|
||||
import com.sk89q.worldedit.masks.RandomMask;
|
||||
import com.sk89q.worldedit.masks.RegionMask;
|
||||
import com.sk89q.worldedit.masks.SolidBlockMask;
|
||||
import com.sk89q.worldedit.masks.UnderOverlayMask;
|
||||
import com.sk89q.worldedit.patterns.BlockChance;
|
||||
import com.sk89q.worldedit.patterns.ClipboardPattern;
|
||||
@ -731,6 +732,8 @@ public class WorldEdit {
|
||||
case '#':
|
||||
if (component.equalsIgnoreCase("#existing")) {
|
||||
return new ExistingBlockMask();
|
||||
} else if (component.equalsIgnoreCase("#solid")) {
|
||||
return new SolidBlockMask();
|
||||
} else if (component.equalsIgnoreCase("#dregion")
|
||||
|| component.equalsIgnoreCase("#dselection")
|
||||
|| component.equalsIgnoreCase("#dsel")) {
|
||||
|
15
src/main/java/com/sk89q/worldedit/masks/SolidBlockMask.java
Normal file
15
src/main/java/com/sk89q/worldedit/masks/SolidBlockMask.java
Normal file
@ -0,0 +1,15 @@
|
||||
package com.sk89q.worldedit.masks;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.blocks.BlockType;
|
||||
|
||||
/**
|
||||
* Works like {@link ExistingBlockMask}, except also dealing with non-solid non-air blocks the same way as with air.
|
||||
*/
|
||||
public class SolidBlockMask extends AbstractMask {
|
||||
@Override
|
||||
public boolean matches(EditSession editSession, Vector pos) {
|
||||
return !BlockType.canPassThrough(editSession.getBlockType(pos), editSession.getBlockData(pos));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user