mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-24 10:17:39 +00:00
Some code tidying.
This commit is contained in:
parent
6b9dbe349a
commit
7717223686
@ -57,26 +57,23 @@ public class NavigationCommands {
|
|||||||
public static void ascend(CommandContext args, WorldEdit we,
|
public static void ascend(CommandContext args, WorldEdit we,
|
||||||
LocalSession session, LocalPlayer player, EditSession editSession)
|
LocalSession session, LocalPlayer player, EditSession editSession)
|
||||||
throws WorldEditException {
|
throws WorldEditException {
|
||||||
if (args.argsLength() == 0) {
|
int levelsToAscend = 0;
|
||||||
if (player.ascendLevel()) {
|
if (args.argsLength() == 0) {
|
||||||
player.print("Ascended a level.");
|
levelsToAscend = 1;
|
||||||
} else {
|
} else {
|
||||||
player.printError("No free spot above you found.");
|
levelsToAscend = args.getInteger(0);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
Boolean ascentDone = false;
|
|
||||||
int ascentLevels = 1;
|
int ascentLevels = 1;
|
||||||
int levelsToAscend = args.getInteger(0);
|
|
||||||
while (player.ascendLevel() && levelsToAscend != ascentLevels) {
|
while (player.ascendLevel() && levelsToAscend != ascentLevels) {
|
||||||
ascentLevels++;
|
ascentLevels++;
|
||||||
}
|
}
|
||||||
if (ascentLevels == 0) {
|
if (ascentLevels == 0) {
|
||||||
player.printError("No free spot above you found.");
|
player.printError("No free spot above you found.");
|
||||||
} else {
|
} else {
|
||||||
player.print("Ascended " + Integer.toString(ascentLevels) + " levels.");
|
player.print((ascentLevels != 1) ? "Ascended " + Integer.toString(ascentLevels) + " levels." : "Ascended a level.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
aliases = {"descend"},
|
aliases = {"descend"},
|
||||||
@ -89,25 +86,23 @@ public class NavigationCommands {
|
|||||||
public static void descend(CommandContext args, WorldEdit we,
|
public static void descend(CommandContext args, WorldEdit we,
|
||||||
LocalSession session, LocalPlayer player, EditSession editSession)
|
LocalSession session, LocalPlayer player, EditSession editSession)
|
||||||
throws WorldEditException {
|
throws WorldEditException {
|
||||||
|
int levelsToDescend = 0;
|
||||||
if (args.argsLength() == 0) {
|
if (args.argsLength() == 0) {
|
||||||
if (player.descendLevel()) {
|
levelsToDescend = 1;
|
||||||
player.print("Descended a level.");
|
|
||||||
} else {
|
|
||||||
player.printError("No free spot above you found.");
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
int descentLevels = 1;
|
levelsToDescend = args.getInteger(0);
|
||||||
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.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int descentLevels = 1;
|
||||||
|
while (player.descendLevel() && levelsToDescend != descentLevels) {
|
||||||
|
descentLevels++;
|
||||||
|
}
|
||||||
|
if (descentLevels == 0) {
|
||||||
|
player.printError("No free spot above you found.");
|
||||||
|
} else {
|
||||||
|
player.print((descentLevels != 1) ? "Descended " + Integer.toString(descentLevels) + " levels." : "Descended a level.");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
|
Loading…
Reference in New Issue
Block a user