diff --git a/src/main/java/com/sk89q/worldedit/WorldEdit.java b/src/main/java/com/sk89q/worldedit/WorldEdit.java index 1b814ddaa..5c0782adb 100644 --- a/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -1458,9 +1458,9 @@ public boolean handleCommand(LocalPlayer player, String[] split) { player.printError("Max blocks changed in an operation reached (" + e.getBlockLimit() + ")."); } catch (MaxBrushRadiusException e) { - player.printError("Maximum allowed brush radius/height: " + config.maxBrushRadius); + player.printError("Maximum allowed brush size: " + config.maxBrushRadius); } catch (MaxRadiusException e) { - player.printError("Maximum radius: " + config.maxRadius); + player.printError("Maximum allowed size: " + config.maxRadius); } catch (UnknownDirectionException e) { player.printError("Unknown direction: " + e.getDirection()); } catch (InsufficientArgumentsException e) { diff --git a/src/main/java/com/sk89q/worldedit/commands/GenerationCommands.java b/src/main/java/com/sk89q/worldedit/commands/GenerationCommands.java index 3e745a603..88048dbc4 100644 --- a/src/main/java/com/sk89q/worldedit/commands/GenerationCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/GenerationCommands.java @@ -86,6 +86,10 @@ public void hcyl(CommandContext args, LocalSession session, LocalPlayer player, } int height = args.argsLength() > 2 ? args.getInteger(2) : 1; + we.checkMaxRadius(radiusX); + we.checkMaxRadius(radiusZ); + we.checkMaxRadius(height); + Vector pos = session.getPlacementPosition(player); int affected = editSession.makeCylinder(pos, block, radiusX, radiusZ, height, false); player.print(affected + " block(s) have been created."); @@ -127,6 +131,10 @@ public void cyl(CommandContext args, LocalSession session, LocalPlayer player, } int height = args.argsLength() > 2 ? args.getInteger(2) : 1; + we.checkMaxRadius(radiusX); + we.checkMaxRadius(radiusZ); + we.checkMaxRadius(height); + Vector pos = session.getPlacementPosition(player); int affected = editSession.makeCylinder(pos, block, radiusX, radiusZ, height, true); player.print(affected + " block(s) have been created."); @@ -167,6 +175,11 @@ public void hsphere(CommandContext args, LocalSession session, LocalPlayer playe player.printError("You must either specify 1 or 3 radius values."); return; } + + we.checkMaxRadius(radiusX); + we.checkMaxRadius(radiusY); + we.checkMaxRadius(radiusZ); + final boolean raised; if (args.argsLength() > 2) { raised = args.getString(2).equalsIgnoreCase("true") || args.getString(2).equalsIgnoreCase("yes"); @@ -219,6 +232,11 @@ public void sphere(CommandContext args, LocalSession session, LocalPlayer player player.printError("You must either specify 1 or 3 radius values."); return; } + + we.checkMaxRadius(radiusX); + we.checkMaxRadius(radiusY); + we.checkMaxRadius(radiusZ); + final boolean raised; if (args.argsLength() > 2) { raised = args.getString(2).equalsIgnoreCase("true") || args.getString(2).equalsIgnoreCase("yes"); @@ -299,6 +317,8 @@ public void pyramid(CommandContext args, LocalSession session, LocalPlayer playe int size = Math.max(1, args.getInteger(1)); Vector pos = session.getPlacementPosition(player); + we.checkMaxRadius(size); + int affected = editSession.makePyramid(pos, block, size, true); player.findFreePosition(); @@ -321,6 +341,8 @@ public void hpyramid(CommandContext args, LocalSession session, LocalPlayer play int size = Math.max(1, args.getInteger(1)); Vector pos = session.getPlacementPosition(player); + we.checkMaxRadius(size); + int affected = editSession.makePyramid(pos, block, size, false); player.findFreePosition();