You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For projects where you'll want everything stored in the same folder, but not root folder (like MC servers) it would be nice to be able to tell DynamicYAML to put everything in a specific folder (like "./plugins/PLUGIN") instead of needing to do @Config("./plugin/PLUGIN/config.yaml") every time.
Potential implementation I was thinking of is adding a default path value to DynamicYAML that is prepend to the path specified in @Config
Example Minecraft implementation (in Kotlin because I feel like it):
packagecom.thedeafcreeper.example_pluginimportorg.bukkit.plugin.java.JavaPluginclassExamplePlugin : JavaPlugin() {
overridefunonEnable() {
DynamicYAML.defaultPath = dataFolder.path // resolves to SERVERFOLDER/plugins/ExamplePlugin iirc// In Java this would be DynamicYAML.setDefaultPath("")val config =DefaultConfig().load()
// Loads from SERVERFOLDER/plugins/ExamplePlugin/config.yaml instead of SERVERFOLDER/config.yaml
logger.info(config.test)
}
overridefunonDisable() {
// Plugin shutdown logic
}
}
For projects where you'll want everything stored in the same folder, but not root folder (like MC servers) it would be nice to be able to tell DynamicYAML to put everything in a specific folder (like "./plugins/PLUGIN") instead of needing to do
@Config("./plugin/PLUGIN/config.yaml")
every time.Potential implementation I was thinking of is adding a default path value to
DynamicYAML
that is prepend to the path specified in@Config
Example Minecraft implementation (in Kotlin because I feel like it):
The text was updated successfully, but these errors were encountered: