use of fr.neatmonster.nocheatplus.logging.details.IGetStreamId in project NoCheatPlus by NoCheatPlus.
the class NoCheatPlus method setupBasics.
/**
* Lazy initialization of basics (static API, configuration, logging).
*/
private void setupBasics() {
// Ensure permissions are registered early.
for (RegisteredPermission rp : Permissions.getPermissions()) {
if (permissionRegistry.getPermissionInfo(rp.getId()) == null) {
permissionRegistry.addRegisteredPermission(rp);
}
}
// API.
updateNoCheatPlusAPI();
// Initialize server version.
if (ServerVersion.getMinecraftVersion() == GenericVersion.UNKNOWN_VERSION) {
BukkitVersion.init();
}
// Pre config setup.
if (getGenericInstance(ActionFactoryFactory.class) == null) {
// Set to default.
setActionFactoryFactory(null);
}
// Configuration.
if (!ConfigManager.isInitialized()) {
ConfigManager.init(this, worldDataManager);
// Basic setup for exemption (uses CheckType). This is redundant, but should not hurt.
NCPExemptionManager.setExemptionSettings(new ExemptionSettings(ConfigManager.getConfigFile()));
}
// Logging.
if (logManager == null || logManager.getStreamID(Streams.STATUS.name) != Streams.STATUS) {
logManager = new BukkitLogManager(this);
StaticLog.setStreamID(Streams.INIT);
StaticLog.setUseLogManager(true);
logManager.info(Streams.INIT, "Logging system initialized.");
logManager.info(Streams.INIT, "Detected Minecraft version: " + ServerVersion.getMinecraftVersion());
genericInstanceRegistry.setLogger(logManager, new IGetStreamId() {
@Override
public StreamID getStreamId() {
// TODO Auto-generated method stub
return NoCheatPlus.this.getRegistryStreamId();
}
}, "[GenericInstanceRegistry] ");
}
}
Aggregations