clientcommands icon indicating copy to clipboard operation
clientcommands copied to clipboard

Add FormattedComponentArgument for /cwe

Open xpple opened this issue 2 years ago • 3 comments

I rewrote FormattedTextArgumentType. The previous implementation was too verbose and moreover not working as one might have expected it to. This new syntax is less error prone and probably more intuitive to work with. The availability of some text styles have been dropped, as firstly the previous implementation was incomplete and secondly because this argument type is meant to provide Formattinged text, not Styled text. Aside from what's available in the Formatting class, I did decide to add hex colour support through the # prefix with lenient hex parsing. Do note that Styled text is still available using the /ctellraw command.

xpple avatar Nov 13 '22 22:11 xpple

Hmm, could we leave in some of the old syntax as an alternative to the new syntax, so that those of us who haven't memorized formatting codes can still use it?

Earthcomputer avatar Nov 19 '22 18:11 Earthcomputer

I think that will get a bit confusing. What about making this into a separate class? Something like LegacyFormattedTextArgumentType. Then the /cnote command would just remain as is. My intentions for this class were to use this formatting syntax to be able to write formatted messages over C2C packets in a very compact and non distracting way. Being spammed with formatting suggestions all the time would get annoying if one just wanted to send a simple message.

xpple avatar Nov 20 '22 17:11 xpple