From 5d3e0965011c3c91fb440db54ec5c98224002a50 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sat, 1 Oct 2016 22:09:45 +1000 Subject: [PATCH] *Fix the toggle --- .../intellectualcrafters/plot/commands/Toggle.java | 4 ++-- .../plot/util/expiry/ExpireManager.java | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Toggle.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Toggle.java index 631ad7687..d1975e854 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Toggle.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Toggle.java @@ -68,7 +68,7 @@ public class Toggle extends Command { description = "Toggle autoclear confirmation") public void clearConfirmation(Command command, PlotPlayer player, String[] args, RunnableVal3 confirm, RunnableVal2 whenDone) { - if (toggle(player, "clear-confirmation")) { + if (toggle(player, "ignoreExpireTask")) { MainUtil.sendMessage(player, C.TOGGLE_DISABLED, command.toString()); } else { MainUtil.sendMessage(player, C.TOGGLE_ENABLED, command.toString()); @@ -83,7 +83,7 @@ public class Toggle extends Command { RunnableVal2 whenDone) { PlotArea area = player.getApplicablePlotArea(); boolean chat = area == null ? false : area.PLOT_CHAT; - if (toggle(player, "ignoreExpireTask") != chat) { + if (toggle(player, "disabletitles") != chat) { MainUtil.sendMessage(player, C.TOGGLE_ENABLED, command.toString()); } else { MainUtil.sendMessage(player, C.TOGGLE_DISABLED, command.toString()); diff --git a/Core/src/main/java/com/intellectualcrafters/plot/util/expiry/ExpireManager.java b/Core/src/main/java/com/intellectualcrafters/plot/util/expiry/ExpireManager.java index c5128620a..7f5c97be8 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/util/expiry/ExpireManager.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/util/expiry/ExpireManager.java @@ -52,6 +52,11 @@ public class ExpireManager { public void handleJoin(PlotPlayer pp) { storeDate(pp.getUUID(), System.currentTimeMillis()); + if (!plotsToDelete.isEmpty()) { + for (Plot plot : pp.getPlots()) { + plotsToDelete.remove(plot); + } + } confirmExpiry(pp); } @@ -399,13 +404,13 @@ public class ExpireManager { return 0; } } - long max = 0; + long min = Long.MAX_VALUE; for (UUID owner : plot.getOwners()) { long age = getAge(owner); - if (age > max) { - max = age; + if (age < min) { + min = age; } } - return max; + return min; } }