diff --git a/pom.xml b/pom.xml index 89bec74..693da39 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ net.knarcraft blacksmith - 1.0.4-SNAPSHOT + 1.0.5 Blacksmith Blacksmith NPC for the Citizens API diff --git a/src/main/java/net/knarcraft/blacksmith/BlacksmithPlugin.java b/src/main/java/net/knarcraft/blacksmith/BlacksmithPlugin.java index 1cd0986..efc06f1 100644 --- a/src/main/java/net/knarcraft/blacksmith/BlacksmithPlugin.java +++ b/src/main/java/net/knarcraft/blacksmith/BlacksmithPlugin.java @@ -109,9 +109,9 @@ public class BlacksmithPlugin extends JavaPlugin { //Copy default config to disk FileConfiguration fileConfiguration = this.getConfig(); + fileConfiguration.options().copyDefaults(true); this.saveDefaultConfig(); this.reloadConfig(); - fileConfiguration.options().copyDefaults(true); this.saveConfig(); //Load settings diff --git a/src/main/java/net/knarcraft/blacksmith/util/ConfigHelper.java b/src/main/java/net/knarcraft/blacksmith/util/ConfigHelper.java index 1cb81a8..28f1186 100644 --- a/src/main/java/net/knarcraft/blacksmith/util/ConfigHelper.java +++ b/src/main/java/net/knarcraft/blacksmith/util/ConfigHelper.java @@ -19,6 +19,9 @@ public final class ConfigHelper { * @return

The value as a string list, or null if not compatible

*/ public static List asStringList(Object value) { + if (value == null) { + return new ArrayList<>(); + } if (value instanceof String) { return List.of(((String) value).split(",")); } else if (value instanceof List list) {