1
0
mirror of https://e.coding.net/circlecloud/Residence.git synced 2025-11-25 21:56:06 +00:00

remove static class...

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092
2015-09-24 18:11:35 +08:00
parent 6b0f5ac789
commit 1cffbc7687
48 changed files with 4273 additions and 5120 deletions

View File

@@ -17,32 +17,31 @@ import cn.citycraft.PluginHelper.commands.BaseCommand;
public class CommandConfirm extends BaseCommand {
Residence plugin;
public CommandConfirm(Residence plugin) {
super("?", "help");
public CommandConfirm(final Residence plugin) {
super("confirm");
this.plugin = plugin;
}
@Override
public void execute(CommandSender sender, Command command, String label, String[] args) throws CommandException {
public void execute(final CommandSender sender, final Command command, final String label, final String[] args) throws CommandException {
Player player = null;
boolean resadmin = (command != null);
ResidenceManager rmanager = Residence.getResidenceManager();
Map<String, String> deleteConfirm = plugin.deleteConfirm;
Language language = Residence.getLanguage();
final boolean resadmin = (command != null);
final ResidenceManager rmanager = plugin.getResidenceManager();
final Map<String, String> deleteConfirm = plugin.getDeleteConfirm();
final Language language = plugin.getLanguage();
String name = "Console";
if (sender instanceof Player) {
player = (Player) sender;
name = player.getName();
}
if (args.length == 1) {
String area = deleteConfirm.get(name);
if (area == null)
sender.sendMessage(ChatColor.RED + language.getPhrase("InvalidResidence"));
else {
rmanager.removeResidence(player, area, resadmin);
deleteConfirm.remove(name);
if (player == null)
sender.sendMessage(ChatColor.GREEN + Residence.getLanguage().getPhrase("ResidenceRemove", ChatColor.YELLOW + name + ChatColor.GREEN));
final String area = deleteConfirm.get(name);
if (area == null) {
sender.sendMessage(ChatColor.RED + language.getPhrase("InvalidResidence"));
} else {
rmanager.removeResidence(player, area, resadmin);
deleteConfirm.remove(name);
if (player == null) {
sender.sendMessage(ChatColor.GREEN + language.getPhrase("ResidenceRemove", ChatColor.YELLOW + name + ChatColor.GREEN));
}
}
}