From 1e6db07e3a50bbe98c8c0836d1aecea57545eb25 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Fri, 1 May 2015 22:42:10 +1000 Subject: [PATCH] Finished linking augmented --- .../intellectualcrafters/plot/commands/Setup.java | 12 ++++++------ .../plot/database/SQLManager.java | 6 +++--- .../intellectualcrafters/plot/util/MainUtil.java | 13 ++++++++++--- .../plot/util/bukkit/BukkitChunkManager.java | 6 +----- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Setup.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Setup.java index 4131daaf6..30aff6d6d 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Setup.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Setup.java @@ -50,16 +50,16 @@ public class Setup extends SubCommand { for (Entry entry : SetupUtils.generators.entrySet()) { // + prefix + StringUtils.join(SetupUtils.generators.keySet(), prefix).replaceAll("PlotSquared", "&2PlotSquared") if (entry.getKey().equals("PlotSquared")) { - message.append("\n&8 - &2" + entry.getKey() + "(Hybrid Generator)"); + message.append("\n&8 - &2" + entry.getKey() + " (Hybrid Generator)"); } else if (entry.getValue() instanceof HybridGen) { - message.append("\n&8 - &7" + entry.getKey() + "(Hybrid Generator)"); + message.append("\n&8 - &7" + entry.getKey() + " (Hybrid Generator)"); } else if (entry.getValue() instanceof PlotGenerator) { - message.append("\n&8 - &7" + entry.getKey() + "(Plot Generator)"); + message.append("\n&8 - &7" + entry.getKey() + " (Plot Generator)"); } else { - message.append("\n&8 - &7" + entry.getKey() + "(Unknown structure)"); + message.append("\n&8 - &7" + entry.getKey() + " (Unknown structure)"); } } MainUtil.sendMessage(plr, message.toString()); @@ -159,7 +159,7 @@ public class Setup extends SubCommand { MainUtil.sendMessage(plr, "&7 - You may need to manually configure the other plugin"); object.step = ((PlotGenerator) SetupUtils.generators.get(object.plotManager)).getNewPlotWorld(null).getSettingNodes(); } - MainUtil.sendMessage(plr, "&6What terrain would you like in plots?" + "\n&8 - &2NONE&8 - &7No terrain at all" + "\n&8 - &7ORE&8 - &7Just some ore veins and trees" + "\n&8 - &7ALL&8 - &7Entirely vanilla generation"); + MainUtil.sendMessage(plr, "&6What terrain would you like in plots?" + "\n&8 - &2NONE&8 - &7No terrain at all" + "\n&8 - &7ORE&8 - &7Just some ore veins and trees" + "\n&8 - &7ROAD&8 - &7Terrain seperated by roads" + "\n&8 - &7ALL&8 - &7Entirely vanilla generation"); } object.current++; break; @@ -167,7 +167,7 @@ public class Setup extends SubCommand { case 2: { // Choose terrain final List terrain = Arrays.asList(new String[] { "none", "ore", "road", "all" }); if ((args.length != 1) || !terrain.contains(args[0].toLowerCase())) { - MainUtil.sendMessage(plr, "&cYou must choose the terrain!" + "\n&8 - &2NONE&8 - &7No terrain at all" + "\n&8 - &7ORE&8 - &7Just some ore veins and trees" + "\n&8 - &7ALL&8 - &7Entirely vanilla generation&8 - &7ROAD&8 - &7Vanilla except for roads\n" + "&8 - &7ALL&8 - &7Entirely vanilla generation"); + MainUtil.sendMessage(plr, "&cYou must choose the terrain!" + "\n&8 - &2NONE&8 - &7No terrain at all" + "\n&8 - &7ORE&8 - &7Just some ore veins and trees" + "\n&8 - &7ROAD&8 - &7Terrain seperated by roads" + "\n&8 - &7ALL&8 - &7Entirely vanilla generation"); return false; } object.terrain = terrain.indexOf(args[0].toLowerCase()); 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 ca167a8ef..37e4ae648 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/SQLManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/SQLManager.java @@ -285,7 +285,7 @@ public class SQLManager implements AbstractDB { public String getCreateSQL() { return CREATE_PLOT; } - + @Override public void setMySQL(PreparedStatement stmt, int i, Plot plot) throws SQLException { stmt.setInt((i * 4) + 1, plot.id.x); @@ -340,7 +340,7 @@ public class SQLManager implements AbstractDB { if (subList.size() == 0) { return; } - String statement = mod.getCreateMySQL(packet); + String statement = mod.getCreateMySQL(subList.size()); PreparedStatement stmt = null; try { stmt = this.connection.prepareStatement(statement.toString()); @@ -352,7 +352,7 @@ public class SQLManager implements AbstractDB { stmt.close(); } catch (final Exception e) { try { - String unionstmt = mod.getCreateSQLite(packet); + String unionstmt = mod.getCreateSQLite(subList.size()); stmt = this.connection.prepareStatement(unionstmt.toString()); for (int i = 0; i < subList.size(); i++) { mod.setSQLite(stmt, i, subList.get(i)); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java index da4530973..f3eaad301 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java @@ -458,6 +458,10 @@ public class MainUtil { PlotId id2 = new PlotId(id.x + 1, id.y + 1); Location pos1 = getPlotTopLoc(plot.world, id).add(1, 0, 1); Location pos2 = getPlotBottomLoc(plot.world, id2); + pos1.setY(0); + pos2.setY(256); + System.out.print(pos1); + System.out.print(pos2); ChunkManager.manager.regenerateRegion(pos1, pos2, null); } else { @@ -472,7 +476,9 @@ public class MainUtil { Location bot = getPlotBottomLocAbs(plot.world, id2); Location top = getPlotTopLocAbs(plot.world, id); Location pos1 = new Location(plot.world, top.getX() + 1, 0, bot.getZ() + 1); - Location pos2 = new Location(plot.world, bot.getX(), 0, top.getZ()); + Location pos2 = new Location(plot.world, bot.getX(), 256, top.getZ()); + System.out.print(pos1); + System.out.print(pos2); ChunkManager.manager.regenerateRegion(pos1, pos2, null); } else { @@ -487,7 +493,9 @@ public class MainUtil { Location bot = getPlotBottomLocAbs(plot.world, id2); Location top = getPlotTopLocAbs(plot.world, id); Location pos1 = new Location(plot.world, bot.getX() + 1, 0, top.getZ() + 1); - Location pos2 = new Location(plot.world, top.getX(), 0, bot.getZ()); + Location pos2 = new Location(plot.world, top.getX(), 256, bot.getZ()); + System.out.print(pos1); + System.out.print(pos2); ChunkManager.manager.regenerateRegion(pos1, pos2, null); } else { @@ -505,7 +513,6 @@ public class MainUtil { * @param greaterPlot */ public static void mergePlot(final String world, final Plot lesserPlot, final Plot greaterPlot, final boolean removeRoads) { - final PlotManager manager = PlotSquared.getPlotManager(world); final PlotWorld plotworld = PlotSquared.getPlotWorld(world); if (lesserPlot.id.x.equals(greaterPlot.id.x)) { if (!lesserPlot.settings.getMerged(2)) { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitChunkManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitChunkManager.java index e78651549..f625e0a44 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitChunkManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitChunkManager.java @@ -293,11 +293,8 @@ public class BukkitChunkManager extends ChunkManager { @Override public void run() { long start = System.currentTimeMillis(); - int allocated = SetBlockQueue.getAllocate(); - SetBlockQueue.allocate(0); - while (System.currentTimeMillis() - start < allocated) { + while (System.currentTimeMillis() - start < 20) { if (chunks.size() == 0) { - SetBlockQueue.allocate(SetBlockQueue.getAllocate() + allocated); TaskManager.runTaskLater(whenDone, 1); Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex)); TaskManager.tasks.remove(currentIndex); @@ -313,7 +310,6 @@ public class BukkitChunkManager extends ChunkManager { final boolean result = chunk.load(false); if (!result) { loaded = false; - ; } if (!chunk.isLoaded()) { loaded = false;