From 0fdc5eafbdb966c8b09f412433774dcfb0a578bb Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Wed, 17 Apr 2019 13:46:33 +1000 Subject: [PATCH] Allow single plot areas to load survival worlds --- .../intellectualsites/plotsquared/plot/PlotSquared.java | 2 +- .../plotsquared/plot/object/worlds/SinglePlotArea.java | 4 ++-- .../plot/object/worlds/SinglePlotAreaManager.java | 5 +---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java index e53b36042..3c15d437c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java @@ -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(); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java index 6a8782d1a..749829e9c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java @@ -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); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java index bb0be73ba..fd99fb067 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java @@ -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) {