Lower tab completion cache time and fix "Invalid player" message for `/plot kick`

This commit is contained in:
Alexander Söderberg 2020-06-24 13:44:06 +02:00
parent f69cc5cc98
commit efab6e92f7
No known key found for this signature in database
GPG Key ID: C0207FF7EA146678
2 changed files with 6 additions and 6 deletions

View File

@ -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<PlotPlayer> players = new HashSet<>();
Set<PlotPlayer<?>> 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;

View File

@ -56,7 +56,7 @@ import java.util.stream.Collectors;
public class TabCompletions {
private final Cache<String, List<String>> 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) {};