3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-06 03:20:06 +01:00

Added FuzzyBlockMask(BaseBlock... block) constructor.

Dieser Commit ist enthalten in:
sk89q 2014-03-27 20:47:01 -07:00
Ursprung b21f944570
Commit 8c3912b5e7

Datei anzeigen

@ -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));