MessageChannelEvent.Chat#getRawMessage().toPlain() returns String with no spaces?

Hello, in a recent plugin I was listening to the MessageChannelEvent.Chat event and wanted to get the String content of the message. in order to do that, I called MessageChannelEvent.Chat#getRawMessage().toPlain(). The string returned had no spaces. So if I were to type, “Hey how are you” ingame, the String returned would be “Heyhowareyou”. Is this intentional or a bug/sideeffect? Also is there a way to get the content with spaces?

From what the javadoc describes it should literally return the “raw” chat message as typed into the chat box.

@TheKraken7
Are there any other chat plugins currently running whilst testing this?

Nope, I’m running SpongeForge and the only things on the server are forge and the plugin I’m testing with @varrix

Definitely sounds like a bug or unclear Javadocs.

Submit an issue on GitHub. If it’s a bug it needs to be fixed, if it’s not, the Javadoc needs to be cleared up and a method to retrieve the “real” raw message with spaces is needed.

Works for me: long-messages/LongMessages.kt at 2672cb03ffc1adbb9959f75dc5698bb4a62dc788 · randombyte-developer/long-messages · GitHub

Issue has been resolved, thank you guys.

@TheKraken7 How did you fix it? what was your issue?

Other people may find this page while searching later, only to be frustrated.

It was a subtle mistake on my end. I wasn’t able to identify it until I looked over the code the day after. There was no issue with the API. I was porting a Bukkit plugin to Sponge, and a small piece of the code got overlooked.