mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 17:47:32 +00:00
Fixed KeyPresetManager not correctly loading default values
This commit is contained in:
1 parent
cd0c9640af
commit
0db8844b4d
1 file changed
+8
-1
@@ -43,8 +43,15 @@ public class KeyPresetManager {
|
||||
try {
|
||||
File dir = getDir();
|
||||
File file = new File(dir, fileName + ".json");
|
||||
if (!file.exists())
|
||||
if (!file.exists()) {
|
||||
// First run: initialize all keys to their default states if not already set
|
||||
for (KeyPreset key : keys) {
|
||||
if (!key.defaultState.hasState()) {
|
||||
key.currentState.readFrom(key.defaultState);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
NBTTagCompound compound = NBTJsonUtil.LoadFile(file);
|
||||
for (KeyPreset key : keys)
|
||||
|
||||
Reference in new issue
Block a user