Skip to content

Commit

Permalink
Fix command block async message (again) (#10082)
Browse files Browse the repository at this point in the history
  • Loading branch information
Machine-Maker authored Dec 27, 2023
1 parent dc62150 commit 0d6a0c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions patches/server/0010-Adventure.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2112,7 +2112,7 @@ index db93483cfee13ca4303d7452ecbb47507dc5f89e..b836a85ce3a4374e94061fe9368e86a6
public CommandSourceStack(CommandSource output, Vec3 pos, Vec2 rot, ServerLevel world, int level, String name, Component displayName, MinecraftServer server, @Nullable Entity entity) {
this(output, pos, rot, world, level, name, displayName, server, entity, false, CommandResultCallback.EMPTY, EntityAnchorArgument.Anchor.FEET, CommandSigningContext.ANONYMOUS, TaskChainer.immediate(server));
diff --git a/src/main/java/net/minecraft/commands/arguments/MessageArgument.java b/src/main/java/net/minecraft/commands/arguments/MessageArgument.java
index 979ea69678319338c543185ba026ad0699a388d6..03bdc7531fad9a69a86f2afd4a4ebe195d892dd5 100644
index 979ea69678319338c543185ba026ad0699a388d6..34ed1f92328ee8826b58dfaf239a96b6ee196ca3 100644
--- a/src/main/java/net/minecraft/commands/arguments/MessageArgument.java
+++ b/src/main/java/net/minecraft/commands/arguments/MessageArgument.java
@@ -51,17 +51,21 @@ public class MessageArgument implements SignedArgument<MessageArgument.Message>
Expand All @@ -2137,7 +2137,7 @@ index 979ea69678319338c543185ba026ad0699a388d6..03bdc7531fad9a69a86f2afd4a4ebe19
- callback.accept(message.withUnsignedContent(component));
+ // Paper start
+ CompletableFuture<ChatDecorator.Result> componentFuture = chatDecorator.decorate(source.getPlayer(), source, message.decoratedContent());
+ source.getChatMessageChainer().append(() -> componentFuture.thenAccept((result) -> callback.accept(message.withUnsignedContent(result.component()))));
+ source.getChatMessageChainer().append(componentFuture, (result) -> callback.accept(message.withUnsignedContent(result.component())));
+ // Paper end
}

Expand Down

0 comments on commit 0d6a0c3

Please sign in to comment.