Added debug command to start/stop task

This commit is contained in:
Jesse Boyd 2015-01-23 11:02:04 -07:00
parent ea60f471ad
commit c0acc4310c
2 changed files with 12 additions and 10 deletions

View File

@ -862,7 +862,7 @@ public class PlotMain extends JavaPlugin implements Listener {
Settings.MAX_PLOTS = config.getInt("max_plots");
Settings.SCHEMATIC_SAVE_PATH = config.getString("schematics.save_path");
Settings.OFFLINE_MODE = config.getBoolean("uuid.offline");
Settings.OFFLINE_MODE = config.getBoolean("UUID.offline");
Settings.UUID_FROM_DISK = config.getBoolean("uuid.read-from-disk");
Settings.REQUIRE_SELECTION = config.getBoolean("worldedit.require-selection-in-mask");

View File

@ -112,15 +112,17 @@ public class ExpireManager {
}
public static boolean isExpired(UUID uuid) {
OfflinePlayer op = UUIDHandler.uuidWrapper.getOfflinePlayer(uuid);
if (!op.hasPlayedBefore()) {
return true;
}
long last = op.getLastPlayed();
long compared = System.currentTimeMillis() - last;
if (compared >= 86400000 * Settings.AUTO_CLEAR_DAYS) {
return true;
}
String name = UUIDHandler.getName(uuid);
if (name != null) {
OfflinePlayer op = Bukkit.getOfflinePlayer(name);
if (op.hasPlayedBefore()) {
long last = op.getLastPlayed();
long compared = System.currentTimeMillis() - last;
if (compared >= 86400000 * Settings.AUTO_CLEAR_DAYS) {
return true;
}
}
}
return false;
}