Package valorless.rarespawns
Class RareSpawns
java.lang.Object
valorless.rarespawns.RareSpawns
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
FieldsModifier and TypeFieldDescriptionTracks all cached rare entities by their UUID. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetRareID(org.bukkit.entity.Entity entity) Gets the rare ID from a rare entity.static StringgetRareID(org.bukkit.inventory.ItemStack item) Gets the rare ID from a rare item.static booleanisRare(org.bukkit.entity.Entity entity) Checks if the given entity is a rare entity.static booleanisRare(org.bukkit.inventory.ItemStack item) Checks if the given item is a rare item.static BooleanisWorldBlacklisted(SpawnGroup group, org.bukkit.World world) Checks if the given world is blacklisted for rare spawns.static BooleanwithinSpawnLimit(SpawnGroup group, org.bukkit.entity.Player player) Checks if the player is within the rare spawn limit in their area.
-
Field Details
-
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
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
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
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
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.
-