mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-15 08:28:10 +02:00
Add isTrueForAnyConfig, e.g. to check if to register listeners at all.
This commit is contained in:
parent
126c400813
commit
0496f281b7
@ -281,6 +281,20 @@ public class ConfigManager {
|
||||
ConfigManager.worldsMap = newWorldsMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if any config has a boolean set to true for the given path.
|
||||
* @param path
|
||||
* @return True if any config has a boolean set to true for the given path.
|
||||
*/
|
||||
public static boolean isTrueForAnyConfig(String path) {
|
||||
for (final ConfigFile cfg : worldsMap.values()){
|
||||
if (cfg.getBoolean(path, false)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the maximally found number for the given config path. This does not throw errors. It will return null, if nothing is found or all lookups failed otherwise.
|
||||
* <br>
|
||||
|
Loading…
Reference in New Issue
Block a user