forked from Geoffrey/Geoffrey-MC-Plugin
38 lines
1.1 KiB
Java
38 lines
1.1 KiB
Java
package com.zerohighdef.geoffrey.Commands;
|
|
|
|
import com.zerohighdef.geoffrey.GeoffreyMC;
|
|
import org.bukkit.ChatColor;
|
|
import org.bukkit.command.Command;
|
|
import org.bukkit.command.CommandExecutor;
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import java.util.Objects;
|
|
|
|
public class Geoffrey implements CommandExecutor {
|
|
protected GeoffreyMC plugin;
|
|
|
|
public Geoffrey(GeoffreyMC plugin) {
|
|
this.plugin = plugin;
|
|
}
|
|
|
|
@Override
|
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
|
if (args.length == 0)
|
|
{
|
|
sender.sendMessage(ChatColor.GREEN + "GeoffreyMC v" + plugin.getDescription().getVersion());
|
|
sender.sendMessage(ChatColor.GREEN + "/geoffrey reload - reloads the plugin config");
|
|
}
|
|
else {
|
|
if (Objects.equals(args[0], "reload")) {
|
|
plugin.reloadConfig();
|
|
sender.sendMessage(ChatColor.GREEN + "Plugin reloaded!");
|
|
}
|
|
else {
|
|
sender.sendMessage(ChatColor.RED + "Unknown subcommand!");
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|