mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-07 03:02:11 +01: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;
|
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.
|
* 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>
|
* <br>
|
||||||
|
Loading…
Reference in New Issue
Block a user