KyoriPowered / adventure

A user-interface library, formerly known as text, for Minecraft: Java Edition
https://docs.advntr.dev/
MIT License
682 stars 106 forks source link

feature: json component serializer #856

Closed kezz closed 1 year ago

kezz commented 1 year ago

This PR adds a new module providing an implementation agnostic JSON serializer. The intention behind this PR is to allow platforms to swap between or use alternative implementations of a json serializer (see #839) whilst still allowing consumers of the platform to work regardless of the backing impl.

work that needs doing:

zml2008 commented 1 year ago

I think it's worthwhile to port the LegacyHoverEventSerializer and text-serializer-gson-legacy-impl over to JsonComponentSerializer -- it doesn't have any direct gson deps.

With options, I think it's worthwhile to have a common builder interface exposed as well -- since there are a few configurable elements.

I'm not sure what your goals were with the Fallback interface were -- I don't see it having any practical effect since you already orElse to the fallback without needing service discovery.