Make sure that EpicGuard is fully loaded before using any methods from the API.
While you can obtain the instance of EpicGuardAPI, trying to use any methods will throw an exception, if EpicGuard is not initialized yet.
The EpicGuardAPI class is located in the me.xneox.epicguard.core package.
This is how you can obtain an instance of the API.
EpicGuardAPI api = EpicGuardAPI.INSTANCE;
API methods
Here are the methods available for use. If you feel like there's something missing in here, contact us in our support Discord.
/**
* The {@link GeoManager} class contains methods that you may
* find useful if you want to check country/city of an address.
*/
@Nonnull
public GeoManager getGeoManager()
/**
* @return true if server is under attack, false if not.
*/
public boolean isUnderAttack()
/**
* @return An immutable Collection which contains whitelisted addresses.
*/
@Nonnull
public Collection<String> getWhitelistedAddresses()
/**
* @return An immutable Collection which contains blacklisted addresses.
*/
@Nonnull
public Collection<String> getBlacklistedAddresses()
/**
* @return An immutable Collection which contains whitelisted nicknames.
*/
@Nonnull
public Collection<String> getWhitelistedNicknames()
/**
* @return An immutable Collection which contains blacklisted nicknames.
*/
@Nonnull
public Collection<String> getBlacklistedNicknames()
/**
* @return Current connections per second.
*/
public int getConnectionsPerSecond()
/**
* Adds the provided address to blacklist, if it is not already there.
*/
public void blacklistAddress(String address)
/**
* Adds the provided address to whitelist.
* Also, removes the address from blacklist.
*/
public void whitelistAddress(String address)
/**
* Checks if the EpicGuard has been initialized already.
*/
public void isAvailable()