Package net.winmister332.libs.player
Class PlayerBridge
java.lang.Object
net.winmister332.libs.player.PlayerBridge
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.OfflinePlayer[]Gets a collection of players who are offline.static org.bukkit.entity.Player[]Gets a collection of all players who are currently online.static org.bukkit.entity.PlayerGets the player with the specified name or UUID.static org.bukkit.entity.PlayergetPlayerByName(String player) Gets a player with the associated name if one exists.static org.bukkit.entity.PlayergetPlayerByUUID(String uuid) Gets a player with the associated UUID if one exists.static org.bukkit.entity.PlayergetPlayerByUUID(UUID uuid) Gets a player with the associated UUID if one exists.static booleanisPlayerInRangeOf(org.bukkit.entity.Player player, LocationRange range) Checks if the player is in a specific block range.static booleanisPlayerInRangeOf(org.bukkit.entity.Player player, org.bukkit.Location location, int range) Checks if the player is in a specific block range.static booleanisPlayerOnline(String nameOrUUID) Checks if a player with the specified name or UUID is online.static booleanplayerOnBlock(org.bukkit.entity.Player player, org.bukkit.Location pos) Checks if the player is on the block at the specified location.
-
Constructor Details
-
PlayerBridge
public PlayerBridge()
-
-
Method Details
-
getPlayerByName
Gets a player with the associated name if one exists.- Parameters:
player- The players' name to check.- Returns:
- The player with the associated name.
-
getPlayerByUUID
Gets a player with the associated UUID if one exists.- Parameters:
uuid- The UUID to check.- Returns:
- The player with the associated ID of one exists.
-
getPlayerByUUID
Gets a player with the associated UUID if one exists.- Parameters:
uuid- The UUID to check.- Returns:
- The player with the associated ID of one exists.
-
getPlayer
Gets the player with the specified name or UUID.- Parameters:
nameOrUUID- The name or UUID to check.- Returns:
- The player with the associated name or UUID.
-
getOnlinePlayers
public static org.bukkit.entity.Player[] getOnlinePlayers()Gets a collection of all players who are currently online.- Returns:
- A collection of @see Player who are on the server.
-
getOfflinePlayers
public static org.bukkit.OfflinePlayer[] getOfflinePlayers()Gets a collection of players who are offline.- Returns:
- A collection of @see OfflinePlayer
-
isPlayerOnline
Checks if a player with the specified name or UUID is online.- Parameters:
nameOrUUID- The name or UUID of the player to get and check.- Returns:
- True if the player is found with the name or UUID and they're online.
-
playerOnBlock
public static boolean playerOnBlock(org.bukkit.entity.Player player, org.bukkit.Location pos) Checks if the player is on the block at the specified location.- Parameters:
player- The player to check.pos- The position of the block to check.- Returns:
- True if the player is at the specified block coords.
-
isPlayerInRangeOf
public static boolean isPlayerInRangeOf(org.bukkit.entity.Player player, org.bukkit.Location location, int range) Checks if the player is in a specific block range.- Parameters:
player- The player to check.location- The location of the initial block to check.range- The range from the block to check.- Returns:
- True if the player is within range of the specified block location.
-
isPlayerInRangeOf
Checks if the player is in a specific block range.- Parameters:
player- The player to check.range- The range handler class to compare.- Returns:
- True if the player is within the specified range.
-