A while ago I made this single class file API for sending JSON chat messages to replace the entire fanciful library.
Why did I do this? Because the fanciful library is massive and contains too many classes and far too many unnecessary methods that it requires its user utilize in order to style their messages. It makes for an unnecessarily verbose block of code just to send a nice message.
Same with Spigot's built in stuff. Far too many class names to memorize and steps involved in sending a message.
With mine:
I recently gave it a long overdue update. Currently only available at that gist I've just linked.
The whole point was to make it easier to use, and I feel I've succeeded at that. However, I'm thinking it's probably faster than the fanciful library as well.
If anyone would like to give both libraries a shot. Take some benchmarks for short or long, simple or complex messages, please do and let me know the results.
I would but... My dedication to not using the fanciful library is beyond reason or negotiation it seems.
Why did I do this? Because the fanciful library is massive and contains too many classes and far too many unnecessary methods that it requires its user utilize in order to style their messages. It makes for an unnecessarily verbose block of code just to send a nice message.
Same with Spigot's built in stuff. Far too many class names to memorize and steps involved in sending a message.
With mine:
Code:
new JsonMessage().append(ChatColor.RED + "Hey there! " + ChatColor.BLUE + "I actually support chat colors without needing you to append a whole new string and use any special .color() or .stylize() methods!").setHoverAsTooltip("Line1", "Line2", ChatColor.RED + "Simple!").setClickAsExecuteCmd("/fly").save().send(player);
I recently gave it a long overdue update. Currently only available at that gist I've just linked.
The whole point was to make it easier to use, and I feel I've succeeded at that. However, I'm thinking it's probably faster than the fanciful library as well.
If anyone would like to give both libraries a shot. Take some benchmarks for short or long, simple or complex messages, please do and let me know the results.
I would but... My dedication to not using the fanciful library is beyond reason or negotiation it seems.
