WhitelistAPI Documentation
The WhitelistAPI
class provides an interface to manage the whitelist system used in the WhitelistPlus
plugin.
How to Access the API
To use the API in your own plugin, you can access it through the static method in the main plugin class:
import io.github.undeffineddev.whitelistplus.api.IWhitelistAPI;
import io.github.undeffineddev.whitelistplus.WhitelistPlus;
IWhitelistAPI api = WhitelistPlus.getAPI();
Make sure that WhitelistPlus is listed as a dependency in your plugin.yml
:
depend: [WhitelistPlus]
Constructor
public WhitelistAPI(WhitelistPlus plugin)
Initializes the API with the main plugin instance. This is handled internally by WhitelistPlus.
Methods
String getVersion()
String getVersion()
Returns the version of the plugin.
double getAPIVersion()
double getAPIVersion()
Returns the version number of the API.
void setWhitelist(boolean status)
void setWhitelist(boolean status)
Enables or disables the whitelist. Optionally broadcasts a message and kicks unwhitelisted players depending on configuration.
void addPlayer(String name)
void addPlayer(String name)
Adds a player to the whitelist by their name.
void removePlayer(String name)
void removePlayer(String name)
Removes a player from the whitelist by their name.
Set<WhitelistEntry> getPlayers()
Set<WhitelistEntry> getPlayers()
Returns a set of all whitelisted players.
WhitelistEntry getPlayer(String name)
WhitelistEntry getPlayer(String name)
Returns the whitelist entry of a player by name, or null
if not found.
boolean isWhitelisted(String name)
boolean isWhitelisted(String name)
Checks if a player with the given name is whitelisted.
void addPlayer(UUID uuid)
void addPlayer(UUID uuid)
Adds a player to the whitelist by their UUID.
void removePlayer(UUID uuid)
void removePlayer(UUID uuid)
Removes a player from the whitelist by their UUID.
WhitelistEntry getPlayer(UUID uuid)
WhitelistEntry getPlayer(UUID uuid)
Returns the whitelist entry of a player by UUID, or null
if not found.
boolean isWhitelisted(UUID uuid)
boolean isWhitelisted(UUID uuid)
Checks if a player with the given UUID is whitelisted.
boolean isActive()
boolean isActive()
Returns whether the whitelist is currently enabled.
FileConfiguration getLanguageConfiguration()
FileConfiguration getLanguageConfiguration()
Returns the plugin's language configuration file.
FileConfiguration getConfiguration()
FileConfiguration getConfiguration()
Returns the main plugin configuration file.
String getStorageType()
String getStorageType()
Returns the current storage type used for whitelist entries (e.g., YAML, MySQL).
Last updated