Cleanup BlockProperties on disable.

This commit is contained in:
asofold 2013-01-30 03:22:58 +01:00
parent 8c3ed77c7c
commit abe22f8104
2 changed files with 15 additions and 0 deletions

View File

@ -1465,4 +1465,15 @@ public class BlockProperties {
public static void setBreakPenaltyOffGround(float breakPenaltyOffGround) {
BlockProperties.breakPenaltyOffGround = breakPenaltyOffGround;
}
/**
* Cleanup. Call init() to re-initialize.
*/
public static void cleanup() {
pLoc.cleanup();
pLoc = null;
blockCache.cleanup();
blockCache = null;
// TODO: might empty mappings...
}
}

View File

@ -392,6 +392,10 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
removeComponent(obj);
}
// Cleanup BlockProperties.
if (verbose) LogUtil.logInfo("[NoCheatPlus] Cleanup BlockProperties...");
BlockProperties.cleanup();
if (verbose) LogUtil.logInfo("[NoCheatPlus] Cleanup some mappings...");
// Remove listeners.
listeners.clear();