mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Ensure world loading occurs on the main thread
This commit is contained in:
parent
ddfcc5b077
commit
7eb7cd9b53
@ -9,8 +9,10 @@ import com.intellectualcrafters.plot.object.Plot;
|
|||||||
import com.intellectualcrafters.plot.object.PlotId;
|
import com.intellectualcrafters.plot.object.PlotId;
|
||||||
import com.intellectualcrafters.plot.object.PlotLoc;
|
import com.intellectualcrafters.plot.object.PlotLoc;
|
||||||
import com.intellectualcrafters.plot.object.PlotSettings;
|
import com.intellectualcrafters.plot.object.PlotSettings;
|
||||||
|
import com.intellectualcrafters.plot.object.RunnableVal;
|
||||||
import com.intellectualcrafters.plot.object.SetupObject;
|
import com.intellectualcrafters.plot.object.SetupObject;
|
||||||
import com.intellectualcrafters.plot.util.SetupUtils;
|
import com.intellectualcrafters.plot.util.SetupUtils;
|
||||||
|
import com.intellectualcrafters.plot.util.TaskManager;
|
||||||
import com.intellectualcrafters.plot.util.WorldUtil;
|
import com.intellectualcrafters.plot.util.WorldUtil;
|
||||||
|
|
||||||
public class SinglePlotArea extends GridPlotWorld {
|
public class SinglePlotArea extends GridPlotWorld {
|
||||||
@ -30,17 +32,22 @@ public class SinglePlotArea extends GridPlotWorld {
|
|||||||
VOID = config.getBoolean("void", false);
|
VOID = config.getBoolean("void", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadWorld(PlotId id) {
|
public void loadWorld(final PlotId id) {
|
||||||
String worldName = id.toCommaSeparatedString();
|
TaskManager.IMP.sync(new RunnableVal<Object>() {
|
||||||
if (WorldUtil.IMP.isWorld(worldName)) return;
|
@Override
|
||||||
SetupObject setup = new SetupObject();
|
public void run(Object value) {
|
||||||
setup.plotManager = "PlotSquared:single";
|
String worldName = id.toCommaSeparatedString();
|
||||||
setup.setupGenerator = "PlotSquared:single";
|
if (WorldUtil.IMP.isWorld(worldName)) return;
|
||||||
setup.type = 0;
|
SetupObject setup = new SetupObject();
|
||||||
setup.terrain = 0;
|
setup.plotManager = "PlotSquared:single";
|
||||||
setup.step = new ConfigurationNode[0];
|
setup.setupGenerator = "PlotSquared:single";
|
||||||
setup.world = worldName;
|
setup.type = 0;
|
||||||
SetupUtils.manager.setupWorld(setup);
|
setup.terrain = 0;
|
||||||
|
setup.step = new ConfigurationNode[0];
|
||||||
|
setup.world = worldName;
|
||||||
|
SetupUtils.manager.setupWorld(setup);
|
||||||
|
}
|
||||||
|
});
|
||||||
// String worldName = plot.getWorldName();
|
// String worldName = plot.getWorldName();
|
||||||
// World world = Bukkit.getWorld(worldName);
|
// World world = Bukkit.getWorld(worldName);
|
||||||
// if (world != null) {
|
// if (world != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user