From 2974b7e8e5cb58ab350351c5dfb24ad293545e0a Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sun, 12 May 2024 11:02:41 -0700 Subject: [PATCH] Update for dummy context removal --- .../brigadier/suggestion/BrigadierSuggestionFactory.java | 6 ++++-- .../java/org/incendo/cloud/paper/ModernPaperBrigadier.java | 3 --- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cloud-brigadier/src/main/java/org/incendo/cloud/brigadier/suggestion/BrigadierSuggestionFactory.java b/cloud-brigadier/src/main/java/org/incendo/cloud/brigadier/suggestion/BrigadierSuggestionFactory.java index 4116e5f7..19d40de3 100644 --- a/cloud-brigadier/src/main/java/org/incendo/cloud/brigadier/suggestion/BrigadierSuggestionFactory.java +++ b/cloud-brigadier/src/main/java/org/incendo/cloud/brigadier/suggestion/BrigadierSuggestionFactory.java @@ -35,13 +35,14 @@ import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import org.incendo.cloud.CommandManager; -import org.incendo.cloud.brigadier.CloudBrigadierCommand; import org.incendo.cloud.brigadier.CloudBrigadierManager; import org.incendo.cloud.brigadier.parser.WrappedBrigadierParser; import org.incendo.cloud.component.CommandComponent; import org.incendo.cloud.context.CommandContext; import org.incendo.cloud.suggestion.SuggestionFactory; +import static org.incendo.cloud.brigadier.CloudBrigadierCommand.parsedNodes; + /** * Produces Brigadier suggestions by invoking the Cloud suggestion provider. * @@ -93,7 +94,8 @@ public BrigadierSuggestionFactory( this.commandManager ); commandContext.store(WrappedBrigadierParser.COMMAND_CONTEXT_BRIGADIER_NATIVE_SENDER, senderContext.getSource()); - String command = builder.getInput().substring(CloudBrigadierCommand.parsedNodes(senderContext.getLastChild()).get(0).second().getStart()); + String command = builder.getInput() + .substring(parsedNodes(senderContext.getLastChild()).get(0).second().getStart()); /* Remove namespace */ final String leading = command.split(" ")[0]; diff --git a/cloud-paper/src/main/java/org/incendo/cloud/paper/ModernPaperBrigadier.java b/cloud-paper/src/main/java/org/incendo/cloud/paper/ModernPaperBrigadier.java index 07908288..bc270d90 100644 --- a/cloud-paper/src/main/java/org/incendo/cloud/paper/ModernPaperBrigadier.java +++ b/cloud-paper/src/main/java/org/incendo/cloud/paper/ModernPaperBrigadier.java @@ -95,9 +95,6 @@ final class ModernPaperBrigadier implements CommandRegistrationHandler, this.brigadierManager = new CloudBrigadierManager<>( this.manager, - () -> { - throw new UnsupportedOperationException(); - }, SenderMapper.create( source -> { if (baseType.equals(CommandSender.class)) {