From c659ec075f0470ad846314809d8e0b3317163129 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sat, 4 Jul 2015 23:38:47 +1000 Subject: [PATCH] Remove debug --- .../main/java/com/intellectualcrafters/plot/PS.java | 9 +++++++++ .../com/intellectualcrafters/plot/commands/Info.java | 10 ---------- .../com/intellectualcrafters/plot/database/DBFunc.java | 3 +++ .../intellectualcrafters/plot/database/SQLManager.java | 7 +++++-- .../com/intellectualcrafters/plot/util/MainUtil.java | 7 ------- 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PS.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PS.java index 393f4e140..1cf8d25bd 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PS.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PS.java @@ -640,10 +640,19 @@ public class PS { log("&c[ERROR] World '" + world + "' in settings.yml is not using PlotSquared generator! Please set the generator correctly or delete the world from the 'settings.yml'!"); return; } + + log(C.PREFIX.s() + "&aDetected world load for '" + world + "'"); + log(C.PREFIX.s() + "&3 - generator: &7" + gen_class.getClass().getName()); + log(C.PREFIX.s() + "&3 - plotworld: &7" + plotWorld.getClass().getName()); + log(C.PREFIX.s() + "&3 - manager: &7" + plotManager.getClass().getName()); + log(C.PREFIX.s() + "&3 - | terrain: &7" + plotWorld.TERRAIN); + log(C.PREFIX.s() + "&3 - | type: &7" + plotWorld.TYPE); + addPlotWorld(world, plotWorld, plotManager); if (plotWorld.TYPE == 2) { if (ClusterManager.getClusters(world).size() > 0) { for (final PlotCluster cluster : ClusterManager.getClusters(world)) { + log(C.PREFIX.s() + "&3 - &7| cluster: " + cluster); new AugmentedPopulator(world, gen_class, cluster, plotWorld.TERRAIN == 2, plotWorld.TERRAIN != 2); } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Info.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Info.java index 8db90cd9c..651f32351 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Info.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Info.java @@ -74,9 +74,7 @@ public class Info extends SubCommand { plot = MainUtil.getPlotFromString(player, null, player == null); break; default: - System.out.print("CHECKING: " + arg); plot = MainUtil.getPlotFromString(player, arg, player == null); - System.out.print(plot); if (args.length == 2) { arg = args[1]; } @@ -124,13 +122,6 @@ public class Info extends SubCommand { MainUtil.sendMessage(player, C.PLOT_INFO_UNCLAIMED, (plot.id.x + ";" + plot.id.y)); return true; } - String owner = "none"; - if (plot.owner == null) { - owner = "unowned"; - } - else { - owner = getPlayerList(plot.getOwners()); - } String info = C.PLOT_INFO.s(); if (arg != null) { info = getCaption(arg); @@ -207,7 +198,6 @@ public class Info extends SubCommand { info = info.replaceAll("%flags%", Matcher.quoteReplacement(flags)); info = info.replaceAll("%build%", build + ""); info = info.replaceAll("%desc%", "No description set."); - if (info.contains("%rating%")) { final String newInfo = info; TaskManager.runTaskAsync(new Runnable() { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/DBFunc.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/DBFunc.java index c1af50f85..22379a1c2 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/DBFunc.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/DBFunc.java @@ -404,6 +404,9 @@ public class DBFunc { } public static HashMap getRatings(final Plot plot) { + if (plot.temp) { + return new HashMap<>(); + } return dbManager.getRatings(plot); } 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 ab578ec52..e20e59ccc 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/SQLManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/SQLManager.java @@ -849,7 +849,6 @@ public class SQLManager implements AbstractDB { p = new Plot(plot_id, user, new ArrayList(), new ArrayList(), new ArrayList(), "", null, null, worldname, new boolean[]{false, false, false, false}); plots.put(id, p); } - if (Settings.CACHE_RATINGS) { r = stmt.executeQuery("SELECT `plot_plot_id`, `player`, `rating` FROM `" + this.prefix + "plot_rating`"); while (r.next()) { @@ -871,7 +870,7 @@ public class SQLManager implements AbstractDB { } } } - + /* * Getting helpers */ @@ -891,6 +890,7 @@ public class SQLManager implements AbstractDB { PS.log("&cPLOT " + id + " in plot_helpers does not exist. Please create the plot or remove this entry."); } } + /* * Getting trusted */ @@ -910,6 +910,7 @@ public class SQLManager implements AbstractDB { PS.log("&cPLOT " + id + " in plot_trusted does not exist. Please create the plot or remove this entry."); } } + /* * Getting denied */ @@ -929,6 +930,7 @@ public class SQLManager implements AbstractDB { PS.log("&cPLOT " + id + " in plot_denied does not exist. Please create the plot or remove this entry."); } } + r = stmt.executeQuery("SELECT * FROM `" + this.prefix + "plot_settings`"); while (r.next()) { id = r.getInt("plot_plot_id"); @@ -1018,6 +1020,7 @@ public class SQLManager implements AbstractDB { PS.log("&cPLOT " + id + " in plot_settings does not exist. Please create the plot or remove this entry."); } } + stmt.close(); r.close(); if (plots.keySet().size() > 0) { 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 dd19e8e54..8fe23d0d4 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java @@ -67,7 +67,6 @@ public class MainUtil { if (arg == null) { if (player == null) { if (message) MainUtil.sendMessage(player, C.NOT_VALID_PLOT_WORLD); - System.out.print(1); return null; } return getPlot(player.getLocation()); @@ -77,10 +76,7 @@ public class MainUtil { if (player != null) { worldname = player.getLocation().getWorld(); } - System.out.print(arg); String[] split = arg.split(";|,"); - System.out.print(split[0]); - System.out.print(split[1]); if (split.length == 3) { worldname = split[0]; id = PlotId.fromString(split[1] + ";" + split[2]); @@ -115,15 +111,12 @@ public class MainUtil { } if (worldname == null || !PS.get().isPlotWorld(worldname)) { if (message) MainUtil.sendMessage(player, C.NOT_VALID_PLOT_WORLD); - System.out.print("INVALID WORLD: "); return null; } if (id == null) { - System.out.print("INVALID ID: "); if (message) MainUtil.sendMessage(player, C.NOT_VALID_PLOT_ID); return null; } - System.out.print("VALID PLOT: "); return getPlot(worldname, id); }