Skip to content

Commit

Permalink
Dump block properties in a task whenever they are reset.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
asofold committed Feb 20, 2013
1 parent 0a031a0 commit fafb27a
Showing 1 changed file with 10 additions and 4 deletions.
Expand Up @@ -601,10 +601,6 @@ public int getValue() {
// 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
Expand Down Expand Up @@ -652,6 +648,16 @@ protected void initBlockProperties(ConfigFile config){
// 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));
}
});
}

/**
Expand Down

0 comments on commit fafb27a

Please sign in to comment.