Hidden config and use of NullChunkletManager

ChunkletManagerFactory now produces NullChunkletManagers if Chunklets are disabeld in the hidden.yml
This commit is contained in:
NuclearW
2012-05-18 22:01:15 -04:00
parent 2936823d03
commit 01006ed76d
4 changed files with 62 additions and 2 deletions

View File

@ -1,8 +1,15 @@
package com.gmail.nossr50.util.blockmeta;
import com.gmail.nossr50.config.HiddenConfig;
public class ChunkletManagerFactory {
public static ChunkletManager getChunkletManager() {
// TODO: Add in loading from config what type of manager we want.
return new HashChunkletManager();
HiddenConfig hConfig = HiddenConfig.getInstance();
if(hConfig.getChunkletsEnabled()) {
return new HashChunkletManager();
} else {
return new NullChunkletManager();
}
}
}