feat(api): Implement AuthmeVelocityAPI#isNotLogged
This commit is contained in:
parent
6365866e59
commit
64f4fd5176
@ -19,6 +19,7 @@ public final class AuthmeVelocityAPI {
|
||||
this.plugin = plugin;
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the player is logged in or not
|
||||
* @param player the player
|
||||
@ -28,6 +29,15 @@ public final class AuthmeVelocityAPI {
|
||||
return plugin.loggedPlayers.contains(player.getUniqueId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the player is not logged
|
||||
* @param player the player
|
||||
* @return if the player is not logged
|
||||
*/
|
||||
public boolean isNotLogged(@NotNull Player player){
|
||||
return !plugin.loggedPlayers.contains(player.getUniqueId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a player to the list of logged in players
|
||||
* @param player the new logged player
|
||||
@ -51,7 +61,7 @@ public final class AuthmeVelocityAPI {
|
||||
* @param predicate the condition
|
||||
*/
|
||||
public void removePlayerIf(@NotNull Predicate<Player> predicate){
|
||||
plugin.loggedPlayers.removeIf(uuid -> predicate.test(plugin.getProxy().getPlayer(uuid).orElseThrow()));
|
||||
plugin.loggedPlayers.removeIf(uuid -> predicate.test(plugin.getProxy().getPlayer(uuid).orElse(null)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user