1
0

start migration to lang file

This commit is contained in:
Lee
2024-03-28 14:00:15 +00:00
parent c80d1318d6
commit 48ad8a707b
13 changed files with 132 additions and 31 deletions

View File

@ -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);
}
}