fix list (again) and update debugroadregen

This commit is contained in:
boy0001 2015-03-11 23:26:39 +11:00
parent 15b24b0a00
commit a32c3067c5
4 changed files with 29 additions and 15 deletions

View File

@ -173,11 +173,19 @@ public class PlotSquared {
ArrayList<Plot> newPlots = new ArrayList<>(); ArrayList<Plot> newPlots = new ArrayList<>();
HashMap<PlotId, Plot> worldPlots = PlotSquared.plots.get(priorityWorld); HashMap<PlotId, Plot> worldPlots = PlotSquared.plots.get(priorityWorld);
if (worldPlots != null) { if (worldPlots != null) {
newPlots.addAll(sortPlots(worldPlots.values())); for (Plot plot : sortPlots(worldPlots.values())) {
if (plots.contains(plot)) {
newPlots.add(plot);
}
}
} }
for (Entry<String, HashMap<PlotId, Plot>> entry : PlotSquared.plots.entrySet()) { for (Entry<String, HashMap<PlotId, Plot>> entry : PlotSquared.plots.entrySet()) {
if (!entry.getKey().equals(priorityWorld)) { if (!entry.getKey().equals(priorityWorld)) {
entry.getValue().values(); for (Plot plot : entry.getValue().values()) {
if (plots.contains(plot)) {
newPlots.add(plot);
}
}
} }
} }
return newPlots; return newPlots;
@ -504,18 +512,20 @@ public class PlotSquared {
// Set chunk // Set chunk
ChunkManager.manager = IMP.initChunkManager(); ChunkManager.manager = IMP.initChunkManager();
// PlotMe // PlotMe
TaskManager.runTaskLater(new Runnable() { if (Settings.CONVERT_PLOTME) {
@Override TaskManager.runTaskLater(new Runnable() {
public void run() { @Override
if (IMP.initPlotMeConverter()) { public void run() {
log("&c=== IMPORTANT ==="); if (IMP.initPlotMeConverter()) {
log("&cTHIS MESSAGE MAY BE EXTREMELY HELPFUL IF YOU HAVE TROUBLE CONVERTING PLOTME!"); log("&c=== IMPORTANT ===");
log("&c - Make sure 'UUID.read-from-disk' is disabled (false)!"); log("&cTHIS MESSAGE MAY BE EXTREMELY HELPFUL IF YOU HAVE TROUBLE CONVERTING PLOTME!");
log("&c - Sometimes the database can be locked, deleting PlotMe.jar beforehand will fix the issue!"); log("&c - Make sure 'UUID.read-from-disk' is disabled (false)!");
log("&c - After the conversion is finished, please set 'plotme-convert.enabled' to false in the 'settings.yml@'"); log("&c - Sometimes the database can be locked, deleting PlotMe.jar beforehand will fix the issue!");
log("&c - After the conversion is finished, please set 'plotme-convert.enabled' to false in the 'settings.yml@'");
}
} }
} }, 200);
}, 200); }
if (Settings.AUTO_CLEAR) { if (Settings.AUTO_CLEAR) {
ExpireManager.runTask(); ExpireManager.runTask();
} }

View File

@ -47,6 +47,7 @@ public class DebugRoadRegen extends SubCommand {
MainUtil.update(loc); MainUtil.update(loc);
} }
MainUtil.sendMessage(player, "&6Regenerating chunk: " + chunk.x + "," + chunk.z + "\n&6 - Result: " + (result == true ? "&aSuccess" : "&cFailed")); MainUtil.sendMessage(player, "&6Regenerating chunk: " + chunk.x + "," + chunk.z + "\n&6 - Result: " + (result == true ? "&aSuccess" : "&cFailed"));
MainUtil.update(loc);
return true; return true;
} }
} }

View File

@ -81,7 +81,7 @@ public class Home extends SubCommand {
MainUtil.teleportPlayer(plr, plr.getLocation(), plots.get(id - 1)); MainUtil.teleportPlayer(plr, plr.getLocation(), plots.get(id - 1));
return true; return true;
} else { } else {
MainUtil.sendMessage(plr, C.NO_PLOTS); MainUtil.sendMessage(plr, C.FOUND_NO_PLOTS);
return true; return true;
} }
} }

View File

@ -113,16 +113,19 @@ public class list extends SubCommand {
break; break;
} }
plots = PlotSquared.getPlots(plr); plots = PlotSquared.getPlots(plr);
break;
} }
case "shared": { case "shared": {
if (plr == null) { if (plr == null) {
break; break;
} }
plots = new ArrayList<Plot>();
for (Plot plot : PlotSquared.getPlots()) { for (Plot plot : PlotSquared.getPlots()) {
if (plot.helpers.contains(plr.getUUID()) || plot.trusted.contains(plr.getUUID())) { if (plot.helpers.contains(plr.getUUID()) || plot.trusted.contains(plr.getUUID())) {
plots.add(plot); plots.add(plot);
} }
} }
break;
} }
case "world": { case "world": {
plots = PlotSquared.getPlots(world).values(); plots = PlotSquared.getPlots(world).values();
@ -185,7 +188,7 @@ public class list extends SubCommand {
} }
if (plots.size() == 0) { if (plots.size() == 0) {
MainUtil.sendMessage(plr, C.NO_PLOTS); MainUtil.sendMessage(plr, C.FOUND_NO_PLOTS);
return false; return false;
} }