diff options
Diffstat (limited to 'spark-forge')
-rw-r--r-- | spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeClientSparkPlugin.java | 7 | ||||
-rw-r--r-- | spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java | 12 |
2 files changed, 9 insertions, 10 deletions
diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeClientSparkPlugin.java b/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeClientSparkPlugin.java index ee32325..6db916c 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeClientSparkPlugin.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeClientSparkPlugin.java @@ -103,8 +103,7 @@ public class ForgeClientSparkPlugin extends ForgeSparkPlugin implements Suggesti } @Override - public CompletableFuture<Suggestions> getSuggestions(CommandContext<ISuggestionProvider> context, SuggestionsBuilder builder) - throws CommandSyntaxException { + public CompletableFuture<Suggestions> getSuggestions(CommandContext<ISuggestionProvider> context, SuggestionsBuilder builder) throws CommandSyntaxException { String chat = context.getInput(); String[] split = chat.split(" "); if (split.length == 0 || (!split[0].equals("/sparkc") && !split[0].equals("/sparkclient"))) { @@ -114,8 +113,8 @@ public class ForgeClientSparkPlugin extends ForgeSparkPlugin implements Suggesti String[] args = Arrays.copyOfRange(split, 1, split.length); return CompletableFuture.supplyAsync(() -> { - for (String each : this.platform.tabCompleteCommand(new ForgeCommandSender(this.minecraft.player, this), args)) { - builder.suggest(each); + for (String suggestion : this.platform.tabCompleteCommand(new ForgeCommandSender(this.minecraft.player, this), args)) { + builder.suggest(suggestion); } return builder.build(); }); diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java b/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java index 7a91e5c..98404e0 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java @@ -63,7 +63,7 @@ public class ForgeServerSparkPlugin extends ForgeSparkPlugin implements Command< this.server = server; } - private String /* Nullable */[] processArgs(CommandContext<CommandSource> context) { + private static String /* Nullable */[] processArgs(CommandContext<CommandSource> context) { String[] split = context.getInput().split(" "); if (split.length == 0 || !split[0].equals("/spark")) { return null; @@ -83,16 +83,16 @@ public class ForgeServerSparkPlugin extends ForgeSparkPlugin implements Command< } @Override - public CompletableFuture<Suggestions> getSuggestions(CommandContext<CommandSource> context, SuggestionsBuilder builder) - throws CommandSyntaxException { + public CompletableFuture<Suggestions> getSuggestions(CommandContext<CommandSource> context, SuggestionsBuilder builder) throws CommandSyntaxException { String[] args = processArgs(context); - if (args == null) + if (args == null) { return Suggestions.empty(); + } ServerPlayerEntity player = context.getSource().asPlayer(); return CompletableFuture.supplyAsync(() -> { - for (String each : this.platform.tabCompleteCommand(new ForgeCommandSender(player, this), args)) { - builder.suggest(each); + for (String suggestion : this.platform.tabCompleteCommand(new ForgeCommandSender(player, this), args)) { + builder.suggest(suggestion); } return builder.build(); }); |