-
Notifications
You must be signed in to change notification settings - Fork 20
Native support for Adventure API Component #29
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
Comments
Hi, thanks for your suggestion! To get support for these additional serializers, you'll probably have to use a custom YamlConfigurationProperties properties = ConfigLib.PAPER_DEFAULT_PROPERTIES.toBuilder()
// ...further configure the builder...
.build();
// ...use builder to save/load configurations What do you think about this approach? Perhaps you have a different idea in mind?
Could you perhaps share the relevant parts of your code/config to give me an idea of how you currently do it? |
I think you should change the way that add support to a platform. Currently, we are using How about using this way to add specify support to a platform ConfigLib.newBuilder()
.addBundle(ConfigLibBundles.PAPER)
.addBundle(ConfigLibBundles.ADVENTURE_API)
I just make my own class that implements Serializer<Component, String>, nothing special |
odd question, do the deserialize and serialize progress only do once ? like when i want to get the Component, do ConfigLig call adventure api to deserialize it everytime i get the Component or it just return the cached one ? from what i have tested, that progress cost some performance if it just spam call it |
ConfigLib doesn't cache values. Only the serializers are "cached", i.e. the (recursive) decision which serializer to use for which field is only made once at the beginning when the Does this answer your question? |
yea, i understand it, im moving to use YamlConfigurationStore now then |
It would be beneficial for this library to include native support for commonly used Adventure API objects such as TextComponent, Sound, and Key.
In my experience, I've used this library in two different projects, and the first task I always undertake is copying the ComponentSerializer, SoundSerializer, and KeySerializer modules.
The Adventure API also provides support, some of which is even native on other platforms. It would be advantageous to integrate similar support into this library. You can find more information about Adventure API support on other platforms here: https://docs.advntr.dev/platform/native.html
The text was updated successfully, but these errors were encountered: