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