Interface IShopCache


public interface IShopCache
Represents a cache for shop items and player tiers.
  • Method Details

    • getCategoryWeight

      byte getCategoryWeight(IShopCategory sc)
      Get the weight assigned to a specific shop category.
      Parameters:
      sc - The shop category.
      Returns:
      The weight assigned to the category.
    • getContentTier

      int getContentTier(String identifier)
      Get the tier of a shop item based on its identifier.
      Parameters:
      identifier - The identifier of the shop item.
      Returns:
      The tier of the item.
    • hasCachedItem

      boolean hasCachedItem(ICategoryContent cc)
      Check if the shop cache contains a cached item for a specific category content.
      Parameters:
      cc - The category content to check.
      Returns:
      true if the cache contains the item, false otherwise.
    • setCategoryWeight

      void setCategoryWeight(IShopCategory sc, byte weight)
      Set the weight for a specific shop category.
      Parameters:
      sc - The shop category.
      weight - The weight to assign.
    • upgradeCachedItem

      void upgradeCachedItem(ICategoryContent cc, int slot)
      Upgrade a cached item associated with a category content and slot. If the item is not found, it will be added to the cache.
      Parameters:
      cc - The category content of the item.
      slot - The slot of the item.
    • getCachedItem

      ICachedItem getCachedItem(String identifier)
      Get a cached item based on its identifier.
      Parameters:
      identifier - The identifier of the item.
      Returns:
      The cached item, or null if not found.
    • getCachedItem

      ICachedItem getCachedItem(ICategoryContent cc)
      Get a cached item associated with a specific category content.
      Parameters:
      cc - The category content of the item.
      Returns:
      The cached item, or null if not found.
    • setSelectedCategory

      void setSelectedCategory(int slot)
      Set the selected category slot.
      Parameters:
      slot - The slot of the selected category.
    • getSelectedCategory

      int getSelectedCategory()
      Get the slot of the selected category.
      Returns:
      The slot of the selected category.
    • getShopCache

      IShopCache getShopCache(UUID player)
      Get the shop cache for a specific player.
      Parameters:
      player - The UUID of the player.
      Returns:
      The shop cache for the player, or null if not found.