Added a BlockMask(BaseBlock... block) constructor.

This commit is contained in:
sk89q 2014-03-29 18:31:34 -07:00
parent 8b9cf95079
commit e13d5198be

View File

@ -1,14 +1,15 @@
package com.sk89q.worldedit.masks;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.blocks.BaseBlock;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
public class BlockMask extends AbstractMask {
private final Set<BaseBlock> blocks;
public BlockMask() {
@ -19,6 +20,13 @@ public class BlockMask extends AbstractMask {
this.blocks = types;
}
public BlockMask(BaseBlock... block) {
blocks = new HashSet<BaseBlock>();
for (BaseBlock b : block) {
add(b);
}
}
public BlockMask(BaseBlock block) {
this();
add(block);
@ -38,4 +46,5 @@ public class BlockMask extends AbstractMask {
return blocks.contains(block)
|| blocks.contains(new BaseBlock(block.getType(), -1));
}
}