From efab6e92f76eaccb62247aac2bac10f3659539f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Wed, 24 Jun 2020 13:44:06 +0200 Subject: [PATCH] Lower tab completion cache time and fix "Invalid player" message for `/plot kick` --- .../main/java/com/plotsquared/core/command/Kick.java | 10 +++++----- .../java/com/plotsquared/core/util/TabCompletions.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/Kick.java b/Core/src/main/java/com/plotsquared/core/command/Kick.java index 6dc3aaa97..911ea9810 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Kick.java +++ b/Core/src/main/java/com/plotsquared/core/command/Kick.java @@ -72,12 +72,12 @@ public class Kick extends SubCommand { if (throwable instanceof TimeoutException) { MainUtil.sendMessage(player, Captions.FETCHING_PLAYERS_TIMEOUT); } else if (throwable != null || uuids.isEmpty()) { - MainUtil.sendMessage(player, Captions.INVALID_PLAYER); + MainUtil.sendMessage(player, Captions.INVALID_PLAYER, args[0]); } else { - Set players = new HashSet<>(); + Set> players = new HashSet<>(); for (UUID uuid : uuids) { if (uuid == DBFunc.EVERYONE) { - for (PlotPlayer pp : plot.getPlayersInPlot()) { + for (PlotPlayer pp : plot.getPlayersInPlot()) { if (pp == player || Permissions .hasPermission(pp, Captions.PERMISSION_ADMIN_ENTRY_DENIED)) { continue; @@ -86,7 +86,7 @@ public class Kick extends SubCommand { } continue; } - PlotPlayer pp = PlotSquared.imp().getPlayerManager().getPlayerIfExists(uuid); + PlotPlayer pp = PlotSquared.imp().getPlayerManager().getPlayerIfExists(uuid); if (pp != null) { players.add(pp); } @@ -96,7 +96,7 @@ public class Kick extends SubCommand { MainUtil.sendMessage(player, Captions.INVALID_PLAYER, args[0]); return; } - for (PlotPlayer player2 : players) { + for (PlotPlayer player2 : players) { if (!plot.equals(player2.getCurrentPlot())) { MainUtil.sendMessage(player, Captions.INVALID_PLAYER, args[0]); return; diff --git a/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java b/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java index bb6c74bd4..dbf053c52 100644 --- a/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java +++ b/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java @@ -56,7 +56,7 @@ import java.util.stream.Collectors; public class TabCompletions { private final Cache> cachedCompletionValues = - CacheBuilder.newBuilder().expireAfterWrite(1, TimeUnit.MINUTES).build(); + CacheBuilder.newBuilder().expireAfterWrite(15, TimeUnit.SECONDS).build(); private final Command booleanTrueCompletion = new Command(null, false, "true", "", RequiredType.NONE, null) {};