Class Players

java.lang.Object
dev.demeng.pluginbase.Players

public final class Players extends Object
Utility for operations involving multiple players.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull Collection<org.bukkit.entity.Player>
    all()
    Gets all players on the server.
    static void
    forEach(@NotNull Consumer<org.bukkit.entity.Player> consumer)
    Applies a given action to all players on the server.
    static void
    forEachInRange(@NotNull org.bukkit.Location center, double radius, @NotNull Consumer<org.bukkit.entity.Player> consumer)
    Applies an action to all players within a given radius of a point.
    static @NotNull Stream<org.bukkit.entity.Player>
    Gets a stream of all players on the server.
    static @NotNull Stream<org.bukkit.entity.Player>
    streamInRange(@NotNull org.bukkit.Location center, double radius)
    Gets a stream of all players within a given radius of a point.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Players

      public Players()
  • Method Details

    • all

      @NotNull public static @NotNull Collection<org.bukkit.entity.Player> all()
      Gets all players on the server.
      Returns:
      All players on the server
    • stream

      @NotNull public static @NotNull Stream<org.bukkit.entity.Player> stream()
      Gets a stream of all players on the server.
      Returns:
      A stream of all players on the server
    • forEach

      public static void forEach(@NotNull @NotNull Consumer<org.bukkit.entity.Player> consumer)
      Applies a given action to all players on the server.
      Parameters:
      consumer - The action to apply
    • streamInRange

      @NotNull public static @NotNull Stream<org.bukkit.entity.Player> streamInRange(@NotNull @NotNull org.bukkit.Location center, double radius)
      Gets a stream of all players within a given radius of a point.
      Parameters:
      center - The point
      radius - The radius
      Returns:
      A stream of players
    • forEachInRange

      public static void forEachInRange(@NotNull @NotNull org.bukkit.Location center, double radius, @NotNull @NotNull Consumer<org.bukkit.entity.Player> consumer)
      Applies an action to all players within a given radius of a point.
      Parameters:
      center - The point
      radius - The radius
      consumer - The action to apply