use of uk.co.drnaylor.quickstart.exceptions.IncorrectAdapterTypeException in project Nucleus by NucleusPowered.
the class GeoIpListener method shouldEnable.
@Override
public boolean shouldEnable() {
try {
GeoIpConfig gic = Nucleus.getNucleus().getModuleContainer().getConfigAdapterForModule(GeoIpModule.ID, GeoIpConfigAdapter.class).getNodeOrDefault();
if (gic.isAcceptLicence()) {
if (!isPrinted) {
Nucleus.getNucleus().getLogger().info("GeoIP is enabled. Nucleus makes use of GeoLite2 data created by MaxMind, available from http://www.maxmind.com");
isPrinted = true;
}
return gic.isAlertOnLogin();
}
return false;
} catch (NoModuleException | IncorrectAdapterTypeException e) {
if (Nucleus.getNucleus().isDebugMode()) {
e.printStackTrace();
}
return false;
}
}
Aggregations