Skip to content

Commit

Permalink
Register command aliases by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Alemiz112 committed Feb 20, 2021
1 parent 7e87f77 commit 7dfeff7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/dev/waterdog/command/SimpleCommandMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ public SimpleCommandMap(ProxyServer proxy, String prefix) {

@Override
public boolean registerCommand(String name, Command command) {
return this.commandsMap.putIfAbsent(name.toLowerCase(), command) == null;
if (this.commandsMap.putIfAbsent(name.toLowerCase(), command) != null) {
return false;
}
for (String alias : command.getAliases()) {
this.registerAlias(alias, command);
}
return true;
}

@Override
Expand Down

0 comments on commit 7dfeff7

Please sign in to comment.