Allow single plot areas to load survival worlds

This commit is contained in:
Jesse Boyd 2019-04-17 13:46:33 +10:00
parent 59f89980a3
commit 0fdc5eafbd
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
3 changed files with 4 additions and 7 deletions

View File

@ -1390,7 +1390,7 @@ import java.util.zip.ZipInputStream;
ConfigurationSection section =
this.worlds.getConfigurationSection("worlds." + world);
plotworld.saveConfiguration(section);
plotworld.loadConfiguration(section);
plotworld.loadDefaultConfiguration(section);
this.worlds.save(this.worldsFile);
} catch (IOException e) {
e.printStackTrace();

View File

@ -36,8 +36,8 @@ public class SinglePlotArea extends GridPlotWorld {
SetupObject setup = new SetupObject();
setup.plotManager = "PlotSquared:single";
setup.setupGenerator = "PlotSquared:single";
setup.type = 0;
setup.terrain = 0;
setup.type = TYPE;
setup.terrain = TERRAIN;
setup.step = new ConfigurationNode[0];
setup.world = worldName;
SetupUtils.manager.setupWorld(setup);

View File

@ -69,13 +69,10 @@ public class SinglePlotAreaManager extends DefaultPlotAreaManager {
}
@Override public PlotArea getApplicablePlotArea(Location location) {
PlotArea found = super.getApplicablePlotArea(location);
if (found != null)
return found;
String world = location.getWorld();
return isWorld(world) || world.equals("*") || super.getAllPlotAreas().length == 0 ?
area :
null;
super.getApplicablePlotArea(location);
}
@Override public PlotArea getPlotArea(String world, String id) {