Class IconLayout
IconType.GENERATED
icon's layout inside of a FillableGUI
.-
Constructor Summary
ConstructorDescriptionIconLayout
(String id, MaterialAdapter material, boolean keepOpen, boolean glowing, ValueContainer<Short> amount, short damage) Constructs a new icon layout specifying onlt the essential options and assuming the others as their default values.IconLayout
(String id, MaterialAdapter material, ValueContainer<Short> amount, short damage, boolean keepOpen, boolean glowing, String skullOwner, String skullTextureURL, Color leatherArmorColor, List<String> commands, List<ItemFlagAdapter> itemFlags, Map<Language, String> displayNames, Map<Language, List<String>> lores, Map<EnchantmentAdapter, Integer> enchantments) Constructs a new icon layout specifying all the available options.IconLayout
(Configuration configuration, String path) Reads an icon layout from the specified configuration and path. -
Method Summary
Modifier and TypeMethodDescriptionGets this icon layout's items' amount.Gets the commands that will be executed when this icon layout is clicked.short
Gets this icon layout's items' damage.Gets this icon layout's display names.Gets this icon layout's enchantments.getID()
Gets this icon layout's ID.Gets this icon layout's item flags.Gets this icon layout's leather armor's color.getLores()
Gets this icon layout's lores.Gets this icon layout's material.Gets this icon layout's skull's owner.Gets this icon layout's skull's texture's URL.boolean
Checks if the glowing effect should be applied to this icon layout.boolean
Checks if the GUI should be kept open when this icon layout is clicked.setAmount
(ValueContainer<Short> amount) Sets this icon layout's items' amount.setDamage
(short damage) Sets this icon layout's items' damage.setGlowing
(boolean glowing) Sets if the glowing effect should be applied to this icon layout.setKeepOpen
(boolean keepOpen) Sets if the GUI should be kept open when this icon layout is clicked.setLeatherArmorColor
(Color leatherArmorColor) Sets this icon layout's leather armor's color.setMaterial
(MaterialAdapter material) Sets this icon layout's material.setSkullOwner
(String skullOwner) Sets this icon layout's skull's owner.setSkullTextureURL
(String skullTextureURL) Sets this icon layout's skull's texture's URL.
-
Constructor Details
-
IconLayout
Reads an icon layout from the specified configuration and path.The icon's ID is the text after
path
's last dot ('.') orpath
if it does not contain any and has to matchIcon.ICON_ID_PATTERN
.- Parameters:
configuration
- Configuration to readpath
- Icon layout's path- Throws:
IllegalArgumentException
- If icon's ID!
Icon.isValidIconID(String)
or material's ID found atpath + ".material"
is invalidNumberFormatException
- If color found atpath + ".leather-color-armor"
is notnull
and is invalid (does not respect the format required byColor.decode(String)
)
-
IconLayout
public IconLayout(String id, MaterialAdapter material, boolean keepOpen, boolean glowing, ValueContainer<Short> amount, short damage) Constructs a new icon layout specifying onlt the essential options and assuming the others as their default values.Note:
IconLayout(Configuration, String)
is capable of reading icon layouts fromConfiguration
s. Use this constructor just to obtain custom icon layouts via code.- Parameters:
id
- Icon layout's IDmaterial
- Icon layout's materialkeepOpen
- Whether the GUI will remain open on clickglowing
- Whether the glowing effect should be appliedamount
- Icon layout's items' amount [0 - 64]damage
- Icon layout's items' damage [0 - max durability]
-
IconLayout
public IconLayout(String id, MaterialAdapter material, ValueContainer<Short> amount, short damage, boolean keepOpen, boolean glowing, String skullOwner, String skullTextureURL, Color leatherArmorColor, List<String> commands, List<ItemFlagAdapter> itemFlags, Map<Language, String> displayNames, Map<Language, List<String>> lores, Map<EnchantmentAdapter, Integer> enchantments) Constructs a new icon layout specifying all the available options.Note:
IconLayout(Configuration, String)
is capable of reading icon layouts fromConfiguration
s. Use this constructor just to obtain custom icon layouts via code.It is recommended to use thread-safe collections.
- Parameters:
id
- Icon layout's IDmaterial
- Icon layout's materialamount
- Icon layout's items' amount [0 - 64]damage
- Icon layout's items' damage [0 - max durability]keepOpen
- Whether the GUI will remain open on clickglowing
- Whether the glowing effect should be appliedskullOwner
- Icon layout's skull's ownerskullTextureURL
- Icon layout's skull's texture's URLleatherArmorColor
- Icon layout's leather armor's colorcommands
- Icon layout's commands executed on clickitemFlags
- Icon layout's item flagsdisplayNames
- Icon layout's display nameslores
- Icon layout's loresenchantments
- Icon layout's enchantments
-
-
Method Details
-
getID
Gets this icon layout's ID.- Returns:
- Icon layout's ID
-
getMaterial
Gets this icon layout's material.- Returns:
- Icon layout's material
-
setMaterial
Sets this icon layout's material.- Parameters:
material
- Icon layout's material- Returns:
- This icon layout
-
getAmount
Gets this icon layout's items' amount.- Returns:
- Icon layout's items' amount [0 - 64]
-
setAmount
Sets this icon layout's items' amount.- Parameters:
amount
- Icon layout's items' amount [0 - 64]- Returns:
- This icon layout
-
getDamage
public short getDamage()Gets this icon layout's items' damage.- Returns:
- Icon layout's items' damage [0 - max durability]
-
setDamage
Sets this icon layout's items' damage.- Parameters:
damage
- Icon layout's items' damage [0 - max durability]- Returns:
- This icon layout
-
isKeepOpen
public boolean isKeepOpen()Checks if the GUI should be kept open when this icon layout is clicked.- Returns:
- Whether the GUI will remain open on click
-
setKeepOpen
Sets if the GUI should be kept open when this icon layout is clicked.- Parameters:
keepOpen
- Whether the GUI will remain open on click- Returns:
- This icon layout
-
isGlowing
public boolean isGlowing()Checks if the glowing effect should be applied to this icon layout.- Returns:
- Whether the glowing effect should be applied
-
setGlowing
Sets if the glowing effect should be applied to this icon layout.- Parameters:
glowing
- Whether the glowing effect should be applied- Returns:
- This icon layout
-
getSkullOwner
Gets this icon layout's skull's owner.Will return
null
if the skull's owner has not been specified.- Returns:
- Icon layout's skull's owner
-
setSkullOwner
Sets this icon layout's skull's owner.You can specify
null
to remove the skull's owner.- Parameters:
skullOwner
- Icon layout's skull's owner- Returns:
- This icon layout
-
getSkullTextureURL
Gets this icon layout's skull's texture's URL.Will return
null
if the skull's texture's URL has not been specified.- Returns:
- Icon layout's skull's texture's URL
-
setSkullTextureURL
Sets this icon layout's skull's texture's URL.You can specify
null
to remove the skull's texture's URL.- Parameters:
skullTextureURL
- Icon layout's skull's texture's URL- Returns:
- This icon layout
-
getLeatherArmorColor
Gets this icon layout's leather armor's color.Will return
null
if the leather armor's color has not been specified.- Returns:
- Icon layout's leather armor's color
-
setLeatherArmorColor
Sets this icon layout's leather armor's color.If you need to reset the color to the default value, specify
null
and the following hex code will be applied: "#A06540".- Parameters:
leatherArmorColor
- Icon layout's leather armor's color- Returns:
- This icon layout
-
getCommands
Gets the commands that will be executed when this icon layout is clicked.You may modify the returned list.
- Returns:
- Icon layout's commands executed on click
-
getItemFlags
Gets this icon layout's item flags.You may modify the returned list.
- Returns:
- Icon layout's item flags
-
getDisplayNames
Gets this icon layout's display names.You may modify the returned map.
- Returns:
- Icon layout's display names
-
getLores
Gets this icon layout's lores.You may modify the returned map.
- Returns:
- Icon layout's lores
-
getEnchantments
Gets this icon layout's enchantments.You may modify the returned map.
- Returns:
- Icon layout's enchantments
-