Class PlayerList

java.lang.Object
io.github.bakedlibs.dough.common.PlayerList

public final class PlayerList extends Object
Some utility methods dealing with the Player list.
Author:
TheBusyBiscuit
  • Method Details

    • stream

      @Nonnull public static Stream<Player> stream()
      This method returns a Stream containing all online Players
      Returns:
      A Stream of online Players
    • findByName

      @Nonnull public static Optional<Player> findByName(@Nonnull String name)
      This method returns an Optional that describes whether a Player with the given Name is currently online or not.
      Parameters:
      name - The name of the Player
      Returns:
      An Optional describing the player (or an empty Optional)
    • findPermitted

      @Nonnull public static Set<Player> findPermitted(@Nonnull String permission)
      This method returns a Set of online Players that have the specified Permission.
      Parameters:
      permission - The permission the Players should have
      Returns:
      A Set of Players
    • isOnline

      public static boolean isOnline(@Nonnull String name)
      This method checks if a Player with the given name is currently online on the server.
      Parameters:
      name - The Name of the Player
      Returns:
      Whether the Player is online