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

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2021-06-26 09:58:21 +10:00
parent 3835d0824b
commit 10f782354b
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.
*