Giter VIP home page Giter VIP logo

Comments (2)

Exlll avatar Exlll commented on June 18, 2024

Hi, thanks for your suggestion!

To get support for these additional serializers, you'll probably have to use a custom ConfigurationProperties object (similar to what you already have to do currently to get support for Bukkit's ConfigurationSerializable), i.e.:

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?

I've used this library in two different projects, and the first task I always undertake is copying the ComponentSerializer, SoundSerializer, and KeySerializer modules.

Could you perhaps share the relevant parts of your code/config to give me an idea of how you currently do it?

from configlib.

zvyap avatar zvyap commented on June 18, 2024

Hi, thanks for your suggestion!

To get support for these additional serializers, you'll probably have to use a custom ConfigurationProperties object (similar to what you already have to do currently to get support for Bukkit's ConfigurationSerializable), i.e.:

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?

I think you should change the way that add support to a platform. Currently, we are using ConfigLib.PAPER_DEFAULT_PROPERTIES to add support to paper/bukkit stuff, but Adventure API is supported in various platform.

How about using this way to add specify support to a platform

ConfigLib.newBuilder()
      .addBundle(ConfigLibBundles.PAPER)
      .addBundle(ConfigLibBundles.ADVENTURE_API)

I've used this library in two different projects, and the first task I always undertake is copying the ComponentSerializer, SoundSerializer, and KeySerializer modules.

Could you perhaps share your the relevant parts of your code/config do give me an idea of how you currently do it?

I just make my own class that implements Serializer<Component, String>, nothing special
For sound, I deserialize string format "<sound_id>:[pitch]:[volume]:[source]"
For component, I just deserialize String with https://docs.advntr.dev/serializer/index.html.
For Key, just deserialize string to Key object, nothing special.

from configlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.