Fixes ascend/descend bug
This commit is contained in:
parent
7cbb117215
commit
efef7bcc00
|
@ -81,9 +81,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) {
|
||||||
BBC.ASCEND_FAIL.send(player);
|
BBC.ASCEND_FAIL.send(player);
|
||||||
|
@ -105,9 +108,12 @@ 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) {
|
||||||
BBC.DESCEND_FAIL.send(player);
|
BBC.DESCEND_FAIL.send(player);
|
||||||
|
|
Loading…
Reference in New Issue