diff options
author | Luck <git@lucko.me> | 2019-09-03 19:07:05 +0100 |
---|---|---|
committer | Luck <git@lucko.me> | 2019-09-03 19:07:05 +0100 |
commit | 3363701e498be1eac970dfc2a6c4432de0a4208c (patch) | |
tree | 65ead575deee8be1e07fcc88d0c3511e0218f284 /spark-fabric/src/main/java/me/lucko/spark/fabric | |
parent | d26c49846e57f22e2a8672ecf7e68a6a655bd1d2 (diff) | |
download | spark-3363701e498be1eac970dfc2a6c4432de0a4208c.tar.gz spark-3363701e498be1eac970dfc2a6c4432de0a4208c.tar.bz2 spark-3363701e498be1eac970dfc2a6c4432de0a4208c.zip |
Codestyle changes
Diffstat (limited to 'spark-fabric/src/main/java/me/lucko/spark/fabric')
-rw-r--r-- | spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java | 7 | ||||
-rw-r--r-- | spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java | 15 |
2 files changed, 11 insertions, 11 deletions
diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java index a23dc48..2541f7d 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java @@ -95,8 +95,7 @@ public class FabricClientSparkPlugin extends FabricSparkPlugin implements Sugges } @Override - public CompletableFuture<Suggestions> getSuggestions(CommandContext<CommandSource> context, SuggestionsBuilder builder) - throws CommandSyntaxException { + public CompletableFuture<Suggestions> getSuggestions(CommandContext<CommandSource> context, SuggestionsBuilder builder) throws CommandSyntaxException { String[] split = context.getInput().split(" "); if (split.length == 0 || (!split[0].equals("/sparkc") && !split[0].equals("/sparkclient"))) { return Suggestions.empty(); @@ -105,8 +104,8 @@ public class FabricClientSparkPlugin extends FabricSparkPlugin implements Sugges String[] args = Arrays.copyOfRange(split, 1, split.length); return CompletableFuture.supplyAsync(() -> { - for (String each : this.platform.tabCompleteCommand(new FabricCommandSender(this.minecraft.player, this), args)) { - builder.suggest(each); + for (String suggestion : this.platform.tabCompleteCommand(new FabricCommandSender(this.minecraft.player, this), args)) { + builder.suggest(suggestion); } return builder.build(); }); diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java index 50d6560..76568c3 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java @@ -57,7 +57,7 @@ public class FabricServerSparkPlugin extends FabricSparkPlugin implements Comman this.server = server; } - private String /*Nullable*/ [] processArgs(CommandContext<ServerCommandSource> context) { + private static String /*Nullable*/ [] processArgs(CommandContext<ServerCommandSource> context) { String[] split = context.getInput().split(" "); if (split.length == 0 || !split[0].equals("/spark")) { return null; @@ -69,24 +69,25 @@ public class FabricServerSparkPlugin extends FabricSparkPlugin implements Comman @Override public int run(CommandContext<ServerCommandSource> context) throws CommandSyntaxException { String[] args = processArgs(context); - if (args == null) + if (args == null) { return 0; + } this.platform.executeCommand(new FabricCommandSender(context.getSource().getPlayer(), this), args); return Command.SINGLE_SUCCESS; } @Override - public CompletableFuture<Suggestions> getSuggestions(CommandContext<ServerCommandSource> context, SuggestionsBuilder builder) - throws CommandSyntaxException { + public CompletableFuture<Suggestions> getSuggestions(CommandContext<ServerCommandSource> context, SuggestionsBuilder builder) throws CommandSyntaxException { String[] args = processArgs(context); - if (args == null) + if (args == null) { return Suggestions.empty(); + } ServerPlayerEntity player = context.getSource().getPlayer(); return CompletableFuture.supplyAsync(() -> { - for (String each : this.platform.tabCompleteCommand(new FabricCommandSender(player, this), args)) { - builder.suggest(each); + for (String suggestion : this.platform.tabCompleteCommand(new FabricCommandSender(player, this), args)) { + builder.suggest(suggestion); } return builder.build(); }); |