@Override public ConfigFile getConfig(String worldName) { return ConfigManager.getConfigFile(worldName); }
@Deprecated public static String isConfigUpToDate(final ConfigFile globalConfig) { return isConfigUpToDate(globalConfig, -1); }
if (!ConfigManager.isInitialized()) { ConfigManager.init(this, worldDataManager); NCPExemptionManager.setExemptionSettings(new ExemptionSettings(ConfigManager.getConfigFile()));
public void onDisable() { final boolean verbose = ConfigManager.getConfigFile().getBoolean(ConfPaths.LOGGING_EXTENDED_STATUS); logManager.info(Streams.INIT, "Cleanup ConfigManager..."); ConfigManager.cleanup();
/** * Initialize BlockProperties, including config. Needs initMCAccess to be * called before. */ private void initBlockProperties(ConfigFile config) { // Set up BlockProperties. BlockProperties.init(mcAccess, 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_DEBUG, config.getBoolean(ConfPaths.CHECKS_DEBUG, false))); } }); }
final IWorldDataManager worldMan = NCPAPIProvider.getNoCheatPlusAPI().getWorldDataManager(); if (ConfigManager.isTrueForAnyConfig(ConfPaths.NET + ConfPaths.SUB_DEBUG) || ConfigManager.isTrueForAnyConfig(ConfPaths.CHECKS_DEBUG) ) {
@Override public ConfigFile getDefaultConfig() { return ConfigManager.getConfigFile(); }
/** * Set instance members based on the given configuration. This is meant to * work after reloading the configuration too. * * @param config */ private void setInstanceMembers(final ConfigFile config) { configProblemsChat = ConfigManager.isConfigUpToDate(config, config.getInt(ConfPaths.CONFIGVERSION_NOTIFYMAXPATHS)); configProblemsFile = configProblemsChat == null ? null : ConfigManager.isConfigUpToDate(config, -1); clearExemptionsOnJoin = config.getBoolean(ConfPaths.COMPATIBILITY_EXEMPTIONS_REMOVE_JOIN); clearExemptionsOnLeave = config.getBoolean(ConfPaths.COMPATIBILITY_EXEMPTIONS_REMOVE_LEAVE); NCPExemptionManager.setExemptionSettings(new ExemptionSettings(config)); }
/** * (Synchronized version). * @return * @deprecated getConfigFile() is thread-safe now. */ @Deprecated public static synchronized ConfigFile getConfigFileSync() { return getConfigFile(); }
&& ConfigManager.isConfigUpToDate(globalConfig, 0) == null) {
/** * (Synchronized version). * @param worldName * @return * @deprecated getConfigFile() is thread-safe now. */ @Deprecated public static synchronized ConfigFile getConfigFileSync(final String worldName) { return getConfigFile(worldName); }
private StreamID getRegistryStreamId() { // TODO: Select by config, or add Streams.REGISTRY for a new default. // For now prefer log file, unless extended status is set. return ConfigManager.getConfigFile().getBoolean(ConfPaths.LOGGING_EXTENDED_STATUS) ? Streams.STATUS : Streams.DEFAULT_FILE; }
protected abstract C newConfig(String key, ConfigFile configFile);
/** * Instantiates a new command action. * * @param name * the name * @param delay * the delay * @param repeat * the repeat * @param command * the command */ public CommandAction(final String name, final int delay, final int repeat, final String command) { // Log messages may have color codes now. super(name, delay, repeat, command); logDebug = ConfigManager.getConfigFile().getBoolean(ConfPaths.LOGGING_EXTENDED_COMMANDS_ACTIONS); }
@Override public void onReload() { aux.clear(); hoverTicksStep = Math.max(1, ConfigManager.getConfigFile().getInt(ConfPaths.MOVING_SURVIVALFLY_HOVER_STEP)); }
private static void checkLogEntry(final String tag) { // New entry. if (ConfigManager.getConfigFile().getBoolean(ConfPaths.LOGGING_EXTENDED_STATUS)) { StaticLog.logInfo("Try old health API: " + tag); } }
@Override public void onReload() { // Hard clear and re-do loggers. Might result in loss of content. // TODO: Register for "early onReload call", needs API addition. clear(0L, true); // Can not afford to wait. createDefaultLoggers(ConfigManager.getConfigFile()); }
/** * Set up the command protection with the "unknown command" message for the permission message (attempt to hide the command). * @param permissionBase * @param ignoredCommands * @param invertIgnored * @param ops * @return */ public static List<CommandProtectionEntry> protectCommands(String permissionBase, Collection<String> ignoredCommands, boolean invertIgnored, boolean ops) { return protectCommands(permissionBase, ignoredCommands, invertIgnored, ops, ColorUtil.replaceColors(ConfigManager.getConfigFile().getString(ConfPaths.PROTECT_PLUGINS_HIDE_NOCOMMAND_MSG))); }
@Override public void run() { // Debug information about unknown blocks. // (Probably removed later.) ConfigFile config = ConfigManager.getConfigFile(); BlockProperties.dumpBlocks(config.getBoolean(ConfPaths.BLOCKBREAK_DEBUG, config.getBoolean(ConfPaths.CHECKS_DEBUG, false))); } });