GeorgH93 / MarriageMaster

Marriage Plugin for Bukkit/Spigot
https://www.spigotmc.org/resources/marriage-master.19273/
GNU General Public License v3.0
113 stars 90 forks source link

Legacy code to supress info #254

Closed Threshian closed 2 years ago

Threshian commented 2 years ago

Help request

Problem

Hi, I have this error that fail to load the language file on start and every time i reload the plugin. Even after fixing the error it show on the console, the error come back after on reload. https://pastebin.com/G5LC2Ada **What I have tried** I fixed this error : [{"text":"Ton partenaire t''a envoyé ","color":"green"},{"text":"hoverEvent":{"action":"show_text","value":"{DisplayName}"}},{"text":"{ItemAmount} {ItemName}","hoverEvent":{"action":"show_item","value":"{ItemMetaJSON}"}},{"text":"."}] To this : [{"text":"Ton partenaire t''a envoyé ","color":"green"},{"text":"hoverEvent","action":"show_text","value":"{DisplayName}"},{"text":"{ItemAmount} {ItemName}","hoverEvent":{"action":"show_item","value":"{ItemMetaJSON}"}},{"text":"."}]
GeorgH93 commented 2 years ago

Could you please share the full content of line 59 from your language file with me.

Threshian commented 2 years ago

ItemReceived: "[{"text":"Ton partenaire t''a envoyé ","color":"green"},{"text":"hoverEvent","action":"show_text","value":"{DisplayName}"},{"text":"{ItemAmount} {ItemName}","hoverEvent":{"action":"show_item","value":"{ItemMetaJSON}"}},{"text":"."}]"

GeorgH93 commented 2 years ago

Please replace the " at the start and end of the message with ', like this:

ItemReceived: '[{"text":"Ton partenaire t''a envoyé ","color":"green"},{"text":"hoverEvent","action":"show_text","value":"{DisplayName}"},{"text":"{ItemAmount} {ItemName}","hoverEvent":{"action":"show_item","value":"{ItemMetaJSON}"}},{"text":"."}]'

If you use " for the yml string you have to escape every " inside of your json with by putting a \ before it, like this:

ItemReceived: "[{\"text\":\"Ton partenaire t'a envoyé \",\"color\":\"green\"},{\"text\":\"hoverEvent\",\"action\":\"show_text\",\"value\":\"{DisplayName}\"},{\"text\":\"{ItemAmount} {ItemName}\",\"hoverEvent\":{\"action\":\"show_item\",\"value\":\"{ItemMetaJSON}\"}},{\"text\":\".\"}]"

which is tedious and error prone and I would not recommend doing it by hand.

Threshian commented 2 years ago

Thank you, that worked i don't have error anymore :D