Package com.tomkeuper.bedwars.api.shop
Interface IShopCache
public interface IShopCache
Represents a cache for shop items and player tiers.
-
Method Summary
Modifier and TypeMethodDescriptionGet a cached item associated with a specific category content.getCachedItem
(String identifier) Get a cached item based on its identifier.byte
Get the weight assigned to a specific shop category.int
getContentTier
(String identifier) Get the tier of a shop item based on its identifier.int
Get the slot of the selected category.getShopCache
(UUID player) Get the shop cache for a specific player.boolean
Check if the shop cache contains a cached item for a specific category content.void
setCategoryWeight
(IShopCategory sc, byte weight) Set the weight for a specific shop category.void
setSelectedCategory
(int slot) Set the selected category slot.void
upgradeCachedItem
(ICategoryContent cc, int slot) Upgrade a cached item associated with a category content and slot.
-
Method Details
-
getCategoryWeight
Get the weight assigned to a specific shop category.- Parameters:
sc
- The shop category.- Returns:
- The weight assigned to the category.
-
getContentTier
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
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
Set the weight for a specific shop category.- Parameters:
sc
- The shop category.weight
- The weight to assign.
-
upgradeCachedItem
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
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
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
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.
-