From 7e6550d1477d6da4a00782e53e7ebb8c4191fe94 Mon Sep 17 00:00:00 2001 From: "U-YUE\\Sean" Date: Wed, 20 Feb 2013 09:53:24 -0800 Subject: [PATCH] Unregistering events on disable. Should deal with edge cases regarding forced reloads. --- src/main/java/com/gmail/nossr50/mcMMO.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 0e5b0bc96..97db900a6 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -11,6 +11,7 @@ import net.shatteredlands.shatt.backup.ZipLibrary; import org.bukkit.OfflinePlayer; import org.bukkit.block.Block; import org.bukkit.entity.Player; +import org.bukkit.event.HandlerList; import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; @@ -214,6 +215,7 @@ public class mcMMO extends JavaPlugin { getServer().getScheduler().cancelTasks(this); // This removes our tasks placeStore.saveAll(); // Save our metadata placeStore.cleanUp(); // Cleanup empty metadata stores + HandlerList.unregisterAll(this); // Cancel event registrations if (Config.getInstance().getBackupsEnabled()) { // Remove other tasks BEFORE starting the Backup, or we just cancel it straight away.