Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-24 18:10:08 +01:00
Merge pull request #419 from Cebtenzzre/patch-1
Fix ascent and descent commands.
Dieser Commit ist enthalten in:
Commit
caf0ad9417
@ -75,9 +75,12 @@ public class NavigationCommands {
|
|||||||
)
|
)
|
||||||
@CommandPermissions("worldedit.navigation.ascend")
|
@CommandPermissions("worldedit.navigation.ascend")
|
||||||
public void ascend(Player player, @Optional("1") int levelsToAscend) throws WorldEditException {
|
public void ascend(Player player, @Optional("1") int levelsToAscend) throws WorldEditException {
|
||||||
int ascentLevels = 1;
|
int ascentLevels = 0;
|
||||||
while (player.ascendLevel() && levelsToAscend != ascentLevels) {
|
while (player.ascendLevel()) {
|
||||||
++ascentLevels;
|
++ascentLevels;
|
||||||
|
if (levelsToAscend == ascentLevels) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (ascentLevels == 0) {
|
if (ascentLevels == 0) {
|
||||||
player.printError("No free spot above you found.");
|
player.printError("No free spot above you found.");
|
||||||
@ -95,12 +98,15 @@ public class NavigationCommands {
|
|||||||
)
|
)
|
||||||
@CommandPermissions("worldedit.navigation.descend")
|
@CommandPermissions("worldedit.navigation.descend")
|
||||||
public void descend(Player player, @Optional("1") int levelsToDescend) throws WorldEditException {
|
public void descend(Player player, @Optional("1") int levelsToDescend) throws WorldEditException {
|
||||||
int descentLevels = 1;
|
int descentLevels = 0;
|
||||||
while (player.descendLevel() && levelsToDescend != descentLevels) {
|
while (player.descendLevel()) {
|
||||||
++descentLevels;
|
++descentLevels;
|
||||||
|
if (levelsToDescend == descentLevels) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (descentLevels == 0) {
|
if (descentLevels == 0) {
|
||||||
player.printError("No free spot above you found.");
|
player.printError("No free spot below you found.");
|
||||||
} else {
|
} else {
|
||||||
player.print((descentLevels != 1) ? "Descended " + Integer.toString(descentLevels) + " levels." : "Descended a level.");
|
player.print((descentLevels != 1) ? "Descended " + Integer.toString(descentLevels) + " levels." : "Descended a level.");
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren