mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-15 04:41:25 +01:00
fix mapping issue in PlayerChatMessage
This commit is contained in:
parent
9dd321396f
commit
1af7f42af5
@ -51,10 +51,10 @@
|
|||||||
- Component component = !message.equals(Component.literal(this.signedContent())) ? message : null;
|
- Component component = !message.equals(Component.literal(this.signedContent())) ? message : null;
|
||||||
+ // Paper start - adventure
|
+ // Paper start - adventure
|
||||||
+ final Component component;
|
+ final Component component;
|
||||||
+ if (unsignedContent instanceof io.papermc.paper.adventure.AdventureComponent advComponent) {
|
+ if (message instanceof io.papermc.paper.adventure.AdventureComponent advComponent) {
|
||||||
+ component = this.signedContent().equals(io.papermc.paper.adventure.AdventureCodecs.tryCollapseToString(advComponent.adventure$component())) ? null : unsignedContent;
|
+ component = this.signedContent().equals(io.papermc.paper.adventure.AdventureCodecs.tryCollapseToString(advComponent.adventure$component())) ? null : message;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ component = !unsignedContent.equals(Component.literal(this.signedContent())) ? unsignedContent : null;
|
+ component = !message.equals(Component.literal(this.signedContent())) ? message : null;
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end - adventure
|
+ // Paper end - adventure
|
||||||
return new PlayerChatMessage(this.link, this.signature, this.signedBody, component, this.filterMask);
|
return new PlayerChatMessage(this.link, this.signature, this.signedBody, component, this.filterMask);
|
||||||
|
Loading…
Reference in New Issue
Block a user