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>
<artifactId>blacksmith</artifactId>
<version>1.0.4-SNAPSHOT</version>
<version>1.0.5</version>
<name>Blacksmith</name>
<description>Blacksmith NPC for the Citizens API</description>

View File

@ -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

View File

@ -19,6 +19,9 @@ public final class ConfigHelper {
* @return <p>The value as a string list, or null if not compatible</p>
*/
public static List<String> 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) {