Fixed lag caused by WorldAliasSettings.addWorld #493

This commit is contained in:
Rsl1122 2018-01-25 16:04:40 +02:00
parent cefe17ead8
commit 7faa619ae3

View File

@ -4,6 +4,7 @@
*/
package com.djrapitops.plan.system.settings;
import com.djrapitops.plan.system.processing.Processor;
import com.djrapitops.plan.system.settings.config.ConfigSystem;
import com.djrapitops.plugin.api.config.Config;
import com.djrapitops.plugin.api.config.ConfigNode;
@ -54,11 +55,13 @@ public class WorldAliasSettings {
String previousValue = aliasSect.getConfigNode(world).getValue();
if (Verify.isEmpty(previousValue)) {
aliasSect.set(world, world);
}
try {
aliasSect.save();
} catch (IOException e) {
Log.toLog(this.getClass().getName(), e);
Processor.queue(() -> {
try {
aliasSect.save();
} catch (IOException e) {
Log.toLog(this.getClass().getName(), e);
}
});
}
}