Skip to content

Commit

Permalink
Update for dummy context removal
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed May 13, 2024
1 parent 36f3edb commit 2974b7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ final class ModernPaperBrigadier<C, B> implements CommandRegistrationHandler<C>,

this.brigadierManager = new CloudBrigadierManager<>(
this.manager,
() -> {
throw new UnsupportedOperationException();
},
SenderMapper.create(
source -> {
if (baseType.equals(CommandSender.class)) {
Expand Down

0 comments on commit 2974b7e

Please sign in to comment.