mirror of
https://github.com/carm-outsource/TimeReward.git
synced 2026-06-04 23:39:45 +08:00
38 lines
1.2 KiB
Java
38 lines
1.2 KiB
Java
package cc.carm.plugin.timereward.command;
|
|
|
|
import cc.carm.lib.easyplugin.command.CommandHandler;
|
|
import cc.carm.plugin.timereward.command.sub.*;
|
|
import cc.carm.plugin.timereward.conf.PluginMessages;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.plugin.java.JavaPlugin;
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
public class MainCommand extends CommandHandler {
|
|
|
|
public MainCommand(@NotNull JavaPlugin plugin) {
|
|
super(plugin);
|
|
|
|
registerSubCommand(new ClaimCommand(this, "claim"));
|
|
registerSubCommand(new ListCommand(this, "list"));
|
|
registerSubCommand(new UserCommand(this, "user"));
|
|
registerSubCommand(new TestCommand(this, "test"));
|
|
registerSubCommand(new ReloadCommand(this, "reload"));
|
|
}
|
|
|
|
@Override
|
|
public Void noArgs(CommandSender sender) {
|
|
if (sender.hasPermission("TimeReward.admin")) {
|
|
PluginMessages.USAGE.ADMIN.sendTo(sender);
|
|
} else {
|
|
PluginMessages.USAGE.USER.sendTo(sender);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Override
|
|
public Void noPermission(CommandSender sender) {
|
|
PluginMessages.NO_PERMISSION.sendTo(sender);
|
|
return null;
|
|
}
|
|
}
|