Class IconMenu
java.lang.Object
me.gigawartrex.smalladditions.helpers.IconMenu
- All Implemented Interfaces:
org.bukkit.event.Listener
Class to instantiate an interactive inventory menu.
This class was taken from bukkit.org as documented below (27. December 2020).
- Author:
- nisovin
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Class representing an option click event.static interface
Interface for theIconMenu.OptionClickEvent
class. -
Constructor Summary
ConstructorsConstructorDescriptionIconMenu
(String name, int size, IconMenu.OptionClickEventHandler handler, org.bukkit.plugin.Plugin plugin) Class constructor. -
Method Summary
-
Constructor Details
-
IconMenu
public IconMenu(String name, int size, IconMenu.OptionClickEventHandler handler, org.bukkit.plugin.Plugin plugin) Class constructor.- Parameters:
name
- the name of the menusize
- the size of the menu, must be a multiple of 9handler
- theIconMenu.OptionClickEventHandler
handler to detect item clicksplugin
- the reference to the bukkit plugin
-
-
Method Details
-
setOption
public IconMenu setOption(int position, org.bukkit.inventory.ItemStack icon, String name, String... info) Method to set an inventory slot to a specific item with information.- Parameters:
position
- the position in the inventory, starting with 0icon
- theItemStack
to be displayedname
- the name of the optioninfo
- the popup information when hovering over the icon- Returns:
- the resulting
IconMenu
-
open
public void open(org.bukkit.entity.Player player) Method to open the inventory for the specified player.- Parameters:
player
- the targetPlayer
-
destroy
public void destroy()Method to destroy the current IconMenu object.
-