Player config storage : only load if file exists

This commit is contained in:
Marc Baloup 2022-12-15 13:23:43 +01:00
parent c02763beea
commit 9818bca757

View File

@ -51,10 +51,12 @@ public class PaperPlayerConfigStorage {
private static synchronized void load() throws IOException, InvalidConfigurationException { private static synchronized void load() throws IOException, InvalidConfigurationException {
YamlConfiguration config = new YamlConfiguration(); YamlConfiguration config = new YamlConfiguration();
config.load(storageFile);
data.clear(); data.clear();
playerSortedData.clear(); playerSortedData.clear();
keySortedData.clear(); keySortedData.clear();
if (!storageFile.exists())
return;
config.load(storageFile);
for (String pIdStr : config.getKeys(false)) { for (String pIdStr : config.getKeys(false)) {
UUID pId; UUID pId;
try { try {