From fafb27a131fff70d7882086821b68afe4ccc0b18 Mon Sep 17 00:00:00 2001 From: asofold Date: Wed, 20 Feb 2013 22:30:55 +0100 Subject: [PATCH] Dump block properties in a task whenever they are reset. Better schedule it with a task, to get other plugins changes. Also get dumped on /ncp reload, seems to be better, though it can mean spam. --- .../fr/neatmonster/nocheatplus/NoCheatPlus.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/NoCheatPlus.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/NoCheatPlus.java index 5740bffb..e69f4ccd 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/NoCheatPlus.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/NoCheatPlus.java @@ -601,10 +601,6 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI { // Is the configuration outdated? configOutdated = Updates.isConfigOutdated(DefaultConfig.buildNumber, config); - // Debug information about unknown blocks. - // (Probably removed later.) - BlockProperties.dumpBlocks(config.getBoolean(ConfPaths.BLOCKBREAK_FASTBREAK_DEBUG, false) || config.getBoolean(ConfPaths.BLOCKBREAK, false)); - if (config.getBoolean(ConfPaths.MISCELLANEOUS_PROTECTPLUGINS)) { Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() { @Override @@ -652,6 +648,16 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI { // Set up BlockProperties. BlockProperties.init(getMCAccess(), ConfigManager.getWorldConfigProvider()); BlockProperties.applyConfig(config, ConfPaths.COMPATIBILITY_BLOCKS); + // Schedule dumping the blocks properties (to let other plugins override). + Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() { + @Override + public void run() { + // Debug information about unknown blocks. + // (Probably removed later.) + ConfigFile config = ConfigManager.getConfigFile(); + BlockProperties.dumpBlocks(config.getBoolean(ConfPaths.BLOCKBREAK_FASTBREAK_DEBUG, false) || config.getBoolean(ConfPaths.BLOCKBREAK, false)); + } + }); } /**