For the sake of ensuring compatibility across all future NMS code changes, I’ve eliminated the usage of NMS entirely and switched to internally calling the tellraw command.
Since the tellraw command was only added in 1.7.2, version support for prior Minecraft versions has been dropped, but it’s a small price to pay, considering how few servers still run at such old versions.
This version will convert these codes into their respective JSON settings without interfering with colors.
Apologies that this patch was so delayed. Admittedly, I do very little plugin development these days, and so I do rely on receiving messages from my library users if there’s a potential issue.
Anyone who's ever worked with Json Messages in Minecraft will know that a long time ago, Mojang's good work broke Json chat message colors when the client splits the message into a new line on their screen for longer messages.
It's about time I made an update to JsonMessage that removes chat color codes from the raw text, and utilizes the "color" attribute as Mojang wants.
However, fear not. The methods for creating colorized Json chat messages has not changed. Input the chat messages as you would for any normal messages and JsonMessage will take care of the rest for you! No more broken colors, ever!
Unfortunately 1.12 removed achievements. They're being fazed out by Mojang in favor of "Advancements". I'll add support for these again once Mojang figures out what it is they're doing.
I've also added a static utility command for sending raw json as a message to a player.
Someone did a benchmark with JsonMessage against Fanciful and reported that JsonMessage was more than 100% faster on average, though of course, messages are very diverse, so if anyone would like to assist in the determination of true average speed advantages, feel free. I'd appreciate it.
The previous update of this API utilized apache's StringEscapeUtils for escaping unescaped json strings inputted by the user.
The spigot hack is missing a lot of imports, including this one.
This current version uses the JsonObject class, which is available in the spigot hack's imports, and will therefore work for both.