Interface AuctionManager


public interface AuctionManager
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if an auction item contains any blacklisted items.
    boolean
    Checks if an auction item contains any whitelisted items.
    void
    blacklistPlayer(org.bukkit.OfflinePlayer player)
    Blacklists a player.
    void
    buy(AuctionItem auctionItem, org.bukkit.entity.Player player)
    Buys an item from the auction.
    boolean
    canSellMoreItem(org.bukkit.entity.Player player)
    Checks if the player can sell more items.
    void
    Clears the auction cache.
    void
    Closes the inventory for all players.
    long
    count(StorageType storage)
    Counts the number of items in a specific storage type.
    long
    count(org.bukkit.entity.Player player, StorageType type)
    Counts the number of items a player has in a specific storage type.
    void
    createSellInventory(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.
    long
    getExpirationPerPermission(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.
    getItems(Category category)
    Gets a list of items in a specific category.
    getItems(org.bukkit.entity.Player player)
    Gets a list of items the player is selling.
    long
    getMaxSellPerPermission(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).
    getSearch(org.bukkit.entity.Player player, String string)
    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.
    void
    giveAuctionItem(AuctionItem auctionItem, org.bukkit.entity.Player player)
    Gives an auction item to a player.
    boolean
    isBlacklist(org.bukkit.OfflinePlayer player)
    Checks if a player is blacklisted.
    void
    Loads the plugin configuration.
    void
    nextSort(org.bukkit.entity.Player player)
    Advances to the next sorting option for the player.
    void
    onNPCRequest(org.bukkit.entity.Player player, String name)
    Handles NPC requests from the player.
    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.
    void
    open(org.bukkit.entity.Player player, Command command)
    Opens the player's inventory based on the given command.
    void
    open(org.bukkit.entity.Player player, Command command, InventoryName inventoryName)
    Opens a specific inventory for the player based on a command and inventory name.
    void
    openConfiguration(org.bukkit.entity.Player player, String string)
    Opens the plugin configuration interface for the player.
    void
    openDefault(org.bukkit.entity.Player player)
    Opens the default inventory for the player.
    void
    Reloads the plugin configuration and data.
    void
    remove(AuctionItem auctionItem, org.bukkit.entity.Player player, boolean isAdmin)
    Removes an item from the auction.
    void
    removeAdmin(org.bukkit.entity.Player player, AuctionItem auctionItem, boolean isSilent, boolean isForceRemove)
    Removes an item as an admin.
    void
    removeAll(org.bukkit.entity.Player player, StorageType type)
    Removes all items of a specific storage type for the player.
    void
    removeItem(org.bukkit.entity.Player player, AuctionItem auctionItem, StorageType expire)
    Removes an item from the player's storage.
    void
    search(org.bukkit.entity.Player player, String string)
    Searches for items based on a keyword.
    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.
    void
    setCurrentCategory(org.bukkit.entity.Player player, Category category)
    Sets the current category for the player.
    void
    setPlayerWord(org.bukkit.OfflinePlayer player, String word)
    Sets a player's search keyword.
    void
    setSort(org.bukkit.entity.Player player, Sorting sorting)
    Sets the sorting preference for the player.
    void
    showHistory(org.bukkit.command.CommandSender sender, org.bukkit.OfflinePlayer player, int page, HistoryType type)
    Shows the auction history for a player.
    void
    unBlacklistPlayer(org.bukkit.OfflinePlayer player)
    Removes a player from the blacklist.
    void
    Updates the auction items for sale and moves expired items to storage.
  • Method Details

    • open

      void open(org.bukkit.entity.Player player, Command command)
      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

      void update(StorageType type)
      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

      List<AuctionItem> getSortItems(org.bukkit.entity.Player player)
      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

      Sorting getSort(org.bukkit.entity.Player player)
      Gets the sorting preference for the player.
      Parameters:
      player - the player whose sorting preference is to be retrieved.
      Returns:
      the sorting preference.
    • setSort

      void setSort(org.bukkit.entity.Player player, Sorting sorting)
      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

      long count(org.bukkit.entity.Player player, StorageType type)
      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

      void remove(AuctionItem auctionItem, org.bukkit.entity.Player player, boolean isAdmin)
      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

      List<AuctionItem> getExpire(org.bukkit.entity.Player player)
      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

      void removeItem(org.bukkit.entity.Player player, AuctionItem auctionItem, StorageType expire)
      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

      void buy(AuctionItem auctionItem, org.bukkit.entity.Player player)
      Buys an item from the auction.
      Parameters:
      auctionItem - the item to be bought.
      player - the player buying the item.
    • getBuying

      List<AuctionItem> getBuying(org.bukkit.entity.Player player)
      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

      long count(StorageType storage)
      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

      List<AuctionItem> getItems(org.bukkit.entity.Player player)
      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

      List<AuctionItem> getItems(Category category)
      Gets a list of items in a specific category.
      Parameters:
      category - the category of items.
      Returns:
      a list of items in the category.
    • getSortItems

      List<AuctionItem> getSortItems(org.bukkit.entity.Player player, Category category)
      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

      void removeAll(org.bukkit.entity.Player player, StorageType type)
      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

      void onNPCRequest(org.bukkit.entity.Player player, String name)
      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

      void openConfiguration(org.bukkit.entity.Player player, String string)
      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

      void search(org.bukkit.entity.Player player, String string)
      Searches for items based on a keyword.
      Parameters:
      player - the player making the search.
      string - the keyword to search for.
    • getSearch

      List<AuctionItem> getSearch(org.bukkit.entity.Player player, String string)
      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

      void setPlayerWord(org.bukkit.OfflinePlayer player, String word)
      Sets a player's search keyword.
      Parameters:
      player - the player whose keyword is to be set.
      word - the search keyword.
    • getPlayerWord

      String getPlayerWord(org.bukkit.OfflinePlayer player)
      Gets a player's search keyword.
      Parameters:
      player - the player whose keyword is to be retrieved.
      Returns:
      the search keyword.
    • open

      void open(org.bukkit.entity.Player player, Command command, InventoryName inventoryName)
      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

      void setCurrentCategory(org.bukkit.entity.Player player, Category category)
      Sets the current category for the player.
      Parameters:
      player - the player whose category is to be set.
      category - the category to set.
    • getCurrentCategory

      Optional<Category> getCurrentCategory(org.bukkit.entity.Player player)
      Gets the current category for the player.
      Parameters:
      player - the player whose category is to be retrieved.
      Returns:
      the current category.
    • auctionHasBlacklistItems

      boolean auctionHasBlacklistItems(AuctionItem auctionItem)
      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

      boolean auctionHasWhitelistItems(AuctionItem auctionItem)
      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

      Optional<Priority> getPriority(org.bukkit.permissions.Permissible permissible)
      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

      Optional<Priority> getPriority(int priority)
      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

      List<String> 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

      String getPriceFormat(long price)
      Formats a price into a human-readable string.
      Parameters:
      price - the price to be formatted.
      Returns:
      the formatted price string.
    • getBannedWorlds

      List<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

      void giveAuctionItem(AuctionItem auctionItem, org.bukkit.entity.Player player)
      Gives an auction item to a player.
      Parameters:
      auctionItem - the auction item to be given.
      player - the player to receive the item.