Package fr.maxlego08.zauctionhouse.api
Interface AuctionManager
public interface AuctionManager
-
Method Summary
Modifier and TypeMethodDescriptionbooleanauctionHasBlacklistItems(AuctionItem auctionItem) Checks if an auction item contains any blacklisted items.booleanauctionHasWhitelistItems(AuctionItem auctionItem) Checks if an auction item contains any whitelisted items.voidblacklistPlayer(org.bukkit.OfflinePlayer player) Blacklists a player.voidbuy(AuctionItem auctionItem, org.bukkit.entity.Player player) Buys an item from the auction.booleancanSellMoreItem(org.bukkit.entity.Player player) Checks if the player can sell more items.voidClears the auction cache.voidCloses the inventory for all players.longcount(StorageType storage) Counts the number of items in a specific storage type.longcount(org.bukkit.entity.Player player, StorageType type) Counts the number of items a player has in a specific storage type.voidcreateSellInventory(org.bukkit.entity.Player player, long price, AuctionEconomy economy, Command command) Creates an inventory for selling items.Gets a list of banned worlds where auctions are not allowed.Gets a list of banned worlds where auctions are not allowed.getBuying(org.bukkit.entity.Player player) Gets a list of items the player is currently buying.Gets the cache of auction items.getCurrentCategory(org.bukkit.entity.Player player) Gets the current category for the player.longgetExpirationPerPermission(org.bukkit.permissions.Permissible player) Gets the expiration time of items the player can sell based on their permissions.getExpire(org.bukkit.entity.Player player) Gets a list of expired items for the player.Gets a list of items in a specific category.getItems(org.bukkit.entity.Player player) Gets a list of items the player is selling.longgetMaxSellPerPermission(org.bukkit.permissions.Permissible player) Gets the maximum number of items the player can sell based on their permissions.getPlayerWord(org.bukkit.OfflinePlayer player) Gets a player's search keyword.getPriceFormat(long price) Formats a price into a human-readable string.getPriority(int priority) Gets the priority level based on the priority value.getPriority(org.bukkit.permissions.Permissible permissible) Gets the priority level for a permissible entity.Generates a random unique identifier (UUID).Gets a list of items matching a search keyword for the player.getSort(org.bukkit.entity.Player player) Gets the sorting preference for the player.getSortItems(org.bukkit.entity.Player player) Gets a sorted list of auction items for the player.getSortItems(org.bukkit.entity.Player player, Category category) Gets a sorted list of items in a specific category for the player.Gets the storage interface for managing auction data.voidgiveAuctionItem(AuctionItem auctionItem, org.bukkit.entity.Player player) Gives an auction item to a player.booleanisBlacklist(org.bukkit.OfflinePlayer player) Checks if a player is blacklisted.voidLoads the plugin configuration.voidnextSort(org.bukkit.entity.Player player) Advances to the next sorting option for the player.voidonNPCRequest(org.bukkit.entity.Player player, String name) Handles NPC requests from the player.voidopen(AuctionPlugin plugin, InventoryType type, org.bukkit.entity.Player player, AuctionItem auctionItem, int page, List<Inventory> oldInventories, String category) Opens a specific type of inventory for the player.voidOpens the player's inventory based on the given command.voidopen(org.bukkit.entity.Player player, Command command, InventoryName inventoryName) Opens a specific inventory for the player based on a command and inventory name.voidopenConfiguration(org.bukkit.entity.Player player, String string) Opens the plugin configuration interface for the player.voidopenDefault(org.bukkit.entity.Player player) Opens the default inventory for the player.voidreload()Reloads the plugin configuration and data.voidremove(AuctionItem auctionItem, org.bukkit.entity.Player player, boolean isAdmin) Removes an item from the auction.voidremoveAdmin(org.bukkit.entity.Player player, AuctionItem auctionItem, boolean isSilent, boolean isForceRemove) Removes an item as an admin.voidremoveAll(org.bukkit.entity.Player player, StorageType type) Removes all items of a specific storage type for the player.voidremoveItem(org.bukkit.entity.Player player, AuctionItem auctionItem, StorageType expire) Removes an item from the player's storage.voidSearches for items based on a keyword.voidsellItem(AuctionItem auctionItem, org.bukkit.inventory.ItemStack itemStack, org.bukkit.entity.Player player, long price, AuctionEconomy economy, int amount, AuctionType type) Sells an item on the auction.voidsetCurrentCategory(org.bukkit.entity.Player player, Category category) Sets the current category for the player.voidsetPlayerWord(org.bukkit.OfflinePlayer player, String word) Sets a player's search keyword.voidSets the sorting preference for the player.voidshowHistory(org.bukkit.command.CommandSender sender, org.bukkit.OfflinePlayer player, int page, HistoryType type) Shows the auction history for a player.voidunBlacklistPlayer(org.bukkit.OfflinePlayer player) Removes a player from the blacklist.voidupdate(StorageType type) Updates the auction items for sale and moves expired items to storage.
-
Method Details
-
open
Opens the player's inventory based on the given command.- Parameters:
player- the player whose inventory is to be opened.command- the command used to open the inventory.
-
openDefault
void openDefault(org.bukkit.entity.Player player) Opens the default inventory for the player.- Parameters:
player- the player whose default inventory is to be opened.
-
open
void open(AuctionPlugin plugin, InventoryType type, org.bukkit.entity.Player player, AuctionItem auctionItem, int page, List<Inventory> oldInventories, String category) Opens a specific type of inventory for the player.- Parameters:
plugin- the auction plugin instance.type- the type of inventory to open.player- the player whose inventory is to be opened.auctionItem- the auction item related to the inventory.page- the page number to display.oldInventories- the list of previous inventories.category- the category of items to display.
-
reload
void reload()Reloads the plugin configuration and data. -
closeInventory
void closeInventory()Closes the inventory for all players. -
getStorage
IStorage getStorage()Gets the storage interface for managing auction data.- Returns:
- the storage interface.
-
update
Updates the auction items for sale and moves expired items to storage.- Parameters:
type- the type of storage to update.
-
sellItem
void sellItem(AuctionItem auctionItem, org.bukkit.inventory.ItemStack itemStack, org.bukkit.entity.Player player, long price, AuctionEconomy economy, int amount, AuctionType type) Sells an item on the auction.- Parameters:
auctionItem- the item to be sold.itemStack- the item stack to be sold.player- the player selling the item.price- the price of the item.economy- the economy type used.amount- the amount of items to sell.type- the type of auction.
-
getSortItems
Gets a sorted list of auction items for the player.- Parameters:
player- the player requesting the sorted items.- Returns:
- a list of sorted auction items.
-
getSort
Gets the sorting preference for the player.- Parameters:
player- the player whose sorting preference is to be retrieved.- Returns:
- the sorting preference.
-
setSort
Sets the sorting preference for the player.- Parameters:
player- the player whose sorting preference is to be set.sorting- the sorting preference.
-
loadConfiguration
void loadConfiguration()Loads the plugin configuration. -
getMaxSellPerPermission
long getMaxSellPerPermission(org.bukkit.permissions.Permissible player) Gets the maximum number of items the player can sell based on their permissions.- Parameters:
player- the player whose permissions are to be checked.- Returns:
- the maximum number of items the player can sell.
-
getExpirationPerPermission
long getExpirationPerPermission(org.bukkit.permissions.Permissible player) Gets the expiration time of items the player can sell based on their permissions.- Parameters:
player- the player whose permissions are to be checked.- Returns:
- the expiration time of items.
-
canSellMoreItem
boolean canSellMoreItem(org.bukkit.entity.Player player) Checks if the player can sell more items.- Parameters:
player- the player to be checked.- Returns:
- true if the player can sell more items, false otherwise.
-
count
Counts the number of items a player has in a specific storage type.- Parameters:
player- the player whose items are to be counted.type- the type of storage.- Returns:
- the number of items.
-
remove
Removes an item from the auction.- Parameters:
auctionItem- the item to be removed.player- the player removing the item.isAdmin- whether the removal is done by an admin.
-
getExpire
Gets a list of expired items for the player.- Parameters:
player- the player whose expired items are to be retrieved.- Returns:
- a list of expired items.
-
removeItem
Removes an item from the player's storage.- Parameters:
player- the player whose item is to be removed.auctionItem- the item to be removed.expire- the storage type of the item.
-
buy
Buys an item from the auction.- Parameters:
auctionItem- the item to be bought.player- the player buying the item.
-
getBuying
Gets a list of items the player is currently buying.- Parameters:
player- the player whose buying items are to be retrieved.- Returns:
- a list of buying items.
-
count
Counts the number of items in a specific storage type.- Parameters:
storage- the type of storage.- Returns:
- the number of items.
-
nextSort
void nextSort(org.bukkit.entity.Player player) Advances to the next sorting option for the player.- Parameters:
player- the player whose sorting option is to be advanced.
-
getItems
Gets a list of items the player is selling.- Parameters:
player- the player whose selling items are to be retrieved.- Returns:
- a list of selling items.
-
getItems
Gets a list of items in a specific category.- Parameters:
category- the category of items.- Returns:
- a list of items in the category.
-
getSortItems
Gets a sorted list of items in a specific category for the player.- Parameters:
player- the player requesting the sorted items.category- the category of items.- Returns:
- a sorted list of items in the category.
-
removeAll
Removes all items of a specific storage type for the player.- Parameters:
player- the player whose items are to be removed.type- the type of storage.
-
onNPCRequest
Handles NPC requests from the player.- Parameters:
player- the player making the request.name- the name of the NPC.
-
isBlacklist
boolean isBlacklist(org.bukkit.OfflinePlayer player) Checks if a player is blacklisted.- Parameters:
player- the player to be checked.- Returns:
- true if the player is blacklisted, false otherwise.
-
blacklistPlayer
void blacklistPlayer(org.bukkit.OfflinePlayer player) Blacklists a player.- Parameters:
player- the player to be blacklisted.
-
unBlacklistPlayer
void unBlacklistPlayer(org.bukkit.OfflinePlayer player) Removes a player from the blacklist.- Parameters:
player- the player to be removed from the blacklist.
-
openConfiguration
Opens the plugin configuration interface for the player.- Parameters:
player- the player whose configuration interface is to be opened.string- the configuration to be opened.
-
showHistory
void showHistory(org.bukkit.command.CommandSender sender, org.bukkit.OfflinePlayer player, int page, HistoryType type) Shows the auction history for a player.- Parameters:
sender- the command sender requesting the history.player- the player whose history is to be shown.page- the page number to display.type- the type of history.
-
createSellInventory
void createSellInventory(org.bukkit.entity.Player player, long price, AuctionEconomy economy, Command command) Creates an inventory for selling items.- Parameters:
player- the player creating the inventory.price- the price of the items.economy- the economy type used.command- the command associated with the inventory.
-
removeAdmin
void removeAdmin(org.bukkit.entity.Player player, AuctionItem auctionItem, boolean isSilent, boolean isForceRemove) Removes an item as an admin.- Parameters:
player- the player removing the item.auctionItem- the item to be removed.isSilent- whether the removal is silent.isForceRemove- whether the removal is forced.
-
search
Searches for items based on a keyword.- Parameters:
player- the player making the search.string- the keyword to search for.
-
getSearch
Gets a list of items matching a search keyword for the player.- Parameters:
player- the player making the search.string- the keyword to search for.- Returns:
- a list of items matching the search.
-
setPlayerWord
Sets a player's search keyword.- Parameters:
player- the player whose keyword is to be set.word- the search keyword.
-
getPlayerWord
Gets a player's search keyword.- Parameters:
player- the player whose keyword is to be retrieved.- Returns:
- the search keyword.
-
open
Opens a specific inventory for the player based on a command and inventory name.- Parameters:
player- the player whose inventory is to be opened.command- the command used to open the inventory.inventoryName- the name of the inventory to be opened.
-
setCurrentCategory
Sets the current category for the player.- Parameters:
player- the player whose category is to be set.category- the category to set.
-
getCurrentCategory
Gets the current category for the player.- Parameters:
player- the player whose category is to be retrieved.- Returns:
- the current category.
-
auctionHasBlacklistItems
Checks if an auction item contains any blacklisted items.- Parameters:
auctionItem- the auction item to be checked.- Returns:
- true if the auction item contains blacklisted items, false otherwise.
-
auctionHasWhitelistItems
Checks if an auction item contains any whitelisted items.- Parameters:
auctionItem- the auction item to be checked.- Returns:
- true if the auction item contains whitelisted items, false otherwise.
-
getPriority
Gets the priority level for a permissible entity.- Parameters:
permissible- the entity whose priority is to be checked.- Returns:
- an optional containing the priority level.
-
getPriority
Gets the priority level based on the priority value.- Parameters:
priority- the priority value.- Returns:
- an optional containing the priority level.
-
getRandomUniqueId
UUID getRandomUniqueId()Generates a random unique identifier (UUID).- Returns:
- a random UUID.
-
getBannedWorld
Gets a list of banned worlds where auctions are not allowed.- Returns:
- a list of banned worlds.
-
clearCache
void clearCache()Clears the auction cache. -
getPriceFormat
Formats a price into a human-readable string.- Parameters:
price- the price to be formatted.- Returns:
- the formatted price string.
-
getBannedWorlds
Gets a list of banned worlds where auctions are not allowed.- Returns:
- a list of banned worlds.
-
getCacheAuctionItemList
CacheAuctionItem getCacheAuctionItemList()Gets the cache of auction items.- Returns:
- the cache of auction items.
-
giveAuctionItem
Gives an auction item to a player.- Parameters:
auctionItem- the auction item to be given.player- the player to receive the item.
-