Package net.eternalclient.api.accessors
Class Players
- java.lang.Object
-
- net.eternalclient.api.accessors.Players
-
public class Players extends java.lang.Object
This class provides various methods for retrieving and manipulating information about players.
-
-
Constructor Summary
Constructors Constructor Description Players()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<Player>
all()
Returns a list of all valid players in the game.static java.util.List<Player>
all(java.util.function.Predicate<Player> predicate)
Returns a list of all players that satisfy the given predicate.static Player
closest(int ID)
Finds the closest player with the specified ID.static Player
closest(int ID, Positionable positionable)
Returns the closest Player object with the specified ID to the given Positionable object.static Player
closest(java.lang.String name)
Returns the player with the closest name match to the given name.static Player
closest(java.lang.String name, Positionable positionable)
Returns the closest Player object with the given name to the specified Positionable object.static Player
closest(java.util.function.Predicate<Player> predicate)
Returns the closest Player object that satisfies the given predicate.static Player
closest(java.util.function.Predicate<Player> predicate, Positionable positionable)
Finds the closest player that matches the given predicate.static Player
localPlayer()
Returns the local player.static java.util.stream.Stream<Player>
stream()
Returns a stream of all players in the game.static java.util.stream.Stream<Player>
stream(java.util.function.Predicate<Player> predicate)
Returns a stream of all players that satisfy the given predicate.
-
-
-
Method Detail
-
all
public static java.util.List<Player> all()
Returns a list of all valid players in the game.- Returns:
- a list of players
-
all
public static java.util.List<Player> all(java.util.function.Predicate<Player> predicate)
Returns a list of all players that satisfy the given predicate.- Parameters:
predicate
- the predicate that determines if a player is valid- Returns:
- a list of players that satisfy the predicate
-
stream
public static java.util.stream.Stream<Player> stream()
Returns a stream of all players in the game.- Returns:
- a stream of all players, no null values
-
stream
public static java.util.stream.Stream<Player> stream(java.util.function.Predicate<Player> predicate)
Returns a stream of all players that satisfy the given predicate.- Parameters:
predicate
- the predicate used to filter the players- Returns:
- a stream of players that satisfy the predicate, no null values
-
closest
public static Player closest(java.util.function.Predicate<Player> predicate)
Returns the closest Player object that satisfies the given predicate.- Parameters:
predicate
- the predicate used to filter the Players- Returns:
- the closest Player object that satisfies the given predicate, or null if no such Player exists
-
closest
public static Player closest(java.util.function.Predicate<Player> predicate, Positionable positionable)
Finds the closest player that matches the given predicate.- Parameters:
predicate
- the predicate used to filter playerspositionable
- the positionable object to measure distance from- Returns:
- the closest player that matches the predicate, or null if no player found
-
closest
public static Player closest(java.lang.String name)
Returns the player with the closest name match to the given name.- Parameters:
name
- the name to search for- Returns:
- the player with the closest name match
-
closest
public static Player closest(java.lang.String name, Positionable positionable)
Returns the closest Player object with the given name to the specified Positionable object.- Parameters:
name
- the name of the Player to search forpositionable
- the Positionable object to determine the proximity from- Returns:
- the closest Player object with the given name, null if not found or if the plane of the Positionable object does not match the current Map's plane
-
closest
public static Player closest(int ID)
Finds the closest player with the specified ID.- Parameters:
ID
- the ID of the player to find- Returns:
- the closest player with the specified ID
-
closest
public static Player closest(int ID, Positionable positionable)
Returns the closest Player object with the specified ID to the given Positionable object.- Parameters:
ID
- the ID of the Player to findpositionable
- the Positionable object to check against- Returns:
- the closest Player object with the specified ID to the given Positionable object, or null if not found
-
localPlayer
public static Player localPlayer()
Returns the local player.- Returns:
- the local player
-
-