Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ protected void run(final Server server, final User user, final String commandLab
final float speed;
final boolean isBypass = user.isAuthorized("essentials.speed.bypass");
if (args.length == 1) {
isFly = flyPermCheck(user, user.getBase().isFlying());
final boolean inferredFly = isFlyAlias(commandLabel) ? true : isWalkAlias(commandLabel) ? false : user.getBase().isFlying();
isFly = flyPermCheck(user, inferredFly);
speed = getMoveSpeed(args[0]);
} else {
isFly = flyPermCheck(user, isFlyMode(args[0]));
Expand Down Expand Up @@ -91,6 +92,14 @@ private Boolean flyPermCheck(final User user, final boolean input) {
} else return !canWalk;
}

private boolean isFlyAlias(final String label) {
return label.contains("fly") || label.equalsIgnoreCase("fspeed") || label.equalsIgnoreCase("efspeed");
}

private boolean isWalkAlias(final String label) {
return label.contains("walk") || label.equalsIgnoreCase("wspeed") || label.equalsIgnoreCase("ewspeed");
}

private boolean isFlyMode(final String modeString) throws NotEnoughArgumentsException {
final boolean isFlyMode;
if (modeString.contains("fly") || modeString.equalsIgnoreCase("f")) {
Expand Down
Loading