Greetings, n00b incoming
I just wanted to start with a simple plugin, using a coonfig file. So I’ve created a plugin, running without errors,
read the documentations, added
@Inject @DefaultConfig(sharedRoot = false) private Path configDir;
and stumbled over this error:
1) No implementation for java.nio.file.Path annotated with org.spongepowered.api.service.config.DefaultConfig(sharedRoot=false) was bound. while locating java.nio.file.Path annotated with @org.spongepowered.api.service.config.DefaultConfig(sharedRoot=false) for field at ...Plugin.configDir(BoosentialsPlugin.java:31) at org.spongepowered.common.guice.SpongePluginGuiceModule.configure(SpongePluginGuiceModule.java:63)
Found a similar topic without a helpful answer
Once a bukkit developer, I’m quite new to this injection-stuff. My thought was, that this injection would simply create a Path that I could use in my config initialization routine.
I’ve also used this in my GamePreInitializationEvent:
Path potentialFile = getConfigDir(); ConfigurationLoader<CommentedConfigurationNode> loader = HoconConfigurationLoader.builder().setFile(potentialFile.toFile()).build(); ConfigurationNode rootNode = loader.createEmptyNode(ConfigurationOptions.defaults());
but I guesss that wasn’t the required implementation.
So, what am I missing?
Thanks in advance