Merge branch 'dev' into scrapper

This commit is contained in:
Kristian Knarvik 2023-11-12 19:41:06 +01:00
commit 1938a690c6
3 changed files with 5 additions and 2 deletions

View File

@ -6,7 +6,7 @@
<groupId>net.knarcraft</groupId> <groupId>net.knarcraft</groupId>
<artifactId>blacksmith</artifactId> <artifactId>blacksmith</artifactId>
<version>1.0.4-SNAPSHOT</version> <version>1.0.5</version>
<name>Blacksmith</name> <name>Blacksmith</name>
<description>Blacksmith NPC for the Citizens API</description> <description>Blacksmith NPC for the Citizens API</description>

View File

@ -109,9 +109,9 @@ public class BlacksmithPlugin extends JavaPlugin {
//Copy default config to disk //Copy default config to disk
FileConfiguration fileConfiguration = this.getConfig(); FileConfiguration fileConfiguration = this.getConfig();
fileConfiguration.options().copyDefaults(true);
this.saveDefaultConfig(); this.saveDefaultConfig();
this.reloadConfig(); this.reloadConfig();
fileConfiguration.options().copyDefaults(true);
this.saveConfig(); this.saveConfig();
//Load settings //Load settings

View File

@ -19,6 +19,9 @@ public final class ConfigHelper {
* @return <p>The value as a string list, or null if not compatible</p> * @return <p>The value as a string list, or null if not compatible</p>
*/ */
public static List<String> asStringList(Object value) { public static List<String> asStringList(Object value) {
if (value == null) {
return new ArrayList<>();
}
if (value instanceof String) { if (value instanceof String) {
return List.of(((String) value).split(",")); return List.of(((String) value).split(","));
} else if (value instanceof List<?> list) { } else if (value instanceof List<?> list) {