mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-02 10:57:11 +00:00
Added a separate point maximum for polyhedral selections.
This commit is contained in:
parent
eb669ff834
commit
2a4e6ac93a
@ -84,6 +84,8 @@ public abstract class LocalConfiguration {
|
||||
public int maxChangeLimit = -1;
|
||||
public int defaultMaxPolygonalPoints = -1;
|
||||
public int maxPolygonalPoints = 20;
|
||||
public int defaultMaxPolyhedronPoints = -1;
|
||||
public int maxPolyhedronPoints = 20;
|
||||
public String shellSaveType = "";
|
||||
public SnapshotRepository snapshotRepo = null;
|
||||
public int maxRadius = -1;
|
||||
|
@ -905,6 +905,18 @@ public class WorldEdit {
|
||||
}
|
||||
}
|
||||
|
||||
public int getMaximumPolyhedronPoints(LocalPlayer player) {
|
||||
if (player.hasPermission("worldedit.limit.unrestricted") || config.maxPolyhedronPoints < 0) {
|
||||
return config.defaultMaxPolyhedronPoints;
|
||||
} else {
|
||||
if (config.defaultMaxPolyhedronPoints < 0) {
|
||||
return config.maxPolyhedronPoints;
|
||||
}
|
||||
return Math.min(config.defaultMaxPolyhedronPoints,
|
||||
config.maxPolyhedronPoints);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if the specified radius is within bounds.
|
||||
*
|
||||
|
@ -768,7 +768,7 @@ public class SelectionCommands {
|
||||
selector = new CylinderRegionSelector(oldSelector);
|
||||
player.print("Cylindrical selector: Left click=center, right click to extend.");
|
||||
} else if (typeName.equalsIgnoreCase("convex") || typeName.equalsIgnoreCase("hull") || typeName.equalsIgnoreCase("polyhedron")) {
|
||||
int maxVertices = we.getMaximumPolygonalPoints(player); // TODO: separate maximum for polyhedra
|
||||
int maxVertices = we.getMaximumPolyhedronPoints(player);
|
||||
selector = new ConvexPolyhedralRegionSelector(oldSelector, maxVertices);
|
||||
player.print("Convex polyhedral selector: Left click=First vertex, right click to add more.");
|
||||
} else {
|
||||
|
@ -83,6 +83,8 @@ public class PropertiesConfiguration extends LocalConfiguration {
|
||||
maxChangeLimit = getInt("max-changed-blocks", maxChangeLimit);
|
||||
defaultMaxPolygonalPoints = getInt("default-max-polygon-points", defaultMaxPolygonalPoints);
|
||||
maxPolygonalPoints = getInt("max-polygon-points", maxPolygonalPoints);
|
||||
defaultMaxPolyhedronPoints = getInt("default-max-polyhedron-points", defaultMaxPolyhedronPoints);
|
||||
maxPolyhedronPoints = getInt("max-polyhedron-points", maxPolyhedronPoints);
|
||||
shellSaveType = getString("shell-save-type", shellSaveType);
|
||||
maxRadius = getInt("max-radius", maxRadius);
|
||||
maxSuperPickaxeSize = getInt("max-super-pickaxe-size", maxSuperPickaxeSize);
|
||||
|
@ -65,6 +65,9 @@ public class YAMLConfiguration extends LocalConfiguration {
|
||||
maxPolygonalPoints = Math.max(-1,
|
||||
config.getInt("limits.max-polygonal-points.maximum", maxPolygonalPoints));
|
||||
|
||||
defaultMaxPolyhedronPoints = Math.max(-1, config.getInt("limits.max-polyhedron-points.default", defaultMaxPolyhedronPoints));
|
||||
maxPolyhedronPoints = Math.max(-1, config.getInt("limits.max-polyhedron-points.maximum", maxPolyhedronPoints));
|
||||
|
||||
maxRadius = Math.max(-1, config.getInt("limits.max-radius", maxRadius));
|
||||
maxBrushRadius = config.getInt("limits.max-brush-radius", maxBrushRadius);
|
||||
maxSuperPickaxeSize = Math.max(1, config.getInt(
|
||||
|
Loading…
Reference in New Issue
Block a user