Fixed KeyPresetManager not correctly loading default values

This commit is contained in:
bigguy345 committed 2026-03-11 08:19:12 +02:00
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)