mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-24 11:38:26 +01:00
Fix an issue in Settings.
This commit is contained in:
parent
1ae9bf3a47
commit
06ba12c22e
@ -21,7 +21,7 @@ public class Settings {
|
|||||||
for (Setting setting : Setting.values()) {
|
for (Setting setting : Setting.values()) {
|
||||||
if (!root.keyExists(setting.path)) {
|
if (!root.keyExists(setting.path)) {
|
||||||
Messaging.logF("Writing default setting: '%s'", setting.path);
|
Messaging.logF("Writing default setting: '%s'", setting.path);
|
||||||
root.setRaw(setting.path, setting.value);
|
setting.set(root);
|
||||||
} else
|
} else
|
||||||
setting.load(root);
|
setting.load(root);
|
||||||
}
|
}
|
||||||
@ -52,7 +52,7 @@ public class Settings {
|
|||||||
DEFAULT_LOOK_CLOSE("npc.default.look-close", false),
|
DEFAULT_LOOK_CLOSE("npc.default.look-close", false),
|
||||||
DEFAULT_RANDOM_TALKER("npc.default.random-talker", true),
|
DEFAULT_RANDOM_TALKER("npc.default.random-talker", true),
|
||||||
DEFAULT_TALK_CLOSE("npc.default.talk-close", false),
|
DEFAULT_TALK_CLOSE("npc.default.talk-close", false),
|
||||||
DEFAULT_TEXT("npc.default.text.0", "Hi, I'm <npc>!") {
|
DEFAULT_TEXT("npc.default.text.0", Lists.newArrayList("Hi, I'm <npc>!")) {
|
||||||
@Override
|
@Override
|
||||||
public void load(DataKey root) {
|
public void load(DataKey root) {
|
||||||
List<String> list = new ArrayList<String>();
|
List<String> list = new ArrayList<String>();
|
||||||
@ -60,6 +60,11 @@ public class Settings {
|
|||||||
list.add(key.getString(""));
|
list.add(key.getString(""));
|
||||||
value = list;
|
value = list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void set(DataKey root) {
|
||||||
|
root.setString("npc.default.text.0", "Hi, I'm <npc>!");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
QUICK_SELECT("npc.selection.quick-select", false),
|
QUICK_SELECT("npc.selection.quick-select", false),
|
||||||
SELECTION_ITEM("npc.selection.item", "280"),
|
SELECTION_ITEM("npc.selection.item", "280"),
|
||||||
@ -104,8 +109,12 @@ public class Settings {
|
|||||||
return value.toString();
|
return value.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void set(DataKey root) {
|
||||||
|
root.setRaw(path, value);
|
||||||
|
}
|
||||||
|
|
||||||
protected void load(DataKey root) {
|
protected void load(DataKey root) {
|
||||||
this.value = root.getRaw(path);
|
value = root.getRaw(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user