mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 17:57:38 +00:00
Added FuzzyBlockMask(BaseBlock... block) constructor.
This commit is contained in:
parent
b21f944570
commit
8c3912b5e7
@ -23,6 +23,7 @@ import com.sk89q.worldedit.EditSession;
|
|||||||
import com.sk89q.worldedit.Vector;
|
import com.sk89q.worldedit.Vector;
|
||||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -42,6 +43,19 @@ public class FuzzyBlockMask extends AbstractMask {
|
|||||||
this.filter = filter;
|
this.filter = filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new fuzzy block mask.
|
||||||
|
*
|
||||||
|
* @param block a list of block types to match
|
||||||
|
*/
|
||||||
|
public FuzzyBlockMask(BaseBlock... block) {
|
||||||
|
Set<BaseBlock> filter = new HashSet<BaseBlock>();
|
||||||
|
for (BaseBlock b : block) {
|
||||||
|
filter.add(b);
|
||||||
|
}
|
||||||
|
this.filter = filter;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(EditSession editSession, Vector pos) {
|
public boolean matches(EditSession editSession, Vector pos) {
|
||||||
BaseBlock compare = new BaseBlock(editSession.getBlockType(pos), editSession.getBlockData(pos));
|
BaseBlock compare = new BaseBlock(editSession.getBlockType(pos), editSession.getBlockData(pos));
|
||||||
|
Loading…
Reference in New Issue
Block a user