mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-08-05 11:18:46 +00:00
Make //setbiome respect global mask, if set to a biome mask
This commit is contained in:
@@ -8,6 +8,7 @@ import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalPlayer;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.Vector2D;
|
||||
|
||||
public class BiomeTypeMask implements Mask {
|
||||
|
||||
@@ -24,9 +25,13 @@ public class BiomeTypeMask implements Mask {
|
||||
public void prepare(LocalSession session, LocalPlayer player, Vector target) {
|
||||
}
|
||||
|
||||
public boolean matches(EditSession editSession, Vector pos) {
|
||||
BiomeType biome = editSession.getWorld().getBiome(pos.toVector2D());
|
||||
public boolean matches2D(EditSession editSession, Vector2D pos) {
|
||||
BiomeType biome = editSession.getWorld().getBiome(pos);
|
||||
return biomes.contains(biome);
|
||||
}
|
||||
|
||||
public boolean matches(EditSession editSession, Vector pos) {
|
||||
return matches2D(editSession, pos.toVector2D());
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -22,4 +22,7 @@ public class InvertedMask implements Mask {
|
||||
return !mask.matches(editSession, pos);
|
||||
}
|
||||
|
||||
public Mask getInvertedMask() {
|
||||
return mask;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user