Makes it possible to edit reforgeAbleItems globally #17
This commit is contained in:
@ -92,6 +92,11 @@ public class GlobalSettings {
|
||||
defaultNPCSettings.put(npcSetting, newValue);
|
||||
}
|
||||
save();
|
||||
if (npcSetting == NPCSetting.REFORGE_ABLE_ITEMS) {
|
||||
loadReforgeAbleItems();
|
||||
} else if (npcSetting == NPCSetting.ENCHANTMENT_BLOCKLIST) {
|
||||
loadEnchantmentBlocklist();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -482,9 +487,23 @@ public class GlobalSettings {
|
||||
defaultNPCSettings.put(setting, root.getRaw(setting.getPath()));
|
||||
}
|
||||
}
|
||||
loadReforgeAbleItems();
|
||||
loadEnchantmentBlocklist();
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads reforgeAble items from the current value
|
||||
*/
|
||||
private void loadReforgeAbleItems() {
|
||||
defaultReforgeAbleMaterials.clear();
|
||||
defaultReforgeAbleMaterials.addAll(NPCSettings.getReforgeAbleItems(ConfigHelper.asStringList(
|
||||
defaultNPCSettings.get(NPCSetting.REFORGE_ABLE_ITEMS))));
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the enchantment blocklist from the current value
|
||||
*/
|
||||
private void loadEnchantmentBlocklist() {
|
||||
defaultEnchantmentBlocklist.clear();
|
||||
defaultEnchantmentBlocklist.addAll(NPCSettings.getEnchantmentBlocklist(ConfigHelper.asStringList(
|
||||
defaultNPCSettings.get(NPCSetting.ENCHANTMENT_BLOCKLIST))));
|
||||
|
Reference in New Issue
Block a user