From 9838cf4393ff94e239818b5e81fb255f082a795a Mon Sep 17 00:00:00 2001 From: asofold Date: Tue, 4 Dec 2012 22:28:51 +0100 Subject: [PATCH] Do not undo command changes. Instead just clear the list. It appears that this leads to recalculation of permissions, which leads to freezing during disabling the plugin having NPC plugins like Citizens 2 in place. Undoing the changes is not that important anyway. --- src/fr/neatmonster/nocheatplus/NoCheatPlus.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/fr/neatmonster/nocheatplus/NoCheatPlus.java b/src/fr/neatmonster/nocheatplus/NoCheatPlus.java index bcbb9af5..8190983f 100644 --- a/src/fr/neatmonster/nocheatplus/NoCheatPlus.java +++ b/src/fr/neatmonster/nocheatplus/NoCheatPlus.java @@ -345,9 +345,12 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI { if (verbose) LogUtil.logInfo("[NoCheatPlus] Cleanup DataManager..."); dataMan.onDisable(); - // Restore changed commands. - if (verbose) LogUtil.logInfo("[NoCheatPlus] Undo command changes..."); - undoCommandChanges(); + // Clear command changes list (compatibility issues with NPCs, leads to rrecalculation of perms). + changedCommands.clear(); + changedCommands = null; +// // Restore changed commands. +// if (verbose) LogUtil.logInfo("[NoCheatPlus] Undo command changes..."); +// undoCommandChanges(); // Cleanup the configuration manager. if (verbose) LogUtil.logInfo("[NoCheatPlus] Cleanup ConfigManager..."); @@ -361,6 +364,7 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI { /** * Does not undo 100%, but restore old permission, permission-message, label (unlikely to be changed), permission default. + * @deprecated Leads to compatibility issues with NPC plugins such as Citizens 2, due to recalculation of permissions (specifically during disabling). */ public void undoCommandChanges() { if (changedCommands != null){