update brig in the API and patch cleanup
This commit is contained in:
@@ -183,7 +183,6 @@
|
||||
+ private void sendAsync(ServerPlayer player, java.util.Collection<CommandNode<CommandSourceStack>> dispatcherRootChildren) {
|
||||
+ // Paper end - Perf: Async command map building
|
||||
+ Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> map = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues
|
||||
+ // Paper - brigadier API removes the need to fill the map twice
|
||||
RootCommandNode<SharedSuggestionProvider> rootCommandNode = new RootCommandNode<>();
|
||||
map.put(this.dispatcher.getRoot(), rootCommandNode);
|
||||
- this.fillUsableCommands(this.dispatcher.getRoot(), rootCommandNode, player.createCommandSourceStack(), map);
|
||||
@@ -276,6 +275,7 @@
|
||||
- argumentBuilder.executes(commandContext -> 0);
|
||||
+ // Paper start - fix suggestions due to falsely equal nodes
|
||||
+ // Always create a new instance
|
||||
+ //noinspection Convert2Lambda
|
||||
+ argumentBuilder.executes(new com.mojang.brigadier.Command<>() {
|
||||
+ @Override
|
||||
+ public int run(com.mojang.brigadier.context.CommandContext<SharedSuggestionProvider> commandContext) {
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
public static void resolveChatMessage(CommandContext<CommandSourceStack> context, String key, Consumer<PlayerChatMessage> callback) throws CommandSyntaxException {
|
||||
MessageArgument.Message message = context.getArgument(key, MessageArgument.Message.class);
|
||||
+ // Paper start
|
||||
+ // Paper start - brig message argument support
|
||||
+ resolveChatMessage(message, context, key, callback);
|
||||
+ }
|
||||
+ public static void resolveChatMessage(MessageArgument.Message message, CommandContext<CommandSourceStack> context, String key, Consumer<PlayerChatMessage> callback) throws CommandSyntaxException {
|
||||
+ // Paper end
|
||||
+ // Paper end - brig message argument support
|
||||
CommandSourceStack commandSourceStack = context.getSource();
|
||||
Component component = message.resolveComponent(commandSourceStack);
|
||||
CommandSigningContext signingContext = commandSourceStack.getSigningContext();
|
||||
|
||||
Reference in New Issue
Block a user