Skip to content

Commit

Permalink
Retrieve normal message content for mod compatibility (#48)
Browse files Browse the repository at this point in the history
I discovered that `unsignedContent` was returning `null` on my
server, which causes mixins downstream (namely those used by
Chat Control by declipsonator) to throw NullPointerExceptions.

Using getContent() instead fixes this! This change allows seamless
integration with Chat Control and maybe other chat mods.

Co-authored-by: Variadicism <[email protected]>
  • Loading branch information
Variadicism and Variadicism authored Apr 5, 2024
1 parent 7d60f9d commit 49c8882
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public interface StyledChatSentMessage extends SentMessage, ExtendedSentMessage

record Chat(SignedMessage message, Text override, MessageType.Parameters parameters, RegistryKey<MessageType> sourceType, MutableObject<MessageType.Parameters> colorless) implements StyledChatSentMessage {
public Text content() {
return message.unsignedContent();
return message.getContent();
}

@Override
Expand Down Expand Up @@ -75,7 +75,7 @@ public StyledChatSentMessage reformat(MessageType.Parameters pars, RegistryKey<M

record System(SignedMessage message, Text override, MessageType.Parameters parameters, RegistryKey<MessageType> sourceType, MutableObject<MessageType.Parameters> colorless) implements StyledChatSentMessage {
public Text content() {
return this.message.unsignedContent();
return this.message.getContent();
}

@Override
Expand Down

0 comments on commit 49c8882

Please sign in to comment.