Packages com.phoenixplugins.phoenixcrates.api managers

Interface CratesManager


public interface CratesManager
Class for managing crate types and crate instances.

Implementations handle lifecycle, persistence, and caching internally. Consumers should use only these methods to interact with crates and crate types.

  • Method Details

    • getRegisteredTypes

      List<? extends CrateType> getRegisteredTypes()
      Returns all registered crate types.

      NOTE: The reference implementation maps an internal cache (e.g. CachedCrateType) to CrateType instances. This mapping operation is moderately expensive, so avoid repeatedly calling this in performance-sensitive paths.

      Returns:
      a snapshot list of all registered crate types
    • countRegisteredTypes

      int countRegisteredTypes()
      Returns the number of registered crate types.

      This is a fast operation that avoids mapping overhead. Prefer this over getRegisteredTypes() when only the count is needed.

      Returns:
      the number of registered crate types
    • getCrateTypes

      List<? extends CrateType> getCrateTypes()
      Returns only the enabled crate types.
      Returns:
      a snapshot list of enabled crate types
    • getCratesIdentifier

      Set<String> getCratesIdentifier()
      Returns the identifiers of all registered crate types.

      Like getRegisteredTypes(), this performs a mapping operation, so cache results when calling repeatedly.

      Returns:
      a set of type identifiers
    • getTypeByIdentifier

      CrateType getTypeByIdentifier(String key)
      Finds a crate type by its identifier.
      Parameters:
      key - the identifier to look up
      Returns:
      the CrateType if found, otherwise null
    • getCrateByBlock

      CrateInstance getCrateByBlock(org.bukkit.block.Block block)
      Gets the crate instance located at the given block.
      Parameters:
      block - the block to check
      Returns:
      the crate instance if present, otherwise null
    • getPlayerOpeningSessions

      List<? extends OpeningSession> getPlayerOpeningSessions(org.bukkit.entity.Player player)
      Gets all active crate opening sessions for a given player.
      Parameters:
      player - the player
      Returns:
      a list of active opening sessions
Last updated 10 days ago
My Cart
Spider

Your cart is empty

Looks like the spiders padded through here. Pick a plugin and it will show up here. Continue shopping