Class PlayerBridge

java.lang.Object
net.winmister332.libs.player.PlayerBridge

public final class PlayerBridge extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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.Player
    getPlayer(String nameOrUUID)
    Gets the player with the specified name or UUID.
    static org.bukkit.entity.Player
    Gets a player with the associated name if one exists.
    static org.bukkit.entity.Player
    Gets a player with the associated UUID if one exists.
    static org.bukkit.entity.Player
    Gets a player with the associated UUID if one exists.
    static boolean
    isPlayerInRangeOf(org.bukkit.entity.Player player, LocationRange range)
    Checks if the player is in a specific block range.
    static boolean
    isPlayerInRangeOf(org.bukkit.entity.Player player, org.bukkit.Location location, int range)
    Checks if the player is in a specific block range.
    static boolean
    isPlayerOnline(String nameOrUUID)
    Checks if a player with the specified name or UUID is online.
    static boolean
    playerOnBlock(org.bukkit.entity.Player player, org.bukkit.Location pos)
    Checks if the player is on the block at the specified location.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PlayerBridge

      public PlayerBridge()
  • Method Details

    • getPlayerByName

      public static org.bukkit.entity.Player getPlayerByName(String player)
      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

      public static org.bukkit.entity.Player getPlayerByUUID(UUID uuid)
      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

      public static org.bukkit.entity.Player getPlayerByUUID(String uuid)
      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

      public static org.bukkit.entity.Player getPlayer(String nameOrUUID)
      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

      public static boolean isPlayerOnline(String nameOrUUID)
      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

      public static boolean isPlayerInRangeOf(org.bukkit.entity.Player player, LocationRange range)
      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.