Currently, FairyChat doesnt seem to respect any ChatRenderer formatting, that other plugins might have applied before it reaches FairyChat, effectively circumventing the intended usecase of components entirely.
The plugin seems to just serialise the component before formatting, therefore losing all previous formatting or other component behaviour such as hover events or click events.
Example:
Suppose we have the following FairyChat chat format
chatFormat: <#5E548E><sender_displayname></#5E548E> <dark_gray>»</dark_gray> <message>
if another plugin wanted to highlight some keyword, add some hover text to part of the message or edit the message component in any way using the Paper ChatRenderer like such
@EventHandler(priority = EventPriority.LOW)
public void onChat(AsyncChatEvent event) {
// some logic
ChatRenderer renderer = event.renderer();
event.renderer((source, sourceDisplayName, message, viewer) -> {
Component modifiedMessage = modifyComponent(message);
return renderer.render(source, sourceDisplayName, modifiedMessage, viewer);
});
}
all of those changes unfortunately get thrown out the window by FairyChat.
Expected Behaviour:
I would expect FairyChat to keep the initial "message" component and have that be the <message> keyword in your config and only apply your own formatting onto that component instead of serialising the text and creating a new component.
This way you preserve all component behaviour and formatting.
if another plugin would modify a message to effectively look like this:
Hello this a <red>formatted<red> message
the result with the above mentioned chatFormat would be:
<#5E548E>Player</#5E548E> <dark_gray>»</dark_gray> Hello this a <red>formatted<red> message
if the word "formatted" were to for example be given some hover text as well, this should also be preserved
Currently, FairyChat doesnt seem to respect any ChatRenderer formatting, that other plugins might have applied before it reaches FairyChat, effectively circumventing the intended usecase of components entirely.
The plugin seems to just serialise the component before formatting, therefore losing all previous formatting or other component behaviour such as hover events or click events.
Example:
Suppose we have the following FairyChat chat format
if another plugin wanted to highlight some keyword, add some hover text to part of the message or edit the message component in any way using the Paper ChatRenderer like such
all of those changes unfortunately get thrown out the window by FairyChat.
Expected Behaviour:
I would expect FairyChat to keep the initial "message" component and have that be the
<message>keyword in your config and only apply your own formatting onto that component instead of serialising the text and creating a new component.This way you preserve all component behaviour and formatting.
if another plugin would modify a message to effectively look like this:
Hello this a <red>formatted<red> messagethe result with the above mentioned chatFormat would be:
<#5E548E>Player</#5E548E> <dark_gray>»</dark_gray> Hello this a <red>formatted<red> messageif the word "formatted" were to for example be given some hover text as well, this should also be preserved