aboutsummaryrefslogtreecommitdiff
path: root/spark-fabric/src
diff options
context:
space:
mode:
Diffstat (limited to 'spark-fabric/src')
-rw-r--r--spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java7
-rw-r--r--spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java15
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();
});