start migration to lang file
This commit is contained in:
@ -2,21 +2,26 @@ package cc.fascinated.command;
|
||||
|
||||
import cc.fascinated.Aetheria;
|
||||
import cc.fascinated.command.impl.HelpCommand;
|
||||
import cc.fascinated.command.impl.SeedCommand;
|
||||
import cc.fascinated.command.impl.TotalJoinsCommand;
|
||||
|
||||
import java.util.Objects;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
|
||||
public class CommandManager {
|
||||
|
||||
public CommandManager() {
|
||||
registerCommand(new TotalJoinsCommand());
|
||||
registerCommand(new HelpCommand());
|
||||
registerCommand(new SeedCommand());
|
||||
}
|
||||
|
||||
public static void registerCommand(Command command) {
|
||||
if (command == null) {
|
||||
throw new IllegalArgumentException("Command cannot be null.");
|
||||
}
|
||||
Objects.requireNonNull(Aetheria.INSTANCE.getCommand(command.getCommand())).setExecutor(command);
|
||||
PluginCommand pluginCommand = Aetheria.INSTANCE.getCommand(command.getCommand());
|
||||
if (pluginCommand == null) {
|
||||
throw new IllegalArgumentException("Command " + command.getCommand() + " does not exist.");
|
||||
}
|
||||
pluginCommand.setExecutor(command);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user