mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-16 18:31:53 +01:00
Run the chat callback on the main thread as expected (#9935)
This commit is contained in:
parent
776cc1199a
commit
bbd013be54
1 changed files with 6 additions and 4 deletions
|
@ -1683,10 +1683,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- Component component = chatDecorator.decorate(source.getPlayer(), message.decoratedContent());
|
||||
- callback.accept(message.withUnsignedContent(component));
|
||||
+ // Paper start
|
||||
+ CompletableFuture<ChatDecorator.Result> componentFuture = chatDecorator.decorate(source.getPlayer(), source, message.decoratedContent());
|
||||
+ componentFuture.thenAcceptAsync((result) -> {
|
||||
+ callback.accept(message.withUnsignedContent(result.component()));
|
||||
+ }, source.getServer().chatExecutor);
|
||||
+ source.getChatMessageChainer().append(executor -> {
|
||||
+ CompletableFuture<ChatDecorator.Result> componentFuture = chatDecorator.decorate(source.getPlayer(), source, message.decoratedContent());
|
||||
+ return componentFuture.thenAcceptAsync((result) -> {
|
||||
+ callback.accept(message.withUnsignedContent(result.component()));
|
||||
+ }, executor);
|
||||
+ });
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue