From 13ccb1a96b92e19e1c679578608c31caa8a5cae9 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Tue, 9 Aug 2016 14:03:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=8F=B0=E5=91=BD=E4=BB=A4=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- .../yumc/TeleportRandom/TeleportRandom.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/pw/yumc/TeleportRandom/TeleportRandom.java b/src/main/java/pw/yumc/TeleportRandom/TeleportRandom.java index 078d176..0f093f4 100644 --- a/src/main/java/pw/yumc/TeleportRandom/TeleportRandom.java +++ b/src/main/java/pw/yumc/TeleportRandom/TeleportRandom.java @@ -27,6 +27,18 @@ public class TeleportRandom extends JavaPlugin implements CommandExecutor { @Override public boolean onCommand(final CommandSender sender, final Command cmd, final String string, final String[] args) { + if (args.length > 0) { + if (args[0].equalsIgnoreCase("reload")) { + config.reload(); + sender.sendMessage(getPrefix() + config.getMessage("Message.Reload")); + return true; + } + if (args[0].equalsIgnoreCase("help")) { + sender.sendMessage("玩家: /tpr [范围] [世界]"); + sender.sendMessage("控制台: /tpr <玩家> [范围] [世界]"); + return true; + } + } try { if (sender instanceof Player) { final Player p = (Player) sender; @@ -59,18 +71,6 @@ public class TeleportRandom extends JavaPlugin implements CommandExecutor { } } } catch (final IllegalArgumentException e) { - if (args.length > 0) { - if (args[0].equalsIgnoreCase("reload")) { - config.reload(); - sender.sendMessage(getPrefix() + config.getMessage("Message.Reload")); - return true; - } - if (args[0].equalsIgnoreCase("help")) { - sender.sendMessage("玩家: /tpr [范围] [世界]"); - sender.sendMessage("控制台: /tpr <玩家> [范围] [世界]"); - return true; - } - } sender.sendMessage(getPrefix() + "§c非法的参数或不存在的世界!"); } return false;