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.Player
Get aPlayer
based on an identifier of name UUID or selector.static @Nullable org.bukkit.entity.Player
Get aPlayer
based on an identifier of name UUID or selector.static @Nullable org.bukkit.entity.Player
Get aPlayer
based on player name.static @Nullable org.bukkit.entity.Player
getBySelector
(@NotNull String playerSelector, @NotNull org.bukkit.command.CommandSender sender) Get aPlayer
based on vanilla selectors.static @Nullable org.bukkit.entity.Player
Get aPlayer
based on player UUID.static @Nullable org.bukkit.entity.Player
Get aPlayer
based on playerUUID.static @NotNull List
<org.bukkit.entity.Player> Get multiplePlayer
based on many identifiers of name UUID or selector.static @NotNull List
<org.bukkit.entity.Player> Get multiplePlayer
based 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 multiplePlayer
based 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 aPlayer
based 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 aPlayer
based 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 multiplePlayer
based 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
Player
found.
-
getMulti
@NotNull public static @NotNull List<org.bukkit.entity.Player> getMulti(@Nullable @Nullable String playerIdentifiers, @NotNull @NotNull org.bukkit.command.CommandSender sender) Get multiplePlayer
based 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
Player
found.
-
getByName
@Nullable public static @Nullable org.bukkit.entity.Player getByName(@NotNull @NotNull String playerName) Get aPlayer
based 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 aPlayer
based 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 aPlayer
based 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 aPlayer
based 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 multiplePlayer
based on vanilla selectors.- Parameters:
playerSelector
- A target selector, usually starts with an '@'.sender
- Target sender for selector.- Returns:
- A list of all the
Player
found.
-