diff --git a/proxy/src/main/java/com/glyart/authmevelocity/proxy/AuthmeVelocityAPI.java b/proxy/src/main/java/com/glyart/authmevelocity/proxy/AuthmeVelocityAPI.java index 3df16a2..6e8f869 100644 --- a/proxy/src/main/java/com/glyart/authmevelocity/proxy/AuthmeVelocityAPI.java +++ b/proxy/src/main/java/com/glyart/authmevelocity/proxy/AuthmeVelocityAPI.java @@ -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 predicate){ - plugin.loggedPlayers.removeIf(uuid -> predicate.test(plugin.getProxy().getPlayer(uuid).orElseThrow())); + plugin.loggedPlayers.removeIf(uuid -> predicate.test(plugin.getProxy().getPlayer(uuid).orElse(null))); } /**