Package me.yleoft.zAPI.utils
Class PlayerUtils
java.lang.Object
me.yleoft.zAPI.utils.PlayerUtils
Utility class for player-related operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.OfflinePlayer
getOfflinePlayer
(@NotNull String name) Retrieves an OfflinePlayer by name, using the Folia API if available.static org.bukkit.OfflinePlayer
getOfflinePlayer
(@NotNull UUID uuid) Retrieves an OfflinePlayer by name, using the Folia API if available.static void
performCommand
(@Nullable org.bukkit.entity.Player player, @NotNull String command) static void
performCommand
(@Nullable org.bukkit.entity.Player player, @NotNull String command, boolean chanceParsed) Performs a custom command to the player or console.static void
performCommand
(@Nullable org.bukkit.entity.Player p, @NotNull List<String> commands)
-
Constructor Details
-
PlayerUtils
public PlayerUtils()
-
-
Method Details
-
getOfflinePlayer
Retrieves an OfflinePlayer by name, using the Folia API if available.- Parameters:
uuid
- the name of the player- Returns:
- the OfflinePlayer object, or null if not found
-
getOfflinePlayer
Retrieves an OfflinePlayer by name, using the Folia API if available.- Parameters:
name
- the name of the player- Returns:
- the OfflinePlayer object, or null if not found
-
performCommand
public static void performCommand(@Nullable @Nullable org.bukkit.entity.Player player, @NotNull @NotNull String command, boolean chanceParsed) Performs a custom command to the player or console.- Parameters:
player
- the player to perform the command as, or null for consolecommand
- the command to performchanceParsed
- whether the command has already been parsed for chance
-
performCommand
public static void performCommand(@Nullable @Nullable org.bukkit.entity.Player player, @NotNull @NotNull String command) -
performCommand
-