diff --git a/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java b/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java index 16c5de53f..b268467d0 100644 --- a/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java @@ -763,7 +763,7 @@ public void select(CommandContext args, LocalSession session, LocalPlayer player player.print("Ellipsoid selector: left click=center, right click to extend"); } else if (typeName.equalsIgnoreCase("sphere")) { selector = new SphereRegionSelector(oldSelector); - player.print("Sphere selector: left click=center, right click to extend"); + player.print("Sphere selector: left click=center, right click to set radius"); } else if (typeName.equalsIgnoreCase("cyl")) { selector = new CylinderRegionSelector(oldSelector); player.print("Cylindrical selector: Left click=center, right click to extend."); diff --git a/src/main/java/com/sk89q/worldedit/regions/SphereRegionSelector.java b/src/main/java/com/sk89q/worldedit/regions/SphereRegionSelector.java index 90a63b049..6281205ca 100644 --- a/src/main/java/com/sk89q/worldedit/regions/SphereRegionSelector.java +++ b/src/main/java/com/sk89q/worldedit/regions/SphereRegionSelector.java @@ -41,7 +41,7 @@ public SphereRegionSelector() { public SphereRegionSelector(RegionSelector oldSelector) { super(oldSelector); final Vector radius = region.getRadius(); - double radiusScalar = Math.max(Math.max(radius.getX(), radius.getY()), radius.getZ()); + final double radiusScalar = Math.max(Math.max(radius.getX(), radius.getY()), radius.getZ()); region.setRadius(new Vector(radiusScalar, radiusScalar, radiusScalar)); } @@ -51,12 +51,9 @@ public SphereRegionSelector(LocalWorld world, Vector center, int radius) { @Override public boolean selectSecondary(Vector pos) { - final Vector diff = pos.subtract(region.getCenter()); - final Vector minRadius = Vector.getMaximum(diff, diff.multiply(-1.0)); + final double radiusScalar = Math.ceil(pos.distance(region.getCenter())); + region.setRadius(new Vector(radiusScalar, radiusScalar, radiusScalar)); - double minRadiusScalar = Math.max(Math.max(minRadius.getX(), minRadius.getY()), minRadius.getZ()); - - region.extendRadius(new Vector(minRadiusScalar, minRadiusScalar, minRadiusScalar)); return true; }