-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecation of MinecraftFormattingConverter #18
Comments
minecrell is alive! 😱 Keep tryna reply to this but I can't quite convey what I wanna say all too well, Basically, I can understand wanting to get rid of the MC specific stuff, especially when we have divergence with stuff like spigots weird format, ontop of the fact that other platforms generally don't really have any representation of the chat outside of a legacy format we're all tryna convince people to get away from, especially as it's missing a good chunk of the feature set people have come to love I think having a logger which can deal with adventure would be great, for one, it's adventure, for two, as much as it's tied to MC, it's doesn't seem unusable outside of MC, at least for a lot of typical stuff like text formatting, which is a horror when tryna deal with ansi outside, i'd much prefer to leave that mess to somebody who's not me rather than having to determine in my own apps if ansi is available, what features I can use, etc |
There is no need to put that code into |
Yea, I was somewhat for adventure support in TCA given that it would be a nice base, but, now that you mention it, it being done over in the adventure side of stuff itself seems a lot more ideal. imho, having a text format capable of representing colors and formatting and such without having to dig into ansi and determining support, etc, does sound like a cool wider goal, it would just be somewhat weird given that adventure is designed for an environment that supports much more |
I've done some work on this, but haven't had a chance to finish implementing it. There are some pieces out there so far:
|
Just an update on this front -- Mojang has been moving Minecraft to use SLF4J for its logging API, so logging components directly is a bit more complicated. The approach I've chosen with Adventure is to implement a Unfortunately not much progress on the other elements of the strategy, but this at least shifts those to an implementation detail, so the end-user API can remain consistent while the way components are converted into ansi control sequences is evolved over time. |
TerminalConsoleAppender was never meant to be Minecraft-specific. It works just fine for other uses as well. The only Minecraft-specific code that it contains is the
MinecraftFormattingConverter
that is used to translate legacy color codes (§c
etc) to ANSI color codes. I put that here because that was convenient back then when I needed the same code on multiple platforms.But now legacy formatting codes have been deprecated for a long time, and there is no standard representation of newer features like RGB colors anymore. At this point, it seems easier if the projects that need it (and perhaps even want modern features like RGB support) make a copy of
MinecraftFormattingConverter
and change it to their needs. For example, Paper has made such a copy in PaperMC/Paper#5205.As additional inspiration in case someone wants to implement this properly I will briefly describe a completely other, but potentially much cleaner approach that avoids legacy color codes entirely. I never found time to implement it, but I think it should work.
Something like this could be implemented once for a chat component API like adventure and then shared between projects that make use of adventure.
@zml2008 I believe we discussed this at some point? Did you ever finish implementing it? (I hope it was you, can't remember exactly and also can't find the chat log anymore. :D)
The text was updated successfully, but these errors were encountered: