Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-05 19:10:07 +01:00
Added a BlockMask(BaseBlock... block) constructor.
Dieser Commit ist enthalten in:
Ursprung
8b9cf95079
Commit
e13d5198be
@ -1,14 +1,15 @@
|
|||||||
package com.sk89q.worldedit.masks;
|
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.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.Collection;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
public class BlockMask extends AbstractMask {
|
public class BlockMask extends AbstractMask {
|
||||||
|
|
||||||
private final Set<BaseBlock> blocks;
|
private final Set<BaseBlock> blocks;
|
||||||
|
|
||||||
public BlockMask() {
|
public BlockMask() {
|
||||||
@ -19,6 +20,13 @@ public class BlockMask extends AbstractMask {
|
|||||||
this.blocks = types;
|
this.blocks = types;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BlockMask(BaseBlock... block) {
|
||||||
|
blocks = new HashSet<BaseBlock>();
|
||||||
|
for (BaseBlock b : block) {
|
||||||
|
add(b);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public BlockMask(BaseBlock block) {
|
public BlockMask(BaseBlock block) {
|
||||||
this();
|
this();
|
||||||
add(block);
|
add(block);
|
||||||
@ -35,7 +43,8 @@ public class BlockMask extends AbstractMask {
|
|||||||
@Override
|
@Override
|
||||||
public boolean matches(EditSession editSession, Vector pos) {
|
public boolean matches(EditSession editSession, Vector pos) {
|
||||||
BaseBlock block = editSession.getBlock(pos);
|
BaseBlock block = editSession.getBlock(pos);
|
||||||
return blocks.contains(block)
|
return blocks.contains(block)
|
||||||
|| blocks.contains(new BaseBlock(block.getType(), -1));
|
|| blocks.contains(new BaseBlock(block.getType(), -1));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren