From afdd43ea21785410d9027a68164a3723d0f52542 Mon Sep 17 00:00:00 2001 From: lt_name <572413378@qq.com> Date: Sun, 18 Jul 2021 15:07:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=81=E6=AD=A2=E5=9C=A8=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=8F=B0=E4=BD=BF=E7=94=A8addroute=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/smallaswater/npc/RsNpcX.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/smallaswater/npc/RsNpcX.java b/src/main/java/com/smallaswater/npc/RsNpcX.java index b1b8448..31f072b 100644 --- a/src/main/java/com/smallaswater/npc/RsNpcX.java +++ b/src/main/java/com/smallaswater/npc/RsNpcX.java @@ -186,7 +186,7 @@ private void loadSkins() { @Override public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) { - if (command.getName().equals("rsnpcx")) { + if ("rsnpcx".equals(command.getName())) { if (args.length > 0) { switch (args[0]) { case "create": @@ -245,6 +245,10 @@ public boolean onCommand(final CommandSender sender, Command command, String lab } return true; case "addroute": + if (!(sender instanceof Player)) { + sender.sendMessage("§c请在游戏内使用此命令!"); + return true; + } Player player = (Player) sender; if (args.length > 1) { String name = args[1];