Add more debug messages in onDisable()

So that we can track down why the disable proces slows down
This commit is contained in:
TfT_02 2014-01-18 16:58:49 +01:00
parent 383b048fef
commit b460f7a564
6 changed files with 9 additions and 1 deletions

View File

@ -211,7 +211,9 @@ public class mcMMO extends JavaPlugin {
} }
catch (NullPointerException e) {} catch (NullPointerException e) {}
debug("Canceling all tasks...");
getServer().getScheduler().cancelTasks(this); // This removes our tasks getServer().getScheduler().cancelTasks(this); // This removes our tasks
debug("Unregister all events...");
HandlerList.unregisterAll(this); // Cancel event registrations HandlerList.unregisterAll(this); // Cancel event registrations
if (Config.getInstance().getBackupsEnabled()) { if (Config.getInstance().getBackupsEnabled()) {

View File

@ -526,6 +526,7 @@ public final class PartyManager {
YamlConfiguration partiesFile = new YamlConfiguration(); YamlConfiguration partiesFile = new YamlConfiguration();
mcMMO.p.debug("Saving Parties... (" + parties.size() + ")");
for (Party party : parties) { for (Party party : parties) {
String partyName = party.getName(); String partyName = party.getName();

View File

@ -134,6 +134,7 @@ public final class HolidayManager {
// This gets called onDisable // This gets called onDisable
public void saveAnniversaryFiles() { public void saveAnniversaryFiles() {
mcMMO.p.debug("Saving anniversary files...");
String anniversaryFilePath = mcMMO.getFlatFileDirectory() + "anniversary." + CURRENT_YEAR + ".yml"; String anniversaryFilePath = mcMMO.getFlatFileDirectory() + "anniversary." + CURRENT_YEAR + ".yml";
try { try {

View File

@ -151,6 +151,7 @@ public class FormulaManager {
* Save formula file. * Save formula file.
*/ */
public void saveFormula() { public void saveFormula() {
mcMMO.p.debug("Saving previous XP formula type...");
YamlConfiguration formulasFile = new YamlConfiguration(); YamlConfiguration formulasFile = new YamlConfiguration();
formulasFile.set("Previous_Formula", previousFormula.toString()); formulasFile.set("Previous_Formula", previousFormula.toString());

View File

@ -57,6 +57,7 @@ public final class UserManager {
* Save all users. * Save all users.
*/ */
public static void saveAll() { public static void saveAll() {
mcMMO.p.debug("Saving mcMMOPlayers... (" + players.size() + ")");
for (McMMOPlayer mcMMOPlayer : players.values()) { for (McMMOPlayer mcMMOPlayer : players.values()) {
mcMMOPlayer.getProfile().save(); mcMMOPlayer.getProfile().save();
} }

View File

@ -161,7 +161,9 @@ public class ScoreboardManager {
// Called in onDisable() // Called in onDisable()
public static void teardownAll() { public static void teardownAll() {
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) { Player[] onlinePlayers = mcMMO.p.getServer().getOnlinePlayers();
mcMMO.p.debug("Tearing down scoreboards... (" + onlinePlayers.length + ")");
for (Player player : onlinePlayers) {
teardownPlayer(player); teardownPlayer(player);
} }
} }