geforkt von Mirrors/FastAsyncWorldEdit
Added FuzzyBlockMask(BaseBlock... block) constructor.
Dieser Commit ist enthalten in:
Ursprung
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));
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren