Class PlayerFinder
java.lang.Object
org.mvplugins.multiverse.core.utils.PlayerFinder
Helper class to get
Player from name, UUID or Selectors.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable org.bukkit.entity.PlayerGet aPlayerbased on an identifier of name UUID or selector.static @Nullable org.bukkit.entity.PlayerGet aPlayerbased on an identifier of name UUID or selector.static @Nullable org.bukkit.entity.PlayerGet aPlayerbased on player name.static @Nullable org.bukkit.entity.PlayergetBySelector(@NotNull String playerSelector, @NotNull org.bukkit.command.CommandSender sender) Get aPlayerbased on vanilla selectors.static @Nullable org.bukkit.entity.PlayerGet aPlayerbased on player UUID.static @Nullable org.bukkit.entity.PlayerGet aPlayerbased on playerUUID.static @NotNull List<org.bukkit.entity.Player> Get multiplePlayerbased on many identifiers of name UUID or selector.static @NotNull List<org.bukkit.entity.Player> Get multiplePlayerbased on many identifiers of name UUID or selector.static @Nullable List<org.bukkit.entity.Player> getMultiBySelector(@NotNull String playerSelector, @NotNull org.bukkit.command.CommandSender sender) Get multiplePlayerbased on vanilla selectors.
-
Constructor Details
-
PlayerFinder
public PlayerFinder()
-
-
Method Details
-
get
@Nullable public static @Nullable org.bukkit.entity.Player get(@Nullable @Nullable String playerIdentifier) Get aPlayerbased on an identifier of name UUID or selector.- Parameters:
playerIdentifier- An identifier of name UUID or selector.- Returns:
- The player if found, else null.
-
get
@Nullable public static @Nullable org.bukkit.entity.Player get(@Nullable @Nullable String playerIdentifier, @NotNull @NotNull org.bukkit.command.CommandSender sender) Get aPlayerbased on an identifier of name UUID or selector.- Parameters:
playerIdentifier- An identifier of name UUID or selector.sender- Target sender for selector.- Returns:
- The player if found, else null.
-
getMulti
@NotNull public static @NotNull List<org.bukkit.entity.Player> getMulti(@Nullable @Nullable String playerIdentifiers) Get multiplePlayerbased on many identifiers of name UUID or selector.- Parameters:
playerIdentifiers- An identifier of multiple names, UUIDs or selectors, separated by comma.- Returns:
- A list of all the
Playerfound.
-
getMulti
@NotNull public static @NotNull List<org.bukkit.entity.Player> getMulti(@Nullable @Nullable String playerIdentifiers, @NotNull @NotNull org.bukkit.command.CommandSender sender) Get multiplePlayerbased on many identifiers of name UUID or selector.- Parameters:
playerIdentifiers- An identifier of multiple names, UUIDs or selectors, separated by comma.sender- Target sender for selector.- Returns:
- A list of all the
Playerfound.
-
getByName
@Nullable public static @Nullable org.bukkit.entity.Player getByName(@NotNull @NotNull String playerName) Get aPlayerbased on player name.- Parameters:
playerName- Name of aPlayer.- Returns:
- The player if found, else null.
-
getByUuid
@Nullable public static @Nullable org.bukkit.entity.Player getByUuid(@NotNull @NotNull String playerUuid) Get aPlayerbased on player UUID.- Parameters:
playerUuid- UUID of a player.- Returns:
- The player if found, else null.
-
getByUuid
@Nullable public static @Nullable org.bukkit.entity.Player getByUuid(@NotNull @NotNull UUID playerUuid) Get aPlayerbased on playerUUID.- Parameters:
playerUuid- UUID of a player.- Returns:
- The player if found, else null.
-
getBySelector
@Nullable public static @Nullable org.bukkit.entity.Player getBySelector(@NotNull @NotNull String playerSelector, @NotNull @NotNull org.bukkit.command.CommandSender sender) Get aPlayerbased on vanilla selectors.- Parameters:
playerSelector- A target selector, usually starts with an '@'.sender- Target sender for selector.- Returns:
- The player if only one found, else null.
-
getMultiBySelector
@Nullable public static @Nullable List<org.bukkit.entity.Player> getMultiBySelector(@NotNull @NotNull String playerSelector, @NotNull @NotNull org.bukkit.command.CommandSender sender) Get multiplePlayerbased on vanilla selectors.- Parameters:
playerSelector- A target selector, usually starts with an '@'.sender- Target sender for selector.- Returns:
- A list of all the
Playerfound.
-