mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
*Fix the toggle
This commit is contained in:
parent
39e99c0593
commit
5d3e096501
@ -68,7 +68,7 @@ public class Toggle extends Command {
|
||||
description = "Toggle autoclear confirmation")
|
||||
public void clearConfirmation(Command command, PlotPlayer player, String[] args, RunnableVal3<Command, Runnable, Runnable> confirm,
|
||||
RunnableVal2<Command, CommandResult> 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<Command, CommandResult> 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());
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user