Clean up a bit

This commit is contained in:
games647 2016-05-11 17:16:29 +02:00
parent b1957c9812
commit 5c850e46c4
4 changed files with 14 additions and 14 deletions

View File

@ -706,7 +706,8 @@ public class AuthMe extends JavaPlugin {
ConsoleLogger.info("AutoPurging the Database: " + cleared.size() + " accounts removed!");
ConsoleLogger.info("Purging user accounts...");
new PurgeTask(plugin, newSettings, Bukkit.getConsoleSender(), cleared).runTaskTimer(plugin, 0, 1);
new PurgeTask(plugin, Bukkit.getConsoleSender(), cleared, true, Bukkit.getOfflinePlayers())
.runTaskTimer(plugin, 0, 1);
}
// Return the spawn location of a player

View File

@ -47,6 +47,6 @@ public class PurgeBannedPlayersCommand implements ExecutableCommand {
// Show a status message
sender.sendMessage(ChatColor.GOLD + "Purging user accounts...");
new PurgeTask(plugin, plugin.getSettings(), sender, namedBanned, bannedPlayers).runTaskTimer(plugin, 0, 1);
new PurgeTask(plugin, sender, namedBanned, bannedPlayers).runTaskTimer(plugin, 0, 1);
}
}

View File

@ -68,6 +68,6 @@ public class PurgeCommand implements ExecutableCommand {
// Show a status message
sender.sendMessage(ChatColor.GOLD + "Deleted " + purged.size() + " user accounts");
sender.sendMessage(ChatColor.GOLD + "Purging user accounts...");
new PurgeTask(plugin, plugin.getSettings(), sender, purged).runTaskTimer(plugin, 0, 1);
new PurgeTask(plugin, sender, purged).runTaskTimer(plugin, 0, 1);
}
}

View File

@ -34,20 +34,19 @@ public class PurgeTask extends BukkitRunnable {
private int currentPage = 0;
public PurgeTask(AuthMe plugin, NewSetting newSetting, CommandSender sender
, Set<String> purged, Set<OfflinePlayer> offlinePlayers) {
this(plugin, newSetting, sender, purged, false
public PurgeTask(AuthMe plugin, CommandSender sender, Set<String> purged) {
this(plugin, sender, purged, false, Bukkit.getOfflinePlayers());
}
public PurgeTask(AuthMe plugin, CommandSender sender, Set<String> purged, Set<OfflinePlayer> offlinePlayers) {
this(plugin, sender, purged, false
, offlinePlayers.toArray(new OfflinePlayer[offlinePlayers.size()]));
}
public PurgeTask(AuthMe plugin, NewSetting newSetting, CommandSender sender, Set<String> purged) {
this(plugin, newSetting, sender, purged, false, Bukkit.getOfflinePlayers());
}
public PurgeTask(AuthMe plugin, NewSetting newSetting, CommandSender sender, Set<String> purged
, boolean autoPurging, OfflinePlayer[] offlinePlayers) {
public PurgeTask(AuthMe plugin, CommandSender sender, Set<String> purged
, boolean autoPurge, OfflinePlayer[] offlinePlayers) {
this.plugin = plugin;
this.newSetting = newSetting;
this.newSetting = plugin.getSettings();
if (sender instanceof Player) {
this.sender = ((Player) sender).getUniqueId();
@ -57,7 +56,7 @@ public class PurgeTask extends BukkitRunnable {
this.toPurge = purged;
this.totalPurgeCount = purged.size();
this.autoPurging = autoPurging;
this.autoPurging = autoPurge;
this.offlinePlayers = offlinePlayers;
//this is commented out because I assume all players in the database already have an lowercase name