Fixup horrible formatting

This commit is contained in:
FlorianMichael 2024-06-15 16:39:54 +02:00
parent 46474fcd22
commit 0ea07d0e63
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126

View File

@ -45,16 +45,13 @@ public class ViaFabricPlusVLCommandHandler extends VLCommandHandler {
mixin.viaFabricPlus$removeSubCommand("pps");
}
public int execute(CommandContext<FabricClientCommandSource> ctx) {
public int execute(final CommandContext<FabricClientCommandSource> ctx) {
String[] args = new String[0];
try {
args = StringArgumentType.getString(ctx, "args").split(" ");
} catch (IllegalArgumentException ignored) {
}
onCommand(
new ViaFabricPlusViaCommandSender(ctx.getSource()),
args
);
onCommand(new ViaFabricPlusViaCommandSender(ctx.getSource()), args);
return 1;
}
@ -65,17 +62,15 @@ public class ViaFabricPlusVLCommandHandler extends VLCommandHandler {
} catch (IllegalArgumentException ignored) {
args = new String[]{""};
}
String[] pref = args.clone();
final String[] pref = args.clone();
pref[pref.length - 1] = "";
String prefix = String.join(" ", pref);
onTabComplete(new ViaFabricPlusViaCommandSender(ctx.getSource()), args)
.stream()
.map(it -> {
SuggestionsBuilder b = new SuggestionsBuilder(builder.getInput(), prefix.length() + builder.getStart());
b.suggest(it);
return b;
})
.forEach(builder::add);
final String prefix = String.join(" ", pref);
onTabComplete(new ViaFabricPlusViaCommandSender(ctx.getSource()), args).stream().map(it -> {
final var b = new SuggestionsBuilder(builder.getInput(), prefix.length() + builder.getStart());
b.suggest(it);
return b;
}).forEach(builder::add);
return builder.buildFuture();
}