Added /ascend and /descend.

This commit is contained in:
sk89q
2010-10-12 22:06:46 -07:00
parent 87daf8e7ed
commit 514a78272e
2 changed files with 105 additions and 1 deletions

View File

@@ -94,6 +94,8 @@ public class WorldEdit {
commands.put("/editexpand", "<Dir> [Num] - Expands the selection");
commands.put("/editcontract", "<Dir> [Num] - Contracts the selection");
commands.put("/unstuck", "Go up to the first free spot");
commands.put("/ascend", "Go up one level");
commands.put("/descend", "Go dowm one level");
}
/**
@@ -202,6 +204,26 @@ public class WorldEdit {
player.findFreePosition();
return true;
// Ascend a level
} else if(split[0].equalsIgnoreCase("/ascend")) {
checkArgs(split, 0, 0, split[0]);
if (player.ascendLevel()) {
player.print("Ascended a level.");
} else {
player.printError("No free spot above you found.");
}
return true;
// Descend a level
} else if(split[0].equalsIgnoreCase("/descend")) {
checkArgs(split, 0, 0, split[0]);
if (player.descendLevel()) {
player.print("Descended a level.");
} else {
player.printError("No free spot below you found.");
}
return true;
// Set edit position #1
} else if (split[0].equalsIgnoreCase("/editpos1")) {
checkArgs(split, 0, 0, split[0]);