From 9faf53a463bee495879d9a38bccebed3f63bf36d Mon Sep 17 00:00:00 2001 From: j502647092 Date: Sat, 17 Oct 2015 23:05:56 +0800 Subject: [PATCH] move language file... --- .../command/SimpleProtectCommand.java | 19 +++++++++++-------- src/main/resources/config.yml | 1 + 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/java/cn/citycraft/SimpleProtect/command/SimpleProtectCommand.java b/src/main/java/cn/citycraft/SimpleProtect/command/SimpleProtectCommand.java index 8916b67..6a5e3dc 100644 --- a/src/main/java/cn/citycraft/SimpleProtect/command/SimpleProtectCommand.java +++ b/src/main/java/cn/citycraft/SimpleProtect/command/SimpleProtectCommand.java @@ -23,18 +23,18 @@ public class SimpleProtectCommand implements CommandExecutor { /** * @param simpleProtect */ - public SimpleProtectCommand(SimpleProtect simpleProtect) { + public SimpleProtectCommand(final SimpleProtect simpleProtect) { plugin = simpleProtect; } @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + public boolean onCommand(final CommandSender sender, final Command command, final String label, final String[] args) { switch (args.length) { case 1: switch (args[0]) { case "setspawn": if (sender instanceof Player) { - Location l = ((Player) sender).getLocation(); + final Location l = ((Player) sender).getLocation(); plugin.config.set("SafeNetherDoor.World", l.getWorld().getName()); plugin.config.set("SafeNetherDoor.X", l.getBlockX()); plugin.config.set("SafeNetherDoor.Y", l.getBlockY()); @@ -47,28 +47,31 @@ public class SimpleProtectCommand implements CommandExecutor { sender.sendMessage(plugin.pluginname + "§a配置文件已重载!"); return true; case "list": - sender.sendMessage("§c当前被禁言的玩家有: "); - for (String player : plugin.spam.getCc()) + sender.sendMessage(plugin.getfullmsg("Spam.MutePlayer")); + for (final String player : plugin.spam.getCc()) { sender.sendMessage("§6 - " + player); + } return true; } break; case 2: - Player p = Bukkit.getPlayer(args[1]); + final Player p = Bukkit.getPlayer(args[1]); switch (args[0]) { case "add": if (p != null) { plugin.spam.getCc().add(p.getName()); sender.sendMessage(plugin.getfullmsg("Spam.MuteOn").replace("%player%", p.getDisplayName())); - } else + } else { sender.sendMessage(plugin.getfullmsg("Spam.OffLine")); + } return true; case "del": if (p != null && plugin.spam.getCc().contains(p.getName())) { plugin.spam.getCc().remove(p); sender.sendMessage(plugin.getfullmsg("Spam.MuteOff").replace("%player%", p.getDisplayName())); - } else + } else { sender.sendMessage(plugin.getfullmsg("Spam.NotMute")); + } return true; case "admin": if (args[1].equalsIgnoreCase("on")) { diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index c78ea0d..ab266dc 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -64,6 +64,7 @@ Spam: TooMuchSameChat: '请不要短时间内发送相同的信息' TooMuchCommand: '请不要短时间内发送大量命令' TooMuchSameCommand: '请不要短时间内发送相同的命令' + MutePlayer: '&c当前被禁言的玩家有: ' MuteOn: '&a已允许玩家 %player% &a聊天!' MuteOff: '&c已禁止玩家 %player% &c聊天!' OffLine: '&c玩家不存在或不在线!'