From 14b68fa45a1826cf2343f0863caba947f88f468f Mon Sep 17 00:00:00 2001 From: jojo Date: Tue, 22 Dec 2020 14:55:23 +0100 Subject: [PATCH] Fix CommandInvite TabCompleter --- .../steamwar/misslewars/commands/CommandInvite.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/de/steamwar/misslewars/commands/CommandInvite.java b/src/de/steamwar/misslewars/commands/CommandInvite.java index 0814c3f..a34b9ed 100644 --- a/src/de/steamwar/misslewars/commands/CommandInvite.java +++ b/src/de/steamwar/misslewars/commands/CommandInvite.java @@ -81,7 +81,7 @@ public class CommandInvite implements CommandExecutor, TabCompleter { @Override public List onTabComplete(CommandSender sender, Command command, String label, String[] args) { - if (args.length == 0) { + if (args.length == 1) { return Bukkit.getOnlinePlayers() .stream() .filter(p -> MissileWars.getTeam(p) != null) @@ -89,16 +89,7 @@ public class CommandInvite implements CommandExecutor, TabCompleter { .map(Player::getName) .collect(Collectors.toList()); } - if (args.length != 1) { - return new ArrayList<>(); - } - return Bukkit.getOnlinePlayers() - .stream() - .filter(p -> MissileWars.getTeam(p) != null) - .filter(p -> MissileWars.getInvitation(p) != null) - .map(Player::getName) - .filter(s -> s.startsWith(args[0])) - .collect(Collectors.toList()); + return new ArrayList<>(); } }