Fixed key storage access in KeyStorage.java
Fix the retrieval and saving of keys by updating the path format used in config.getInt and config.set methods.
This commit is contained in:
@@ -54,7 +54,7 @@ public class KeyStorage extends AbstractConfig {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (UUID uuid : uuids) {
|
for (UUID uuid : uuids) {
|
||||||
int keys = config.getInt(prefix, String.format("%s.%s", crate, uuid.toString()), 0);
|
int keys = config.getInt(prefix + crate + ".", uuid.toString(), 0);
|
||||||
count.put(uuid, keys);
|
count.put(uuid, keys);
|
||||||
}
|
}
|
||||||
KEYS.put(crate, count);
|
KEYS.put(crate, count);
|
||||||
@@ -65,7 +65,7 @@ public class KeyStorage extends AbstractConfig {
|
|||||||
config.logger.info("Saving KeyStorage");
|
config.logger.info("Saving KeyStorage");
|
||||||
KEYS.keySet()
|
KEYS.keySet()
|
||||||
.forEach(crate -> KEYS.get(crate)
|
.forEach(crate -> KEYS.get(crate)
|
||||||
.forEach((uuid, keys) -> config.set(prefix + crate, uuid.toString(), keys)));
|
.forEach((uuid, keys) -> config.set(prefix + crate + ".", uuid.toString(), keys)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user