From 3363701e498be1eac970dfc2a6c4432de0a4208c Mon Sep 17 00:00:00 2001 From: Luck Date: Tue, 3 Sep 2019 19:07:05 +0100 Subject: Codestyle changes --- .../me/lucko/spark/forge/plugin/ForgeClientSparkPlugin.java | 7 +++---- .../me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java | 12 ++++++------ 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'spark-forge/src/main') 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 getSuggestions(CommandContext context, SuggestionsBuilder builder) - throws CommandSyntaxException { + public CompletableFuture getSuggestions(CommandContext 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 context) { + private static String /* Nullable */[] processArgs(CommandContext 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 getSuggestions(CommandContext context, SuggestionsBuilder builder) - throws CommandSyntaxException { + public CompletableFuture getSuggestions(CommandContext 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(); }); -- cgit