diff --git a/src/main/java/net/citizensnpcs/Settings.java b/src/main/java/net/citizensnpcs/Settings.java index 5028b384a..066f806c7 100644 --- a/src/main/java/net/citizensnpcs/Settings.java +++ b/src/main/java/net/citizensnpcs/Settings.java @@ -21,7 +21,7 @@ public class Settings { for (Setting setting : Setting.values()) { if (!root.keyExists(setting.path)) { Messaging.logF("Writing default setting: '%s'", setting.path); - root.setRaw(setting.path, setting.value); + setting.set(root); } else setting.load(root); } @@ -52,7 +52,7 @@ public class Settings { DEFAULT_LOOK_CLOSE("npc.default.look-close", false), DEFAULT_RANDOM_TALKER("npc.default.random-talker", true), DEFAULT_TALK_CLOSE("npc.default.talk-close", false), - DEFAULT_TEXT("npc.default.text.0", "Hi, I'm !") { + DEFAULT_TEXT("npc.default.text.0", Lists.newArrayList("Hi, I'm !")) { @Override public void load(DataKey root) { List list = new ArrayList(); @@ -60,6 +60,11 @@ public class Settings { list.add(key.getString("")); value = list; } + + @Override + public void set(DataKey root) { + root.setString("npc.default.text.0", "Hi, I'm !"); + } }, QUICK_SELECT("npc.selection.quick-select", false), SELECTION_ITEM("npc.selection.item", "280"), @@ -104,8 +109,12 @@ public class Settings { return value.toString(); } + protected void set(DataKey root) { + root.setRaw(path, value); + } + protected void load(DataKey root) { - this.value = root.getRaw(path); + value = root.getRaw(path); } } } \ No newline at end of file