diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/SQLManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/SQLManager.java index d72909fd9..9f104429d 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/SQLManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/SQLManager.java @@ -106,24 +106,6 @@ public class SQLManager implements AbstractDB { } - // - // public void setTimout() { - // TaskManager.runTask(new Runnable() { - // @Override - // public void run() { - // try { - // final PreparedStatement statement = - // connection.prepareStatement("SET GLOBAL wait_timeout =28800;"); - // statement.executeQuery(); - // statement.close(); - // } catch (final SQLException e) { - // e.printStackTrace(); - // PlotMain.sendConsoleSenderMessage("&c[ERROR] "+"Could not reset MySQL timout."); - // } - // } - // }); - // } - /** * Set Plot owner * @@ -508,7 +490,7 @@ public class SQLManager implements AbstractDB { } /** - * @return + * Load all plots, helpers, denied, trusted, and every setting from DB into a hashmap */ @Override public LinkedHashMap> getPlots() { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java index 949921695..c4d822c36 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java @@ -111,12 +111,10 @@ public abstract class PlotWorld { * @param config Configuration Section */ public void loadDefaultConfiguration(final ConfigurationSection config) { - if (Settings.ENABLE_CLUSTERS) { - if (config.contains("generator.terrain")) { - this.TERRAIN = config.getInt("generator.terrain"); - this.TYPE = config.getInt("generator.type"); - } - } + if (config.contains("generator.terrain")) { + this.TERRAIN = config.getInt("generator.terrain"); + this.TYPE = config.getInt("generator.type"); + } this.MOB_SPAWNING = config.getBoolean("natural_mob_spawning"); this.AUTO_MERGE = config.getBoolean("plot.auto_merge"); this.PLOT_BIOME = (Biome) Configuration.BIOME.parseString(config.getString("plot.biome")); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ChunkManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ChunkManager.java index f22175736..23e746d1c 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ChunkManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ChunkManager.java @@ -145,7 +145,9 @@ public class ChunkManager { initMaps(); int absX = x << 4; int absZ = z << 4; + boolean save = false; if (x == c1x || z == c1z) { + save = true; for (int X = 0; X < 16; X++) { for (int Z = 0; Z < 16; Z++) { if ((X + absX < sx || Z + absZ < sz) || (X + absX > ex || Z + absZ > ez)) { @@ -156,6 +158,7 @@ public class ChunkManager { } else if (x == c2x || z == c2z) { for (int X = 0; X < 16; X++) { + save = true; for (int Z = 0; Z < 16; Z++) { if ((X + absX > ex || Z + absZ > ez) || (X + absX < sx || Z + absZ < sz)) { saveBlock(world, maxY, X + absX, Z + absZ); @@ -163,10 +166,14 @@ public class ChunkManager { } } } - saveEntities(chunk, CURRENT_PLOT_CLEAR); + if (save) { + saveEntities(chunk, CURRENT_PLOT_CLEAR); + } world.regenerateChunk(x, z); - restoreBlocks(world, 0, 0); - restoreEntities(world, 0, 0); + if (save) { + restoreBlocks(world, 0, 0); + restoreEntities(world, 0, 0); + } chunk.unload(); chunk.load(); } @@ -217,15 +224,6 @@ public class ChunkManager { } EntityWrapper wrap = new EntityWrapper(entity, (short) 2); entities.add(wrap); - - - -// int y = loc.getBlockY(); -// BlockLoc bl = new BlockLoc(x, y, z); -// EntityWrapper wrap = new EntityWrapper(entity.getType().getTypeId()); -// entities.put(wrap, bl); -// System.out.print(entity.isDead()); -// entity.teleport(new Location(chunk.getWorld(), 0, 65, 0)); } }