SPIGOT-6605: Add method to access value of enforce-whitelist

This commit is contained in:
md_5 2021-06-26 09:58:21 +10:00
parent ecf35dd77a
commit 214b9f14e8
No known key found for this signature in database
GPG key ID: E8E901AC7C617C11
2 changed files with 44 additions and 0 deletions

View file

@ -253,6 +253,30 @@ public final class Bukkit {
server.setWhitelist(value);
}
/**
* Gets whether the server whitelist is enforced.
*
* If the whitelist is enforced, non-whitelisted players will be
* disconnected when the server whitelist is reloaded.
*
* @return whether the server whitelist is enforced
*/
public static boolean isWhitelistEnforced() {
return server.isWhitelistEnforced();
}
/**
* Sets if the server whitelist is enforced.
*
* If the whitelist is enforced, non-whitelisted players will be
* disconnected when the server whitelist is reloaded.
*
* @param value true for enforced, false for not
*/
public static void setWhitelistEnforced(boolean value) {
server.setWhitelistEnforced(value);
}
/**
* Gets a list of whitelisted players.
*

View file

@ -208,6 +208,26 @@ public interface Server extends PluginMessageRecipient {
*/
public void setWhitelist(boolean value);
/**
* Gets whether the server whitelist is enforced.
*
* If the whitelist is enforced, non-whitelisted players will be
* disconnected when the server whitelist is reloaded.
*
* @return whether the server whitelist is enforced
*/
public boolean isWhitelistEnforced();
/**
* Sets if the server whitelist is enforced.
*
* If the whitelist is enforced, non-whitelisted players will be
* disconnected when the server whitelist is reloaded.
*
* @param value true for enforced, false for not
*/
public void setWhitelistEnforced(boolean value);
/**
* Gets a list of whitelisted players.
*