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 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. Returns true if the world is blacklisted, false otherwise. Takes into account whether the spawn group uses a whitelist or blacklist approach.
      Parameters:
      group - The spawn group to check against.
      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.
    • withinSpawnLimit

      public static Boolean withinSpawnLimit(SpawnGroup group, org.bukkit.entity.Player player, String id)