RarityManager

public final class RarityManager

Loads and serves user-defined rarity tiers from config.yml.

Constructors

Link copied to clipboard
public void RarityManager(@NotNull() @NotNull() Plugin plugin)
Constructs a new RarityManager.

Functions

Link copied to clipboard
@NotNull()
public @NotNull() Rarity getDefaultRarity()
Gets the default rarity (the one with the lowest priority).
Link copied to clipboard
@NotNull()
public @NotNull() List<Rarity> getRarities()
Gets all loaded rarities, sorted by priority.
Link copied to clipboard
@NotNull()
public @NotNull() Optional<Rarity> getRarity(@NotNull() @NotNull() String id)
Gets a rarity by its ID.
Link copied to clipboard
@NotNull()
public @NotNull() Map<String, Rarity> getRarityMap()
Gets an unmodifiable map of all rarities.
Link copied to clipboard
public boolean isEnabled()
Checks if rarity features are enabled.
Link copied to clipboard
public void load(@NotNull() @NotNull() FileConfiguration config)
Loads rarities from the given configuration.
Link copied to clipboard
@NotNull()
public @NotNull() Rarity resolve(@Nullable() @Nullable() String id)
Resolves a rarity ID to a Rarity object, falling back to default if not found.