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.
This commit is contained in:
asofold 2013-02-20 22:30:55 +01:00
parent 0a031a0a92
commit fafb27a131

View File

@ -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));
}
});
}
/**