- [Install](#Install Package)
- [Install](#Install Package)
- [Example Config](#Example Config)
Add code below to your pom.xml file
<dependency>
<groupId>de.nichti</groupId>
<artifactId>spigotconfigmanager</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>Than run the command below via your command line
nvm install
Create a new class and extend ConfigManager. As example ExampleConfig.java
public class ExampleConfig extends ConfigManager {
public ExampleConfig(String pluginName) {
super(pluginName);
}
}Then you can create a new Instance of your created class. I would recommend to make it static.
public static ExampleConfig config = new ExampleConfig("pluginName");import de.nichti.spigotconfigmanager.ConfigManager;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
public class ExampleConfig extends ConfigManager {
public ExampleConfig(String pluginName) {
super(pluginName);
defaultConfig();
}
private void defaultConfig(){
FileConfiguration config = new YamlConfiguration();
config.set("Test1", "Test");
config.set("Test2", 1);
config.set("Test3", 1.5);
registerDefaultConfig(config); //register new defaultConfig
if(saveDefaultConfig()){
//do stuff
}
}
}