jaqobb / message-editor

Spigot plugin that allows editing in-game messages that were previously unmodifiable
MIT License
13 stars 2 forks source link

BetonQuest Plugin incompatibility #9

Closed Maitlans closed 3 years ago

Maitlans commented 3 years ago

When in a BetonQuest conversation messages aren't being sent, this can be tested pretty easily. Installing BetonQuest and Citizens2 NPCs, then you go to the BetonQuest folder and go to default > main and edit '0': innkeeper and replace "0" with your Citizens2 NPC ID, reload and right click on the NPC no messages appear, if you remove Message-Editor then it'll work.

The BetonQuest developer provided some info on helping fix this:

Maitlan Today at 4:33 PM
It works when the plugin MessageEditor is removed yes

SaltySanta Today at 4:34 PM
Ok then they remove some information from our messages and our "hide normal chat during conversations" feature breaks.
Try setting this to none: https://betonquest.github.io/BetonQuest/DEV/User-Documentation/Conversations/?h=+chat+inter#chat-interceptors

Maitlan Today at 4:42 PM
Hey thanks it seems to work now, what's the difference between none and whatever was default set?
Ah yeah but it shows the messages in chat and it doesn't bring them back later when done.

Wolf2324 | Gabriel Today at 4:44 PM
The default one is on ProtocolLib base and is more robust. With the default one we add a invisible Tag to the message and the other plugin remove it. So we can not detect it anymore.

Maitlan Today at 4:45 PM
Anything direct that I can report to him that would help him fix this compatibility?

Wolf2324 | Gabriel Today at 4:51 PM
They should not remove stuff, that they to not know about.
You can give them this peace, that is the tag, that we add to each message at the beginning: §5§f§6§2§7§1§5§f

Maitlan Today at 4:52 PM
Thanks! I appreciate the help.

Wolf2324 | Gabriel Today at 4:53 PM
No problem

Hope to see this fixed, keep up the awesome work, I like the most recent GUI update :D Let me know if any extra information is needed!

jaqobb commented 3 years ago

I did some testing and it does not look like Message Editor removes anything from the BetonQuest plugin messages (especially the invisible tag). However I suspect that the root cause of the issue is deserializing and reserializing the message. My guess is that the reserialized message gets its JSON changed in a way that makes the BetonQuest plugin unable to recognize the message as the one that should be sent to the player.

I will keep investigating this issue for a potential fix.

Is there any way for you to provide me the original JSON of the message with the invisible tag applied so I can check what is the difference between the JSONs? (No longer required.)

jaqobb commented 3 years ago

Quick update: I believe the root cause of this issue was indeed the way how messages with multiple components are deserialized. I am pretty sure this has been fixed and the new version should be uploaded later today (12/28/2020).

Feel free to test the new version to see if it fixed your issue:

message-editor.zip

Maitlans commented 3 years ago

Hey this fixes the problem! Thank you so much, I appreciate the bug fix :D