From bad2c2d0c1f70617a8b83839ad258327b5c15959 Mon Sep 17 00:00:00 2001 From: Jerry Date: Mon, 20 Mar 2023 18:32:31 +0800 Subject: [PATCH] fix suggest --- src/main/java/de/strifel/VTools/commands/CommandFind.java | 2 +- src/main/java/de/strifel/VTools/commands/CommandSend.java | 2 +- src/main/java/de/strifel/VTools/commands/CommandTp.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/strifel/VTools/commands/CommandFind.java b/src/main/java/de/strifel/VTools/commands/CommandFind.java index 5b47769..b360a91 100644 --- a/src/main/java/de/strifel/VTools/commands/CommandFind.java +++ b/src/main/java/de/strifel/VTools/commands/CommandFind.java @@ -43,7 +43,7 @@ public class CommandFind implements SimpleCommand { String[] currentArgs = invocation.arguments(); List arg = new ArrayList<>(); - if (currentArgs.length == 1 && invocation.source().hasPermission("vtools.find.autocomplete")) { + if (currentArgs.length <= 1 && invocation.source().hasPermission("vtools.find.autocomplete")) { for (Player player : server.getAllPlayers()) { arg.add(player.getUsername()); } diff --git a/src/main/java/de/strifel/VTools/commands/CommandSend.java b/src/main/java/de/strifel/VTools/commands/CommandSend.java index a0b3286..770bc5f 100644 --- a/src/main/java/de/strifel/VTools/commands/CommandSend.java +++ b/src/main/java/de/strifel/VTools/commands/CommandSend.java @@ -83,7 +83,7 @@ public class CommandSend implements SimpleCommand { String[] currentArgs = invocation.arguments(); List arg = new ArrayList(); - if (currentArgs.length == 1) { + if (currentArgs.length <= 1) { arg.add("all"); arg.add("current"); for (Player player : server.getAllPlayers()) { diff --git a/src/main/java/de/strifel/VTools/commands/CommandTp.java b/src/main/java/de/strifel/VTools/commands/CommandTp.java index 41ddd88..23edb77 100644 --- a/src/main/java/de/strifel/VTools/commands/CommandTp.java +++ b/src/main/java/de/strifel/VTools/commands/CommandTp.java @@ -46,7 +46,7 @@ public class CommandTp implements SimpleCommand { @Override public List suggest(Invocation commandInvocation) { List arg = new ArrayList<>(); - if (commandInvocation.arguments().length == 1) { + if (commandInvocation.arguments().length <= 1) { for (Player player : server.getAllPlayers()) { arg.add(player.getUsername()); }