diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands_helper/MVCommandCompletions.java b/src/main/java/com/onarandombox/MultiverseCore/commands_helper/MVCommandCompletions.java index ba0024ee..fa7cff2f 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands_helper/MVCommandCompletions.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands_helper/MVCommandCompletions.java @@ -48,14 +48,17 @@ public class MVCommandCompletions extends PaperCommandCompletions { private Collection suggestDestinations(@NotNull BukkitCommandCompletionContext context) { //TODO: There is one empty dest need to remove. - return this.plugin.getDestFactory().getIdentifiers().stream() + return this.plugin.getDestFactory().getIdentifiers().parallelStream() + .unordered() + .filter(id -> !id.isEmpty()) .map(id -> id + ":") .collect(Collectors.toList()); } @NotNull private Collection suggestMVWorlds(@NotNull BukkitCommandCompletionContext context) { - return this.worldManager.getMVWorlds().stream() + return this.worldManager.getMVWorlds().parallelStream() + .unordered() .map(MultiverseWorld::getName) .collect(Collectors.toList()); } @@ -69,11 +72,13 @@ public class MVCommandCompletions extends PaperCommandCompletions { private Collection suggestPotentialWorlds(@NotNull BukkitCommandCompletionContext context) { //TODO: Should be more efficient //TODO: this should be in WorldManager API - List knownWorlds = this.worldManager.getMVWorlds().stream() + List knownWorlds = this.worldManager.getMVWorlds().parallelStream() + .unordered() .map(MultiverseWorld::getName) .collect(Collectors.toList()); - return Arrays.stream(this.plugin.getServer().getWorldContainer().listFiles()) + return Arrays.stream(this.plugin.getServer().getWorldContainer().listFiles()).parallel() + .unordered() .filter(File::isDirectory) .filter(file -> !knownWorlds.contains(file.getName())) .map(File::getName) diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands_helper/MVCommandContexts.java b/src/main/java/com/onarandombox/MultiverseCore/commands_helper/MVCommandContexts.java index 77222e9a..520ab008 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands_helper/MVCommandContexts.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands_helper/MVCommandContexts.java @@ -204,7 +204,8 @@ public class MVCommandContexts extends PaperCommandContexts { List matchedPlayers; try { - matchedPlayers = this.plugin.getServer().selectEntities(sender, playerIdentifier).stream() + matchedPlayers = this.plugin.getServer().selectEntities(sender, playerIdentifier).parallelStream() + .unordered() .filter(e -> e instanceof Player) .map(e -> ((Player) e)) .collect(Collectors.toList()); diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands_helper/PageDisplay.java b/src/main/java/com/onarandombox/MultiverseCore/commands_helper/PageDisplay.java index f9be7b0a..1442ec3f 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands_helper/PageDisplay.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands_helper/PageDisplay.java @@ -241,6 +241,7 @@ public class PageDisplay { private void doEndPadding() { IntStream.range(0, contentLinesPerPage - contentToShowIndex.size()) + .unordered() .mapToObj(i -> " ") .forEach(sender::sendMessage); }