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; }
/** * Warn about paths that are deprecated (not in use). * @param config * @param paths * @param configName */ protected static void processDeprecatedPaths(ConfigurationSection config, String configName, final Set<String> removePaths) { warnPaths(config, deprecatedPrefixes, " (" + configName + ") is not in use anymore.", removePaths); }
/** * Set paths. * @param config * @param addPaths */ public static void setPaths(final ConfigurationSection config, final Map<String, Object> setPaths, final boolean override) { setPaths(config, setPaths, "", override); }
public MetaDataListCheck(final ConfigFile config, final String pathActive, final String pathKeys) { this(config.getBoolean(pathActive) ? config.getStringList(pathKeys) : null); }
@Override public void onReload() { aux.clear(); hoverTicksStep = Math.max(1, ConfigManager.getConfigFile().getInt(ConfPaths.MOVING_SURVIVALFLY_HOVER_STEP)); }
/** * 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))); }
protected abstract C newConfig(String key, ConfigFile configFile);
public AllViolationsConfig(ConfigFile config) { allToTrace = config.getBoolean(ConfPaths.LOGGING_EXTENDED_ALLVIOLATIONS_BACKEND_TRACE); allToNotify = config.getBoolean(ConfPaths.LOGGING_EXTENDED_ALLVIOLATIONS_BACKEND_NOTIFY); debug = config.getBoolean(ConfPaths.LOGGING_EXTENDED_ALLVIOLATIONS_DEBUG); debugOnly = config.getBoolean(ConfPaths.LOGGING_EXTENDED_ALLVIOLATIONS_DEBUGONLY) || debug && !allToTrace && !allToNotify; }
@Override public ConfigFile getConfig(String worldName) { return ConfigManager.getConfigFile(worldName); }
public WrapMoved(String oldPath,Moved moved) { this(oldPath, moved.newPath(), moved.configurationSection()); }
/** * Short cut to set a value and the last changed build number. * <hr> * Performs set(path, value) and setLastChangedBuildNumber(path, * lastChangedBuildNumber). * * @param path * @param value * @param lastChangedBuildNumber */ public void set(String path, Object value, int lastChangedBuildNumber) { set(path, value); setLastChangedBuildNumber(path, lastChangedBuildNumber); }
/** * Return a double value within given bounds, with preset. * * @param data * @param path * @param min * @param max * @param preset * @return */ public double getDouble(final String path, final double min, final double max, final double preset){ final double value = getDouble(path, preset); if (value < min) return min; else if (value > max) return max; else return value; }
/** * Return a long value within given bounds, with preset. * * @param data * @param path * @param min * @param max * @param preset * @return */ public long getLong(final String path, final long min, final long max, final long preset){ final long value = getLong(path, preset); if (value < min) return min; else if (value > max) return max; else return value; }
/** * Return an int value within given bounds, with preset. * * @param data * @param path * @param min * @param max * @param preset * @return */ public long getInt(final String path, final int min, final int max, final int preset){ final int value = getInt(path, preset); if (value < min) return min; else if (value > max) return max; else return value; }
/** * 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); }
public MCAccessConfig(final ConfigFile config) { this.enableCBDedicated = config.getBoolean(ConfPaths.COMPATIBILITY_SERVER_CBDEDICATED_ENABLE); this.enableCBReflect = config.getBoolean(ConfPaths.COMPATIBILITY_SERVER_CBREFLECT_ENABLE); }
@Override public ConfigFile getDefaultConfig() { return ConfigManager.getConfigFile(); }
/** * Warn about paths that are only to be set in the global config. * @param config * @param paths * @param configName */ protected static void processGlobalOnlyPaths(ConfigurationSection config, String configName, final Set<String> removePaths) { warnPaths(config, globalOnlyPrefixes, " (" + configName + ") should only be set in the global configuration.", removePaths); }
@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))); } });
private static void checkLogEntry(final String tag) { // New entry. if (ConfigManager.getConfigFile().getBoolean(ConfPaths.LOGGING_EXTENDED_STATUS)) { StaticLog.logInfo("Try old health API: " + tag); } }