aboutsummaryrefslogtreecommitdiff
path: root/spark-forge/src
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2019-09-03 19:07:05 +0100
committerLuck <git@lucko.me>2019-09-03 19:07:05 +0100
commit3363701e498be1eac970dfc2a6c4432de0a4208c (patch)
tree65ead575deee8be1e07fcc88d0c3511e0218f284 /spark-forge/src
parentd26c49846e57f22e2a8672ecf7e68a6a655bd1d2 (diff)
downloadspark-3363701e498be1eac970dfc2a6c4432de0a4208c.tar.gz
spark-3363701e498be1eac970dfc2a6c4432de0a4208c.tar.bz2
spark-3363701e498be1eac970dfc2a6c4432de0a4208c.zip
Codestyle changes
Diffstat (limited to 'spark-forge/src')
-rw-r--r--spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeClientSparkPlugin.java7
-rw-r--r--spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java12
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();
});