Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-25 02:20:07 +01:00
Some code tidying.
Dieser Commit ist enthalten in:
Ursprung
6b9dbe349a
Commit
7717223686
@ -57,25 +57,22 @@ public class NavigationCommands {
|
||||
public static void ascend(CommandContext args, WorldEdit we,
|
||||
LocalSession session, LocalPlayer player, EditSession editSession)
|
||||
throws WorldEditException {
|
||||
int levelsToAscend = 0;
|
||||
if (args.argsLength() == 0) {
|
||||
if (player.ascendLevel()) {
|
||||
player.print("Ascended a level.");
|
||||
levelsToAscend = 1;
|
||||
} else {
|
||||
player.printError("No free spot above you found.");
|
||||
levelsToAscend = args.getInteger(0);
|
||||
}
|
||||
} else {
|
||||
Boolean ascentDone = false;
|
||||
int ascentLevels = 1;
|
||||
int levelsToAscend = args.getInteger(0);
|
||||
while (player.ascendLevel() && levelsToAscend != ascentLevels) {
|
||||
ascentLevels++;
|
||||
}
|
||||
if (ascentLevels == 0) {
|
||||
player.printError("No free spot above you found.");
|
||||
} else {
|
||||
player.print("Ascended " + Integer.toString(ascentLevels) + " levels.");
|
||||
}
|
||||
player.print((ascentLevels != 1) ? "Ascended " + Integer.toString(ascentLevels) + " levels." : "Ascended a level.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -89,25 +86,23 @@ public class NavigationCommands {
|
||||
public static void descend(CommandContext args, WorldEdit we,
|
||||
LocalSession session, LocalPlayer player, EditSession editSession)
|
||||
throws WorldEditException {
|
||||
|
||||
int levelsToDescend = 0;
|
||||
if (args.argsLength() == 0) {
|
||||
if (player.descendLevel()) {
|
||||
player.print("Descended a level.");
|
||||
levelsToDescend = 1;
|
||||
} else {
|
||||
player.printError("No free spot above you found.");
|
||||
levelsToDescend = args.getInteger(0);
|
||||
}
|
||||
} else {
|
||||
|
||||
int descentLevels = 1;
|
||||
int levelsToDescend = args.getInteger(0);
|
||||
while (player.descendLevel() && levelsToDescend != descentLevels) {
|
||||
descentLevels++;
|
||||
}
|
||||
if (descentLevels == 0) {
|
||||
player.printError("No free spot above you found.");
|
||||
} else {
|
||||
player.print("Descended " + Integer.toString(descentLevels) + " levels.");
|
||||
}
|
||||
player.print((descentLevels != 1) ? "Descended " + Integer.toString(descentLevels) + " levels." : "Descended a level.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Command(
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren