From 8c3912b5e73f77baa4e436e7bad78d410e80930c Mon Sep 17 00:00:00 2001 From: sk89q Date: Thu, 27 Mar 2014 20:47:01 -0700 Subject: [PATCH] Added FuzzyBlockMask(BaseBlock... block) constructor. --- .../com/sk89q/worldedit/masks/FuzzyBlockMask.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/com/sk89q/worldedit/masks/FuzzyBlockMask.java b/src/main/java/com/sk89q/worldedit/masks/FuzzyBlockMask.java index 5386b7520..4b34aab89 100644 --- a/src/main/java/com/sk89q/worldedit/masks/FuzzyBlockMask.java +++ b/src/main/java/com/sk89q/worldedit/masks/FuzzyBlockMask.java @@ -23,6 +23,7 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; +import java.util.HashSet; import java.util.Set; /** @@ -42,6 +43,19 @@ public class FuzzyBlockMask extends AbstractMask { this.filter = filter; } + /** + * Create a new fuzzy block mask. + * + * @param block a list of block types to match + */ + public FuzzyBlockMask(BaseBlock... block) { + Set filter = new HashSet(); + for (BaseBlock b : block) { + filter.add(b); + } + this.filter = filter; + } + @Override public boolean matches(EditSession editSession, Vector pos) { BaseBlock compare = new BaseBlock(editSession.getBlockType(pos), editSession.getBlockData(pos));