From a1d476321f89d79eb2688a7c2befe411ca18ac7f Mon Sep 17 00:00:00 2001 From: boy0001 Date: Thu, 12 Mar 2015 20:20:17 +1100 Subject: [PATCH] Fixed purge in offline mode servers + typo --- .../plot/commands/Purge.java | 22 +++++++++---------- .../intellectualcrafters/plot/config/C.java | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Purge.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Purge.java index f7e1d7bce..2fd574adc 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Purge.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Purge.java @@ -107,17 +107,6 @@ public class Purge extends SubCommand { DBFunc.purgeIds(worldname, ids); return finishPurge(DBid == Integer.MAX_VALUE ? 1 : 0); } - final UUID uuid = UUIDHandler.getUUID(args[0]); - if (uuid != null) { - final Set plots = PlotSquared.getPlots(worldname, uuid); - final Set ids = new HashSet<>(); - for (final Plot plot : plots) { - ids.add(plot.id); - } - int length = ids.size(); - DBFunc.purge(worldname, ids); - return finishPurge(length); - } if (arg.equals("all")) { final Set ids = PlotSquared.getPlots(worldname).keySet(); int length = ids.size(); @@ -160,6 +149,17 @@ public class Purge extends SubCommand { DBFunc.purge(worldname, ids); return finishPurge(length); } + final UUID uuid = UUIDHandler.getUUID(args[0]); + if (uuid != null) { + final Set plots = PlotSquared.getPlots(worldname, uuid); + final Set ids = new HashSet<>(); + for (final Plot plot : plots) { + ids.add(plot.id); + } + int length = ids.size(); + DBFunc.purge(worldname, ids); + return finishPurge(length); + } MainUtil.sendMessage(plr, C.PURGE_SYNTAX); return false; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java index 0184af139..f32d3e76d 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java @@ -236,7 +236,7 @@ public enum C { * purge */ PURGE_SYNTAX("Use /plot purge "), - PURGE_SUCCESS("$4Successfully purge %s plots"), + PURGE_SUCCESS("$4Successfully purged %s plots"), /* * trim */