Class SettingsCustomItem
java.lang.Object
ua.mcchickenstudio.opencreative.settings.items.SettingsCustomItem
- All Implemented Interfaces:
SettingsItem
SettingsCustomItem
This class represents item, that will be changed by modifiers: preset, data, translation, name, lore, material, amount, glowing.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull org.bukkit.inventory.ItemStackgetItem(@NotNull org.bukkit.entity.Player player) Returns item, that will be given to player.voidsetAmount(int amount) Sets amount of item.voidSets bytes array data of item, that will be used for recovering saved item.voidsetDescription(@NotNull String description) Sets description of item.voidsetGlowing(boolean glowing) Sets whether item should be glowing or not.voidsetMaterial(@NotNull org.bukkit.Material material) Sets material of item.voidSets display name of item.voidSets preset of item, that will be used for recovering prepared system item.voidsetTranslationKey(@NotNull String translationKey) Sets translation key from localization file (without "items."), that will be used to set display name and description.
-
Constructor Details
-
SettingsCustomItem
public SettingsCustomItem()
-
-
Method Details
-
setData
Sets bytes array data of item, that will be used for recovering saved item.- Parameters:
data- bytes array of item.
-
setPreset
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
Sets display name of item.- Parameters:
name- display name of item.
-
setDescription
Sets description of item.- Parameters:
description- lore of item.
-
setTranslationKey
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:SettingsItemReturns item, that will be given to player.- Specified by:
getItemin interfaceSettingsItem- Parameters:
player- player for parsing item translation, if required.- Returns:
- item to give.
-