Interface WhitelistManager
public interface WhitelistManager
A service for managing the whitelist of allowed players.
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(PlayerProfile profile) Adds a profile to the list.default booleanAdds an identity to the list.default booleanChecks whether an identity may connect as far as the whitelist is concerned.booleanChecks whether an identity is listed, regardless of whether the whitelist is enforced.booleanenabled()Checks whether the whitelist is being enforced.booleanenabled(boolean enabled) Starts or stops enforcing the whitelist.entries()Gets the listed identities.voidload()Loads the whitelist.booleanRemoves an identity from the list.intGets how many identities are listed.
-
Method Details
-
load
void load()Loads the whitelist. -
enabled
@Contract(pure=true) boolean enabled()Checks whether the whitelist is being enforced.- Returns:
truewhen only listed players may connect- Since:
- 0.1.0
-
enabled
boolean enabled(boolean enabled) Starts or stops enforcing the whitelist.This does not disconnect anyone. Fidorial kicks the players who are no longer allowed separately, so that a change made by other means does not carry that side effect.
- Parameters:
enabled- whether the whitelist should be enforced- Returns:
truewhen the setting actually changed- Since:
- 0.1.0
-
contains
Checks whether an identity is listed, regardless of whether the whitelist is enforced.- Parameters:
uuid- the player identity- Returns:
truewhen the identity is on the list- Since:
- 0.1.0
-
allows
Checks whether an identity may connect as far as the whitelist is concerned.This is the question the login check asks, and the only one it asks. The whitelist is enforced for everyone once enabled: operators are not exempt, so an operator who is not listed is refused like anyone else.
- Parameters:
uuid- the player identity- Returns:
truewhen the whitelist is not enforced, or the identity is listed- Since:
- 0.1.0
-
add
Adds a profile to the list.- Parameters:
profile- the profile to allow- Returns:
truewhen the identity was not already listed- Since:
- 0.1.0
-
add
-
remove
Removes an identity from the list.- Parameters:
uuid- the identity to remove- Returns:
truewhen the identity was actually listed- Since:
- 0.1.0
-
entries
Gets the listed identities.- Returns:
- the entries, ordered by name
- Since:
- 0.1.0
-
totalEntries
@Contract(pure=true) int totalEntries()Gets how many identities are listed.- Returns:
- the number of entries
- Since:
- 0.1.0
-