Player config storage : only load if file exists
This commit is contained in:
parent
c02763beea
commit
9818bca757
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user