mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +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")
|
description = "Toggle autoclear confirmation")
|
||||||
public void clearConfirmation(Command command, PlotPlayer player, String[] args, RunnableVal3<Command, Runnable, Runnable> confirm,
|
public void clearConfirmation(Command command, PlotPlayer player, String[] args, RunnableVal3<Command, Runnable, Runnable> confirm,
|
||||||
RunnableVal2<Command, CommandResult> whenDone) {
|
RunnableVal2<Command, CommandResult> whenDone) {
|
||||||
if (toggle(player, "clear-confirmation")) {
|
if (toggle(player, "ignoreExpireTask")) {
|
||||||
MainUtil.sendMessage(player, C.TOGGLE_DISABLED, command.toString());
|
MainUtil.sendMessage(player, C.TOGGLE_DISABLED, command.toString());
|
||||||
} else {
|
} else {
|
||||||
MainUtil.sendMessage(player, C.TOGGLE_ENABLED, command.toString());
|
MainUtil.sendMessage(player, C.TOGGLE_ENABLED, command.toString());
|
||||||
@ -83,7 +83,7 @@ public class Toggle extends Command {
|
|||||||
RunnableVal2<Command, CommandResult> whenDone) {
|
RunnableVal2<Command, CommandResult> whenDone) {
|
||||||
PlotArea area = player.getApplicablePlotArea();
|
PlotArea area = player.getApplicablePlotArea();
|
||||||
boolean chat = area == null ? false : area.PLOT_CHAT;
|
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());
|
MainUtil.sendMessage(player, C.TOGGLE_ENABLED, command.toString());
|
||||||
} else {
|
} else {
|
||||||
MainUtil.sendMessage(player, C.TOGGLE_DISABLED, command.toString());
|
MainUtil.sendMessage(player, C.TOGGLE_DISABLED, command.toString());
|
||||||
|
@ -52,6 +52,11 @@ public class ExpireManager {
|
|||||||
|
|
||||||
public void handleJoin(PlotPlayer pp) {
|
public void handleJoin(PlotPlayer pp) {
|
||||||
storeDate(pp.getUUID(), System.currentTimeMillis());
|
storeDate(pp.getUUID(), System.currentTimeMillis());
|
||||||
|
if (!plotsToDelete.isEmpty()) {
|
||||||
|
for (Plot plot : pp.getPlots()) {
|
||||||
|
plotsToDelete.remove(plot);
|
||||||
|
}
|
||||||
|
}
|
||||||
confirmExpiry(pp);
|
confirmExpiry(pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -399,13 +404,13 @@ public class ExpireManager {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
long max = 0;
|
long min = Long.MAX_VALUE;
|
||||||
for (UUID owner : plot.getOwners()) {
|
for (UUID owner : plot.getOwners()) {
|
||||||
long age = getAge(owner);
|
long age = getAge(owner);
|
||||||
if (age > max) {
|
if (age < min) {
|
||||||
max = age;
|
min = age;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return max;
|
return min;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user