Skip to main content
The Settings interface provides access to plugin configuration and methods for managing the maintenance whitelist.

Obtaining the Settings Instance

Get the Settings instance from the main Maintenance API:

Methods

isMaintenance

Returns whether maintenance is currently enabled.
boolean
true if maintenance is currently enabled, false otherwise

isEnablePingMessages

Checks if custom ping messages during maintenance should be displayed.
boolean
true if custom ping messages are enabled, false otherwise

isJoinNotifications

Checks if join notifications are enabled.
boolean
Value of the send-join-notification config field

hasCustomIcon

Checks if a custom maintenance server icon is configured.
boolean
Value of the custom-maintenance-icon config field

getWhitelistedPlayers

Returns a map of all maintenance-whitelisted players.
Map<UUID, String>
Map of player UUIDs to their saved names
The player names in the returned map might be outdated if a player has changed their name.

isWhitelisted

Checks if a player UUID is on the maintenance whitelist.
UUID
required
The UUID of the player to check
boolean
true if the UUID is whitelisted, false otherwise

addWhitelistedPlayer

Adds a player to the maintenance whitelist.
UUID
required
The UUID of the player to add
String
required
The name of the player to add
boolean
true if the player was successfully added, false if already on the whitelist

removeWhitelistedPlayer (UUID)

Removes a player from the maintenance whitelist by UUID.
UUID
required
The UUID of the player to remove
boolean
true if the player was successfully removed, false otherwise

removeWhitelistedPlayer (String)

This method is deprecated. Use removeWhitelistedPlayer(UUID) instead. If a player changes their name, the list will still contain the old name.
Removes a player from the maintenance whitelist by name.
String
required
The name of the player to remove (with original case)
boolean
true if the player was successfully removed, false otherwise

reloadConfigs

Reloads all configuration files including maintenance icon, config, language file, and whitelisted players.
void
This method does not return a value

debugEnabled

Checks if debug mode is enabled in the configuration.
boolean
true if the debug config value is set to true, false otherwise

Complete Example

Here’s a complete example showing whitelist management: