diff --git a/src/main/java/net/knarcraft/blacksmith/config/GlobalSettings.java b/src/main/java/net/knarcraft/blacksmith/config/GlobalSettings.java index 00eef5d..b0b4223 100644 --- a/src/main/java/net/knarcraft/blacksmith/config/GlobalSettings.java +++ b/src/main/java/net/knarcraft/blacksmith/config/GlobalSettings.java @@ -85,7 +85,8 @@ public class GlobalSettings { * @param newValue

The new value for the setting

*/ public void changeValue(NPCSetting npcSetting, Object newValue) { - if (npcSetting.getValueType() == SettingValueType.STRING_LIST) { + if (npcSetting.getValueType() == SettingValueType.STRING_LIST || + npcSetting.getValueType() == SettingValueType.REFORGE_ABLE_ITEMS) { //Workaround to make sure it's treated as the correct type defaultNPCSettings.put(npcSetting, newValue == null ? null : ConfigHelper.asStringList(newValue)); } else { diff --git a/src/main/java/net/knarcraft/blacksmith/config/NPCSettings.java b/src/main/java/net/knarcraft/blacksmith/config/NPCSettings.java index 2361f21..c42a701 100644 --- a/src/main/java/net/knarcraft/blacksmith/config/NPCSettings.java +++ b/src/main/java/net/knarcraft/blacksmith/config/NPCSettings.java @@ -68,7 +68,8 @@ public class NPCSettings { * @param newValue

The new value of the setting

*/ public void changeSetting(NPCSetting setting, Object newValue) { - if (setting.getValueType() == SettingValueType.STRING_LIST) { + if (setting.getValueType() == SettingValueType.STRING_LIST || + setting.getValueType() == SettingValueType.REFORGE_ABLE_ITEMS) { //Workaround to make sure it's treated as the correct type currentValues.put(setting, newValue == null ? null : ConfigHelper.asStringList(newValue)); } else { @@ -371,8 +372,11 @@ public class NPCSettings { * @return

The value with placeholders replaced

*/ private static List replaceReforgeAblePresets(List stringList) { - List newStrings = new ArrayList<>(stringList); + List newStrings = new ArrayList<>(); for (String item : stringList) { + if (item == null) { + continue; + } String replaced = SmithPreset.replacePreset(item); if (!replaced.equals(item)) { newStrings.addAll(List.of(replaced.split(","))); diff --git a/src/main/java/net/knarcraft/blacksmith/config/SmithPreset.java b/src/main/java/net/knarcraft/blacksmith/config/SmithPreset.java index 22b4ea9..3bf4e61 100644 --- a/src/main/java/net/knarcraft/blacksmith/config/SmithPreset.java +++ b/src/main/java/net/knarcraft/blacksmith/config/SmithPreset.java @@ -94,7 +94,8 @@ public enum SmithPreset { negated = true; } - if ((negated && !upperCasedPreset.startsWith("_PRESET:")) && !upperCasedPreset.startsWith("PRESET:")) { + if ((negated && !upperCasedPreset.startsWith("_PRESET:")) || + (!negated && !upperCasedPreset.startsWith("PRESET:"))) { return possiblePreset; }