-
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
Configuration API - Exposing internal values #3494
Comments
From memory the bungee API is lazy compared to the spigot one so the internal map isn't quite comparable. What specifically are you trying to achieve? |
My end goal is to have a map-based configuration API similar to bungee's, that works across all platforms. My current implementation looks like this, with an adapter for Bukkit and an adapter for bungee Looking at the code, I believe the implementation should return a mix of the |
I would not suggest to use this coding style. You mix configuration details (like path strings and default values) into every other part of your plugin. |
The objective of this system is to provide a consistent configuration experience in certain aspects across all platforms (Think of database configs). Platform-specific configs have their own unique paths and files |
Feature description
I am requesting a
getValues
method in the Configuration class. This method would return a defensive copy of the internal map.Goal of the feature
This method exists in Spigot's ConfigurationSection class, and is beneficial for multi-platform code, as well as configuration parsing in some cases.
Unfitting alternatives
The only other alternative is to get all the keys, iterate through them and call
Configuration#get
, which is more computationally expensive.Checking
The text was updated successfully, but these errors were encountered: