use of fr.neatmonster.nocheatplus.config.DefaultConfig in project NoCheatPlus by NoCheatPlus.
the class TestWorldDataManager method set.
/**
* Set in the config taken from the map - create if not yet existent.
*
* @param map
* @param worldName
* @param key
* @param value
*/
void set(Map<String, ConfigFile> map, String worldName, String key, Object value) {
ConfigFile cfg = map.get(worldName);
if (cfg == null) {
cfg = new DefaultConfig();
map.put(worldName, cfg);
}
cfg.set(key, value);
}
use of fr.neatmonster.nocheatplus.config.DefaultConfig in project NoCheatPlus by NoCheatPlus.
the class TestActions method testOptimizedLogActionEmpty.
@Test
public void testOptimizedLogActionEmpty() {
PluginTests.setUnitTestNoCheatPlusAPI(false);
PermissionRegistry pReg = NCPAPIProvider.getNoCheatPlusAPI().getPermissionRegistry();
final ConfigFile config = new DefaultConfig();
config.set("actions", "log:dummy:0:0:icf");
config.set("strings.dummy", "dummy");
config.set(ConfPaths.LOGGING_ACTIVE, false);
ActionList actionList = config.getOptimizedActionList("actions", pReg.getOrRegisterPermission("dummy"));
Action<ViolationData, ActionList>[] actions = actionList.getActions(0.0);
if (actions.length != 0) {
fail("Wrong number of actions.");
}
}
use of fr.neatmonster.nocheatplus.config.DefaultConfig in project NoCheatPlus by NoCheatPlus.
the class WorldDataManager method createDefaultWorldData.
private void createDefaultWorldData() {
lock.lock();
if (worldDataMap.containsKey(null)) {
lock.unlock();
return;
}
ConfigFile config = rawConfigurations.get(null);
if (config == null) {
config = new DefaultConfig();
}
worldDataMap.put(null, new WorldData(null, this));
updateWorldData(null, config);
lock.unlock();
}
Aggregations