Package dev.demeng.pluginbase
Class Players
java.lang.Object
dev.demeng.pluginbase.Players
Utility for operations involving multiple players.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Collection<org.bukkit.entity.Player>all()Gets all players on the server.static voidApplies a given action to all players on the server.static voidforEachInRange(@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>stream()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.
-
Constructor Details
-
Players
public Players()
-
-
Method Details
-
all
Gets all players on the server.- Returns:
- All players on the server
-
stream
Gets a stream of all players on the server.- Returns:
- A stream of all players on the server
-
forEach
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 pointradius- 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 pointradius- The radiusconsumer- The action to apply
-