Package com.tomkeuper.bedwars.api.shop
Interface IPlayerQuickBuyCache
public interface IPlayerQuickBuyCache
Represents a cache for the quick buy settings of a player.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addInInventory
(org.bukkit.inventory.Inventory inv, IShopCache shopCache) Add the player's quick buy preferences to the specified inventory.void
Add a quick buy element to the cache.void
destroy()
Destroy the quick buy cache, clearing all elements and performing necessary clean-up.Get the elements in the quick buy cache.getQuickBuyCache
(UUID uuid) Get the quick buy cache for a player with the specified UUID.boolean
Check if the quick buy cache has a specific category content.void
Save the QuickBuyCache to the database.void
setElement
(int slot, ICategoryContent cc) Set the category content for a specific slot in the quick buy cache.void
setElement
(int slot, String category) Set the category content for a specific slot in the quick buy cache.
-
Method Details
-
getQuickBuyCache
Get the quick buy cache for a player with the specified UUID.- Parameters:
uuid
- The UUID of the player.- Returns:
- The cached player quick buy instance.
-
getElements
List<IQuickBuyElement> getElements()Get the elements in the quick buy cache.- Returns:
- A list of quick buy elements.
-
destroy
void destroy()Destroy the quick buy cache, clearing all elements and performing necessary clean-up. -
setElement
Set the category content for a specific slot in the quick buy cache.- Parameters:
slot
- The slot to set the category content for.cc
- The category content to set.
-
setElement
Set the category content for a specific slot in the quick buy cache.- Parameters:
slot
- The slot to set the category content for.category
- The category to set.
-
addQuickElement
Add a quick buy element to the cache.- Parameters:
e
- The quick buy element to add.
-
hasCategoryContent
Check if the quick buy cache has a specific category content.- Parameters:
cc
- The category content to check.- Returns:
- true if the category content is present in the cache, false otherwise.
-
addInInventory
Add the player's quick buy preferences to the specified inventory.- Parameters:
inv
- The inventory to add the preferences to.shopCache
- The shop cache to retrieve item stacks from.
-
pushChangesToDB
void pushChangesToDB()Save the QuickBuyCache to the database.
-