mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-12-22 00:58:04 +01:00
CommandsAPI - Improved #getCommand(String label) in CommandsManager
This commit is contained in:
parent
40b56843e7
commit
7cb978fd4c
@ -1,6 +1,5 @@
|
||||
package us.tastybento.bskyblock.managers;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import us.tastybento.bskyblock.BSkyBlock;
|
||||
import us.tastybento.bskyblock.api.BSModule;
|
||||
@ -36,7 +35,7 @@ public final class CommandsManager {
|
||||
public Command getCommand(String label) {
|
||||
for (List<Command> cmds : commands.values()) {
|
||||
for (Command cmd : cmds) {
|
||||
if (cmd.getLabel().equalsIgnoreCase(label)) return cmd;
|
||||
if (cmd.getLabel().equals(label) || cmd.getAliases().contains(label)) return cmd;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user