Class RareSpawns

java.lang.Object
valorless.rarespawns.RareSpawns

public class RareSpawns extends Object
Main utility class for RareSpawns plugin. Provides methods for identifying rare entities and items, checking world blacklist, spawn limits, and finding nearest players.

Rare entities are tracked in cachedRares and identified by a persistent data tag.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static HashMap<UUID,org.bukkit.entity.Entity>
    Tracks all cached rare entities by their UUID.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    getRareID(org.bukkit.entity.Entity entity)
    Gets the rare ID from a rare entity.
    static String
    getRareID(org.bukkit.inventory.ItemStack item)
    Gets the rare ID from a rare item.
    static boolean
    isRare(org.bukkit.entity.Entity entity)
    Checks if the given entity is a rare entity.
    static boolean
    isRare(org.bukkit.inventory.ItemStack item)
    Checks if the given item is a rare item.
    static Boolean
    isWorldBlacklisted(SpawnGroup group, org.bukkit.World world)
    Checks if the given world is blacklisted for rare spawns.
    static Boolean
    withinSpawnLimit(SpawnGroup group, org.bukkit.entity.Player player)
    Checks if the player is within the rare spawn limit in their area.

    Methods inherited from class java.lang.Object

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

    • cachedRares

      public static HashMap<UUID,org.bukkit.entity.Entity> cachedRares
      Tracks all cached rare entities by their UUID. Key: UUID of the entity, Value: Entity instance.
  • Constructor Details

    • RareSpawns

      public RareSpawns()
  • Method Details

    • isRare

      public static boolean isRare(org.bukkit.entity.Entity entity)
      Checks if the given entity is a rare entity.
      Parameters:
      entity - The entity to check.
      Returns:
      True if the entity is rare, false otherwise.
    • isRare

      public static boolean isRare(org.bukkit.inventory.ItemStack item)
      Checks if the given item is a rare item.
      Parameters:
      item - The item to check.
      Returns:
      True if the item is rare, false otherwise.
    • getRareID

      public static String getRareID(org.bukkit.entity.Entity entity)
      Gets the rare ID from a rare entity.
      Parameters:
      entity - The entity to get the ID from.
      Returns:
      The rare ID string, or null if not rare.
    • getRareID

      public static String getRareID(org.bukkit.inventory.ItemStack item)
      Gets the rare ID from a rare item.
      Parameters:
      item - The item to get the ID from.
      Returns:
      The rare ID string, or null if not rare.
    • isWorldBlacklisted

      public static Boolean isWorldBlacklisted(SpawnGroup group, org.bukkit.World world)
      Checks if the given world is blacklisted for rare spawns.
      Parameters:
      world - The world to check.
      Returns:
      True if the world is blacklisted, false otherwise.
    • withinSpawnLimit

      public static Boolean withinSpawnLimit(SpawnGroup group, org.bukkit.entity.Player player)
      Checks if the player is within the rare spawn limit in their area.
      Parameters:
      player - The player to check.
      Returns:
      True if within spawn limit, false otherwise.