ArcanePlugins / Treasury

🏦 A powerful multi-platform library for next-level plugin integrations.
https://hangar.papermc.io/ArcanePlugins/Treasury
Other
56 stars 13 forks source link

fix colored message sending in console in bukkit #213

Closed MrIvanPlays closed 1 year ago

MrIvanPlays commented 1 year ago

perhaps 1.19 broke this but just to make sure im fixing it for all the versions makes this parse properly: img

Jikoo commented 1 year ago

A Paper inconsistency, not 1.19. I think they broke loggers supporting color in their Adventure update, then never added it back in. LGTM 👍

MrIvanPlays commented 1 year ago

Colors work but only from the console sender and not from the logger for some weird reason but yeah. In that case i might make that fix apply only for paper but lokka30 has to say whether this is a viable solution or not.

yannicklamprecht commented 1 year ago

A Paper inconsistency, not 1.19. I think they broke loggers supporting color in their Adventure update, then never added it back in. LGTM 👍

That was done intentionally. https://github.com/PaperMC/Paper/issues/7596#issuecomment-1073307545

MrIvanPlays commented 1 year ago

So you want us to use components? For what when you're gonna send the message to the logger over legacy text? That's just more parsing being done.

yannicklamprecht commented 1 year ago

So you want us to use components? For what when you're gonna send the message to the logger over legacy text? That's just more parsing being done.

Nope, just strip color. The logger intentionally does not interpret colors. You either use the console sender to allow writing legacy colors or just strip the colors.

lokka30 commented 1 year ago

I believe it is best that we use the Bukkit logger normally (colorized) on Spigot servers, whilst on Paper-based servers, the overridden log method can parse the input into an Adventure component and then output that.

If we prefer the way this PR has implemented it, note that we will need to also put the "&e[WARN] [Treasury]" part inside the colorize method call.

I am on the fence whether I agree with Paper's change for colored logging: yes, I see how loggers should directly output what they were given, however this change has broken plugins and may have been better implemented via an opt-in by individual plugins who desire raw logging. Anyhow, I'll save my ramble since the change has been made and it is off-topic.