Class PotionBuilder

java.lang.Object
de.studiocode.invui.item.builder.PotionBuilder
All Implemented Interfaces:
ItemProvider, Cloneable, Supplier<org.bukkit.inventory.ItemStack>

public class PotionBuilder extends Object
  • Field Details

    • base

      protected org.bukkit.inventory.ItemStack base
    • material

      protected org.bukkit.Material material
    • amount

      protected int amount
    • damage

      protected int damage
    • customModelData

      protected int customModelData
    • displayName

      protected net.md_5.bungee.api.chat.BaseComponent[] displayName
    • lore

      protected List<net.md_5.bungee.api.chat.BaseComponent[]> lore
    • itemFlags

      protected List<org.bukkit.inventory.ItemFlag> itemFlags
    • enchantments

      protected HashMap<org.bukkit.enchantments.Enchantment,Pair<Integer,Boolean>> enchantments
    • modifiers

      protected List<Function<org.bukkit.inventory.ItemStack,org.bukkit.inventory.ItemStack>> modifiers
  • Constructor Details

    • PotionBuilder

      public PotionBuilder(PotionBuilder.PotionType type)
    • PotionBuilder

      public PotionBuilder(org.bukkit.inventory.ItemStack base)
  • Method Details

    • setColor

      public PotionBuilder setColor(org.bukkit.Color color)
    • setColor

      public PotionBuilder setColor(Color color)
    • setBasePotionData

      public PotionBuilder setBasePotionData(org.bukkit.potion.PotionData basePotionData)
    • addEffect

      public PotionBuilder addEffect(org.bukkit.potion.PotionEffect effect)
    • get

      public org.bukkit.inventory.ItemStack get()
      Builds the ItemStack
      Specified by:
      get in interface ItemProvider
      Specified by:
      get in interface Supplier<org.bukkit.inventory.ItemStack>
      Returns:
      The ItemStack
    • clone

      public PotionBuilder clone()
    • getThis

      protected PotionBuilder getThis()
    • getFor

      public org.bukkit.inventory.ItemStack getFor(@NotNull @NotNull UUID playerUUID)
      Builds the ItemStack for a specific player. This is the method called by BaseWindow which gives you the option to (for example) create a subclass of BaseItemBuilder that automatically translates the item's name into the player's language.
      Specified by:
      getFor in interface ItemProvider
      Parameters:
      playerUUID - The UUID of the Player for whom this ItemStack should be built.
      Returns:
      The ItemStack
    • setLegacyLore

      public PotionBuilder setLegacyLore(@NotNull @NotNull List<String> lore)
    • addLoreLines

      public PotionBuilder addLoreLines(@NotNull @NotNull String... lines)
    • addLoreLines

      public PotionBuilder addLoreLines(@NotNull @NotNull net.md_5.bungee.api.chat.BaseComponent[]... lines)
    • removeLoreLine

      public PotionBuilder removeLoreLine(int index)
    • clearLore

      public PotionBuilder clearLore()
    • addItemFlags

      public PotionBuilder addItemFlags(@NotNull @NotNull org.bukkit.inventory.ItemFlag... itemFlags)
    • removeItemFlags

      public PotionBuilder removeItemFlags(@NotNull @NotNull org.bukkit.inventory.ItemFlag... itemFlags)
    • clearItemFlags

      public PotionBuilder clearItemFlags()
    • addEnchantment

      public PotionBuilder addEnchantment(org.bukkit.enchantments.Enchantment enchantment, int level, boolean ignoreLevelRestriction)
    • removeEnchantment

      public PotionBuilder removeEnchantment(org.bukkit.enchantments.Enchantment enchantment)
    • clearEnchantments

      public PotionBuilder clearEnchantments()
    • addModifier

      public PotionBuilder addModifier(Function<org.bukkit.inventory.ItemStack,org.bukkit.inventory.ItemStack> modifier)
    • clearModifiers

      public PotionBuilder clearModifiers()
    • getBase

      public org.bukkit.inventory.ItemStack getBase()
    • getMaterial

      public org.bukkit.Material getMaterial()
    • setMaterial

      public PotionBuilder setMaterial(@NotNull @NotNull org.bukkit.Material material)
    • getAmount

      public int getAmount()
    • setAmount

      public PotionBuilder setAmount(int amount)
    • getDamage

      public int getDamage()
    • setDamage

      public PotionBuilder setDamage(int damage)
    • getCustomModelData

      public int getCustomModelData()
    • setCustomModelData

      public PotionBuilder setCustomModelData(int customModelData)
    • getDisplayName

      public net.md_5.bungee.api.chat.BaseComponent[] getDisplayName()
    • setDisplayName

      public PotionBuilder setDisplayName(String displayName)
    • setDisplayName

      public PotionBuilder setDisplayName(net.md_5.bungee.api.chat.BaseComponent... displayName)
    • getLore

      public List<net.md_5.bungee.api.chat.BaseComponent[]> getLore()
    • setLore

      public PotionBuilder setLore(List<net.md_5.bungee.api.chat.BaseComponent[]> lore)
    • getItemFlags

      public List<org.bukkit.inventory.ItemFlag> getItemFlags()
    • setItemFlags

      public PotionBuilder setItemFlags(@NotNull @NotNull List<org.bukkit.inventory.ItemFlag> itemFlags)
    • getEnchantments

      public HashMap<org.bukkit.enchantments.Enchantment,Pair<Integer,Boolean>> getEnchantments()
    • setEnchantments

      public PotionBuilder setEnchantments(@NotNull @NotNull HashMap<org.bukkit.enchantments.Enchantment,Pair<Integer,Boolean>> enchantments)
    • getModifiers

      public List<Function<org.bukkit.inventory.ItemStack,org.bukkit.inventory.ItemStack>> getModifiers()