1
0
mirror of https://e.coding.net/circlecloud/Residence.git synced 2025-11-28 22:26:09 +00:00

convert command to subclass...

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092
2015-09-23 20:56:52 +08:00
parent 371be069c6
commit 6b0f5ac789
9 changed files with 475 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
package com.bekvon.bukkit.residence.commandmain;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandException;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.bekvon.bukkit.residence.Residence;
import cn.citycraft.PluginHelper.commands.BaseCommand;
public class CommandResReload extends BaseCommand {
Residence plugin;
public CommandResReload(Residence plugin) {
super("resreload");
this.plugin = plugin;
}
@Override
public void execute(CommandSender sender, Command command, String label, String[] args) throws CommandException {
if (sender instanceof Player) {
Player player = (Player) sender;
if (Residence.getPermissionManager().isResidenceAdmin(player)) {
plugin.reloadPlugin();
sender.sendMessage(ChatColor.GREEN + "[Residence] 重载配置文件.");
System.out.println("[Residence] 重载 by " + player.getName() + ".");
}
} else {
plugin.reloadPlugin();
System.out.println("[Residence] 重载 by 控制台.");
}
}
}