Interface ISellHandler


public interface ISellHandler
This interface defines the methods for handling shops in the AutoSell plugin. It includes methods for initializing shops, checking if a player can sell, and selling items or inventory.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addShop(Shop shop)
    Adds a shop.
    boolean
    autoSell(org.bukkit.entity.Player player, List<org.bukkit.inventory.ItemStack> itemStacks, org.bukkit.block.Block block)
    Execute automatic sell for the player.
    boolean
    canSell(org.bukkit.entity.Player player)
    Checks if the player can sell.
    void
    Clears the shops.
    getHighestPriceShopFor(org.bukkit.inventory.ItemStack itemStack)
    Finds a shop which sell the specified item at the highest price.
    Map<org.bukkit.inventory.ItemStack,Shop>
    Returns a map containing the itemstack and corresponding shop which sells the item at the highest price.
    Gets the instance of the ISellHandler.
    int
    Gets the next shop priority.
    getPermShop(org.bukkit.entity.Player player)
    Gets the shop for the player with the permission.
    getShop(String shopName)
    Gets the shop by name.
    getShop(org.bukkit.entity.Player player)
    Gets the shop for the player.
    getShop(org.bukkit.entity.Player palyer, org.bukkit.block.Block block)
    Gets the shop for the player at the specified block.
    Gets the shops.
    static double
    getTotalMultiplier(org.bukkit.entity.Player player, Shop shop)
    Calculate the total multiplier for the player and shop.
    static double
    getTotalMultiplier(org.bukkit.entity.Player player, Set<Shop> shops)
    Calculate the total multiplier for the player and shop.
    void
    Initializes the shops.
    boolean
    isShop(String shopName)
    Checks if the shop name is valid.
    boolean
    Removes a shop.
    sellInventory(org.bukkit.entity.Player player, @NotNull Shop shop)
    Execute sell for the player from its inventory
    sellItems(org.bukkit.entity.Player player, List<org.bukkit.inventory.ItemStack> itemStacks, @NotNull Shop shop)
    Execute sell for the player with the specified items
  • Method Details

    • initShops

      void initShops()
      Initializes the shops.
    • getShops

      Map<Integer,Shop> getShops()
      Gets the shops.
      Returns:
      The shops.
    • canSell

      boolean canSell(org.bukkit.entity.Player player)
      Checks if the player can sell.
      Parameters:
      player - The player to check.
      Returns:
      true if the player can sell, false otherwise.
    • clearShops

      void clearShops()
      Clears the shops.
    • getShop

      Shop getShop(org.bukkit.entity.Player player)
      Gets the shop for the player.
      Parameters:
      player - The player to get the shop for.
      Returns:
      The shop for the player.
    • getShop

      Shop getShop(String shopName)
      Gets the shop by name.
      Parameters:
      shopName - The name of the shop to get.
      Returns:
      The shop with the specified name.
    • addShop

      void addShop(Shop shop)
      Adds a shop.
      Parameters:
      shop - The shop to add.
    • removeShop

      boolean removeShop(Shop shop)
      Removes a shop.
      Parameters:
      shop - The shop to remove.
      Returns:
      true if the shop was removed, false otherwise.
    • getNextShopPriority

      int getNextShopPriority()
      Gets the next shop priority.
      Returns:
      The next shop priority.
    • isShop

      boolean isShop(String shopName)
      Checks if the shop name is valid.
      Parameters:
      shopName - The name of the shop to check.
      Returns:
      true if the shop name is valid, false otherwise.
    • getShop

      Shop getShop(org.bukkit.entity.Player palyer, org.bukkit.block.Block block)
      Gets the shop for the player at the specified block.
      Parameters:
      palyer - The player to get the shop for.
      block - The block to locate the shop.
      Returns:
      The shop for the player at the specified block.
    • getPermShop

      Shop getPermShop(org.bukkit.entity.Player player)
      Gets the shop for the player with the permission.
      Parameters:
      player - The player to get the shop for.
      Returns:
      The shop for the player with the permission.
    • autoSell

      boolean autoSell(org.bukkit.entity.Player player, List<org.bukkit.inventory.ItemStack> itemStacks, org.bukkit.block.Block block)
      Execute automatic sell for the player.
      Parameters:
      player - The player to execute the automatic sell for.
      itemStacks - The list of item stacks to sell.
      block - The block to sell at.
      Returns:
      true if the automatic sell was executed, false otherwise.
    • sellItems

      SellResponse sellItems(org.bukkit.entity.Player player, List<org.bukkit.inventory.ItemStack> itemStacks, @NotNull @NotNull Shop shop)
      Execute sell for the player with the specified items
      Parameters:
      player - The player to execute the automatic sell for.
      itemStacks - The list of item stacks to sell.
      shop - The shop to sell at.
      Returns:
      the result of sale.
    • sellInventory

      SellResponse sellInventory(org.bukkit.entity.Player player, @NotNull @NotNull Shop shop)
      Execute sell for the player from its inventory
      Parameters:
      player - The player to execute the sell for.
      shop - The shop to sell at.
      Returns:
      the result of sale.
    • getHighestPriceShopFor

      Shop getHighestPriceShopFor(org.bukkit.inventory.ItemStack itemStack)
      Finds a shop which sell the specified item at the highest price.
      Parameters:
      itemStack - The item stack to find the shop for.
      Returns:
      a shop which sells the specifieditem at the highest price.
    • getHighestPriceShops

      Map<org.bukkit.inventory.ItemStack,Shop> getHighestPriceShops()
      Returns a map containing the itemstack and corresponding shop which sells the item at the highest price.
      Returns:
      a map of item stacks and their corresponding shops which sells the specified item at the highest price.
    • getTotalMultiplier

      static double getTotalMultiplier(org.bukkit.entity.Player player, Shop shop)
      Calculate the total multiplier for the player and shop.
      Parameters:
      player - The player to calculate the multiplier for.
      shop - The shop to calculate the multiplier for.
      Returns:
      The total multiplier for the player and shop.
    • getTotalMultiplier

      static double getTotalMultiplier(org.bukkit.entity.Player player, Set<Shop> shops)
      Calculate the total multiplier for the player and shop.
      Parameters:
      player - The player to calculate the multiplier for.
      shops - The shops to calculate the multiplier for.
      Returns:
      The total multiplier for the player and shop.
    • getInstance

      static ISellHandler getInstance()
      Gets the instance of the ISellHandler.
      Returns:
      Gets the instance of the ISellHandler.