13
0
geforkt von Mirrors/Paper

fix mapping issue in PlayerChatMessage

Dieser Commit ist enthalten in:
Lulu13022002 2024-12-16 00:40:25 +01:00
Ursprung 9dd321396f
Commit 1af7f42af5
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 491C8F0B8ACDEB01

Datei anzeigen

@ -51,10 +51,10 @@
- Component component = !message.equals(Component.literal(this.signedContent())) ? message : null;
+ // Paper start - adventure
+ final Component component;
+ if (unsignedContent instanceof io.papermc.paper.adventure.AdventureComponent advComponent) {
+ component = this.signedContent().equals(io.papermc.paper.adventure.AdventureCodecs.tryCollapseToString(advComponent.adventure$component())) ? null : unsignedContent;
+ if (message instanceof io.papermc.paper.adventure.AdventureComponent advComponent) {
+ component = this.signedContent().equals(io.papermc.paper.adventure.AdventureCodecs.tryCollapseToString(advComponent.adventure$component())) ? null : message;
+ } else {
+ component = !unsignedContent.equals(Component.literal(this.signedContent())) ? unsignedContent : null;
+ component = !message.equals(Component.literal(this.signedContent())) ? message : null;
+ }
+ // Paper end - adventure
return new PlayerChatMessage(this.link, this.signature, this.signedBody, component, this.filterMask);