-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Separate component styling into a ComponentStyle class #3569
Conversation
Needs a way to parse a style. Also throwing out the idea that BaseComponent could extent ComponentStyle instead of having it as a field, but I don't have a preference for either at the moment. |
Yeah, I'll add a way to parse now
I disagree with this. I think composition vs inheritance decision making applies here. Component doesn't fit the bill for "is a style" but it does fit "has a style", so a field here makes the most sense imo despite the unfortunate need for repetition. |
I think we still need ComponentSerializer#parseStyle or something for use with scoreboards (and wherever else there is a style) |
Oh, yeah, for server internals. Will add that. My bad. |
It seems like this PR is done, probably can be merged? |
Thanks |
Fixes SpigotMC#3610 Relates to SpigotMC#3569 and 737d545
Fixes SpigotMC#3610 Relates to SpigotMC#3569 and 737d545
Fixes SpigotMC#3610 Relates to SpigotMC#3569 and 737d545
With the introduction of scoreboard number formats, specifically the
minecraft:styled
format, Mojang clearly makes a point that component styling can be independent from the contents of a text component. This PR separates all text styling fields into its ownComponentStyle
class with its own builder and addsBaseComponent#applyStyle(ComponentStyle)
andComponentBuilder#apply(ComponentStyle)
methods to apply these styles.ComponentStyle
instances are mutable but can be cloned or edited into a new instance withComponentStyle.builder(ComponentStyle)
.