Class SettingsCustomItem

java.lang.Object
ua.mcchickenstudio.opencreative.settings.items.SettingsCustomItem
All Implemented Interfaces:
SettingsItem

public class SettingsCustomItem extends Object implements SettingsItem

SettingsCustomItem

This class represents item, that will be changed by modifiers: preset, data, translation, name, lore, material, amount, glowing.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull org.bukkit.inventory.ItemStack
    getItem(@NotNull org.bukkit.entity.Player player)
    Returns item, that will be given to player.
    void
    setAmount(int amount)
    Sets amount of item.
    void
    Sets bytes array data of item, that will be used for recovering saved item.
    void
    setDescription(@NotNull String description)
    Sets description of item.
    void
    setGlowing(boolean glowing)
    Sets whether item should be glowing or not.
    void
    setMaterial(@NotNull org.bukkit.Material material)
    Sets material of item.
    void
    setName(@NotNull String name)
    Sets display name of item.
    void
    setPreset(@NotNull Items preset)
    Sets preset of item, that will be used for recovering prepared system item.
    void
    setTranslationKey(@NotNull String translationKey)
    Sets translation key from localization file (without "items."), that will be used to set display name and description.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SettingsCustomItem

      public SettingsCustomItem()
  • Method Details

    • setData

      public void setData(String data)
      Sets bytes array data of item, that will be used for recovering saved item.
      Parameters:
      data - bytes array of item.
    • setPreset

      public void setPreset(@NotNull @NotNull Items preset)
      Sets preset of item, that will be used for recovering prepared system item.
      Parameters:
      preset - type of system item.
    • setAmount

      public void setAmount(int amount)
      Sets amount of item.
      Parameters:
      amount - amount of item.
    • setGlowing

      public void setGlowing(boolean glowing)
      Sets whether item should be glowing or not.
      Parameters:
      glowing - true - will glow, false - not.
    • setMaterial

      public void setMaterial(@NotNull @NotNull org.bukkit.Material material)
      Sets material of item.
      Parameters:
      material - material of item.
    • setName

      public void setName(@NotNull @NotNull String name)
      Sets display name of item.
      Parameters:
      name - display name of item.
    • setDescription

      public void setDescription(@NotNull @NotNull String description)
      Sets description of item.
      Parameters:
      description - lore of item.
    • setTranslationKey

      public void setTranslationKey(@NotNull @NotNull String translationKey)
      Sets translation key from localization file (without "items."), that will be used to set display name and description.
      Parameters:
      translationKey - translation key.
    • getItem

      @NotNull public @NotNull org.bukkit.inventory.ItemStack getItem(@NotNull @NotNull org.bukkit.entity.Player player)
      Description copied from interface: SettingsItem
      Returns item, that will be given to player.
      Specified by:
      getItem in interface SettingsItem
      Parameters:
      player - player for parsing item translation, if required.
      Returns:
      item to give.