Added /fixwater.

This commit is contained in:
sk89q
2010-10-15 01:07:48 -07:00
parent e74700127f
commit 9f4c262d1f
2 changed files with 83 additions and 3 deletions

View File

@ -141,6 +141,7 @@ public class WorldEdit {
commands.put("//expand", "<Dir> [Num] - Expands the selection");
commands.put("//contract", "<Dir> [Num] - Contracts the selection");
commands.put("//rotate", "[Angle] - Rotate the clipboard");
commands.put("/fixwater", "[Radius] - Level nearby pools of water");
commands.put("/forestgen", "<Size> - Make an ugly pine tree forest");
commands.put("/unstuck", "Go up to the first free spot");
commands.put("/ascend", "Go up one level");
@ -537,6 +538,16 @@ public class WorldEdit {
return true;
// Fix water
} else if(split[0].equalsIgnoreCase("/fixwater")) {
checkArgs(split, 1, 1, split[0]);
int radius = Math.max(0, Integer.parseInt(split[1]));
int affected = editSession.fixWater(
session.getPlacementPosition(player), radius);
player.print(affected + " block(s) have been changed.");
return true;
// Replace all blocks in the region
} else if(split[0].equalsIgnoreCase("//replace")) {
checkArgs(split, 1, 2, split[0]);