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. */ @NonnullpublicGeoManagergetGeoManager() /** * @return true if server is under attack, false if not. */publicbooleanisUnderAttack() /** * @return An immutable Collection which contains whitelisted addresses. */ @NonnullpublicCollection<String>getWhitelistedAddresses() /** * @return An immutable Collection which contains blacklisted addresses. */ @NonnullpublicCollection<String>getBlacklistedAddresses() /** * @return An immutable Collection which contains whitelisted nicknames. */ @NonnullpublicCollection<String>getWhitelistedNicknames() /** * @return An immutable Collection which contains blacklisted nicknames. */ @NonnullpublicCollection<String>getBlacklistedNicknames() /** * @return Current connections per second. */publicintgetConnectionsPerSecond() /** * Adds the provided address to blacklist, if it is not already there. */publicvoidblacklistAddress(String address) /** * Adds the provided address to whitelist. * Also, removes the address from blacklist. */publicvoidwhitelistAddress(String address) /** * Checks if the EpicGuard has been initialized already. */publicvoidisAvailable()