mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-27 02:57:53 +01:00
I forget this one, Fix #507
This commit is contained in:
parent
c3e3bdf3a4
commit
760d2a9fe6
@ -28,17 +28,13 @@ public class AuthMeServerListener implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onServerPing(ServerListPingEvent event) {
|
||||
if (!Settings.enableProtection) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Settings.countriesBlacklist.isEmpty() || !Settings.countries.isEmpty()){
|
||||
String countryCode = GeoLiteAPI.getCountryCode(event.getAddress().getHostAddress());
|
||||
if( Settings.countriesBlacklist.contains(countryCode)) {
|
||||
event.setMotd(m.retrieveSingle(MessageKey.COUNTRY_BANNED_ERROR));
|
||||
return;
|
||||
}
|
||||
if (!Settings.countries.contains(countryCode)) {
|
||||
if (Settings.enableProtection && !Settings.countries.contains(countryCode)) {
|
||||
event.setMotd(m.retrieveSingle(MessageKey.COUNTRY_BANNED_ERROR));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user