Interface ItemShopProduct
- All Superinterfaces:
ShopProduct
- All Known Subinterfaces:
SpawnerItemShopProduct
,SpecialItemShopProduct
-
Method Summary
Modifier and TypeMethodDescriptiongetGivingItems
(Player player, @Nullable Team team, @Nullable Arena arena, int multiplier) Returns an array of all the items that are being given on a purchase.Returns the itemstacks that will be given to the player.void
Replace the product item.Methods inherited from interface de.marcely.bedwars.api.game.shop.product.ShopProduct
getAmount, getDisplayName, getDisplayName, getId, getItem, getType, give, give, isAutoWear, isUnbreakable, setAmount, setAutoWear, setUnbreakable
-
Method Details
-
getItemStacks
ItemStack[] getItemStacks()Returns the itemstacks that will be given to the player.- Returns:
- The items that this product holds
-
setItemStack
Replace the product item.- Parameters:
is
- The new product item- Throws:
UnsupportedOperationException
- When executing this for a type other thanShopProductType.ITEM
-
getGivingItems
ItemStack[] getGivingItems(Player player, @Nullable @Nullable Team team, @Nullable @Nullable Arena arena, int multiplier) Returns an array of all the items that are being given on a purchase. Keep in mind that not all types of products give items. An empty array will be returned in that case.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- Specified by:
getGivingItems
in interfaceShopProduct
- Parameters:
player
- The player to which the item shall be given to. Names will also be automatically translated into the language of this playerteam
- The team in which the player is in. Can benull
arena
- The arena in which the player is in. Can benull
multiplier
- How many times this product shall be given to the player. Should be at least 1, or otherwise no effect will be seen- Returns:
- All items that will be given on a purchase
-