1
0
Files
aetheria-anarchy-plugin/src/main/java/cc/fascinated/command/CommandManager.java

23 lines
640 B
Java
Raw Normal View History

2024-03-20 13:42:42 +00:00
package cc.fascinated.command;
import cc.fascinated.Aetheria;
2024-03-20 17:50:17 +00:00
import cc.fascinated.command.impl.HelpCommand;
2024-03-20 13:42:42 +00:00
import cc.fascinated.command.impl.TotalJoinsCommand;
import java.util.Objects;
public class CommandManager {
public CommandManager() {
registerCommand(new TotalJoinsCommand());
2024-03-20 17:50:17 +00:00
registerCommand(new HelpCommand());
2024-03-20 13:42:42 +00:00
}
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);
}
}