Interface ShopProduct

All Known Subinterfaces:
CommandShopProduct, ItemShopProduct, SpawnerItemShopProduct, SpecialItemShopProduct

public interface ShopProduct
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the amount that will be given to the player
    default String
    Returns the name of this product in the default configured language.
    This method might return something like "Iron", "Bronze", "A command" or something else configured by the user
    getDisplayName(@Nullable CommandSender sender)
    Returns the name of this product that can be presented to the given sender.
    This method might return something like "Iron", "Bronze", "A command" or something else configured by the user
    getGivingItems(Player player, @Nullable Team team, @Nullable Arena arena, int multiplier)
    Gets the ItemStacks the player will actually receive.
    Returns the unique id of this instance.
    Returns the item to which the product has been added to
    Products may vary on what they effectively give to the player.
    This returns what exactly it'll be giving to the player
    void
    give(Player player, @Nullable Team team, @Nullable Arena arena, int multiplier)
    Gives the product to a player.
    boolean
    Returns whether or not this item is automatically getting worn on purchase
    boolean
    Returns if this item is able to obtain any damage
    boolean
    setAmount(int amount)
    Set the amount that will be given to the player.
    Not any product type does support this operation, those who don't support it will return false
    void
    setAutoWear(boolean autowear)
    Set whether or not this item shall be automatically worn on purchase
    void
    setUnbreakable(boolean unbreakable)
    Set whether or not this item shall be able to obtain damage
  • Method Details

    • getItem

      ShopItem getItem()
      Returns the item to which the product has been added to
      Returns:
      The item to which the product was added to
    • getType

      ShopProductType getType()
      Products may vary on what they effectively give to the player.
      This returns what exactly it'll be giving to the player
      Returns:
      The type of this product
    • getId

      UUID getId()
      Returns the unique id of this instance.

      Keep in mind that this will change whenever the plugin gets reloaded!

      Returns:
      The unique id of this product
    • getAmount

      int getAmount()
      Returns the amount that will be given to the player
      Returns:
      The amount that will be given to the player
    • setAmount

      boolean setAmount(int amount)
      Set the amount that will be given to the player.
      Not any product type does support this operation, those who don't support it will return false
      Parameters:
      amount - The new amount
      Returns:
      If this operation is being supported by the type
    • getDisplayName

      String getDisplayName(@Nullable @Nullable CommandSender sender)
      Returns the name of this product that can be presented to the given sender.
      This method might return something like "Iron", "Bronze", "A command" or something else configured by the user
      Parameters:
      sender - Uses his local info to return the name in the right language
      Returns:
      The display name of this product
    • getDisplayName

      default String getDisplayName()
      Returns the name of this product in the default configured language.
      This method might return something like "Iron", "Bronze", "A command" or something else configured by the user
      Returns:
      The display name of this product
    • isAutoWear

      boolean isAutoWear()
      Returns whether or not this item is automatically getting worn on purchase
      Returns:
      If this item is being auto worn
    • setAutoWear

      void setAutoWear(boolean autowear)
      Set whether or not this item shall be automatically worn on purchase
      Parameters:
      autowear - The new value
    • isUnbreakable

      boolean isUnbreakable()
      Returns if this item is able to obtain any damage
      Returns:
      If the item obtains any damage on use
    • setUnbreakable

      void setUnbreakable(boolean unbreakable)
      Set whether or not this item shall be able to obtain damage
      Parameters:
      unbreakable - The new value
    • give

      void give(Player player, @Nullable @Nullable Team team, @Nullable @Nullable Arena arena, int multiplier)
      Gives the product to a player.

      The team and the arena parameters are optional. Some product features won't be applied if they're null. This includes: automatic dying and enchantments gained from upgrades

      Parameters:
      player - The player to which the item shall be given to. Names will also be automatically translated into the language of this player
      team - The team in which the player is in. Can be null
      arena - The arena in which the player is in. Can be null
      multiplier - How many times this product shall be given to the player. Should be at least 1, or otherwise no effect will be seen
    • getGivingItems

      ItemStack[] getGivingItems(Player player, @Nullable @Nullable Team team, @Nullable @Nullable Arena arena, int multiplier)
      Gets the ItemStacks the player will actually receive.

      The team and the arena parameters are optional. Some product features won't be applied if they're null. This includes: automatic dying and enchantments gained from upgrades

      Parameters:
      player - The player to which the item shall be given to. Names will also be automatically translated into the language of this player
      team - The team in which the player is in. Can be null
      arena - The arena in which the player is in. Can be null
      multiplier - How many times this product shall be given to the player. Should be at least 1, or otherwise we will return an empty array