2022-08-07 01:21:47 +02:00
|
|
|
package net.knarcraft.blacksmith.command;
|
|
|
|
|
2022-08-08 14:14:42 +02:00
|
|
|
import net.md_5.bungee.api.ChatColor;
|
2022-08-07 01:21:47 +02:00
|
|
|
import org.bukkit.command.Command;
|
|
|
|
import org.bukkit.command.CommandExecutor;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
|
|
|
|
public class BlackSmithCommand implements CommandExecutor {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label,
|
|
|
|
@NotNull String[] args) {
|
2022-08-08 14:14:42 +02:00
|
|
|
if (!sender.hasPermission("blacksmith.admin")) {
|
2022-08-08 19:33:51 +02:00
|
|
|
sender.sendMessage(ChatColor.DARK_RED + "You don't have the necessary permission for using this command.");
|
2022-08-08 14:14:42 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2022-08-07 01:21:47 +02:00
|
|
|
//TODO: This command should have one config sub-command which changes the default config values, and all
|
|
|
|
// setting names which can be changed for each NPC.
|
|
|
|
if (args.length > 0) {
|
|
|
|
if (args[0].equalsIgnoreCase("reload")) {
|
|
|
|
return new ReloadCommand().onCommand(sender, command, label, args);
|
2022-08-08 14:14:42 +02:00
|
|
|
} else if (args[0].equalsIgnoreCase("config")) {
|
|
|
|
//TODO: Allow changing any global/default setting + reloading here
|
|
|
|
} else {
|
|
|
|
return new NPCSettingCommand().onCommand(sender, command, label, args);
|
2022-08-07 01:21:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|