Added /editdrain, added BlockPoint that compares using ints.

This commit is contained in:
sk89q
2010-10-11 11:17:32 -07:00
parent 7823aa2a6c
commit f64cc76906
4 changed files with 183 additions and 2 deletions

View File

@@ -73,6 +73,7 @@ public class WorldEdit extends Plugin {
commands.put("/editload", "[Filename] - Load .schematic into clipboard");
commands.put("/editsave", "[Filename] - Save clipboard to .schematic");
commands.put("/editfill", "[ID] [Radius] <Depth> - Fill a hole");
commands.put("/editdrain", "[Radius] - Drain nearby water/lava pools");
commands.put("/editscript", "[Filename] <Args...> - Run a WorldEdit script");
commands.put("/editlimit", "[Num] - See documentation");
commands.put("/unstuck", "Go up to the first free spot");
@@ -573,6 +574,15 @@ public class WorldEdit extends Plugin {
return true;
// Drain pools
} else if(split[0].equalsIgnoreCase("/editdrain")) {
checkArgs(split, 1, 1, split[0]);
int radius = Math.max(0, Integer.parseInt(split[1]));
int affected = editSession.drainArea(player.getBlockIn(), radius);
player.print(affected + " block(s) have been changed.");
return true;
// Replace all blocks in the region
} else if(split[0].equalsIgnoreCase("/editreplace")) {
checkArgs(split, 1, 2, split[0]);