Skip to content

Commit

Permalink
禁止在控制台使用addroute命令
Browse files Browse the repository at this point in the history
  • Loading branch information
lt-name committed Jul 18, 2021
1 parent 4884e3e commit afdd43e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/smallaswater/npc/RsNpcX.java
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit afdd43e

Please sign in to comment.