Class MenuItem

java.lang.Object
dev.sefiraat.sefilib.slimefun.itemgroup.MenuItem

public class MenuItem extends Object
Represents an icon in the SimpleFlexGroup
  • Constructor Summary

    Constructors
    Constructor
    Description
    MenuItem(io.github.thebusybiscuit.slimefun4.api.items.ItemGroup itemGroup)
    Creates a new MenuItem
    MenuItem(ItemStack item, me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler clickHandler)
    Creates a new MenuItem with an ItemStack and a ChestMenu.MenuClickHandler
  • Method Summary

    Modifier and Type
    Method
    Description
    me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler
    Returns the ChestMenu.MenuClickHandler for this MenuItem
    Returns the ItemStack that will be displayed to the players when in the guide.
    io.github.thebusybiscuit.slimefun4.api.items.ItemGroup
    Returns the ItemGroup of this MenuItem
    static MenuItem
    of(io.github.thebusybiscuit.slimefun4.api.items.ItemGroup itemGroup)
    Creates a new MenuItem derived from an ItemGroup
    static MenuItem
    of(ItemStack item, me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler clickHandler)
    Creates a new MenuItem derived from an ItemStack and a custom ChestMenu.MenuClickHandler

    Methods inherited from class java.lang.Object

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

    • MenuItem

      public MenuItem(@Nonnull io.github.thebusybiscuit.slimefun4.api.items.ItemGroup itemGroup)
      Creates a new MenuItem
      Parameters:
      itemGroup - The ItemGroup to be added. Accepts Flex, Nested and ItemGroup (DummyItemGroup) is preferable.
    • MenuItem

      public MenuItem(@Nonnull ItemStack item, @Nonnull me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler clickHandler)
      Creates a new MenuItem with an ItemStack and a ChestMenu.MenuClickHandler
      Parameters:
      item - The ItemStack to be displayed
      clickHandler - The ChestMenu.MenuClickHandler to be executed when the item is clicked
  • Method Details

    • getItem

      @Nullable public ItemStack getItem()
      Returns the ItemStack that will be displayed to the players when in the guide.
      Returns:
      The ItemStack to be displayed
    • getClickHandler

      @Nullable public me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler getClickHandler()
      Returns the ChestMenu.MenuClickHandler for this MenuItem
      Returns:
      The ChestMenu.MenuClickHandler for this MenuItem
    • getItemGroup

      @Nullable public io.github.thebusybiscuit.slimefun4.api.items.ItemGroup getItemGroup()
      Returns the ItemGroup of this MenuItem
      Returns:
      The ItemGroup of this MenuItem
    • of

      @Nonnull public static MenuItem of(io.github.thebusybiscuit.slimefun4.api.items.ItemGroup itemGroup)
      Creates a new MenuItem derived from an ItemGroup
      Parameters:
      itemGroup - the ItemGroup to be added to the group
      Returns:
      Returns a new MenuItem
    • of

      @Nonnull public static MenuItem of(ItemStack item, me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler clickHandler)
      Creates a new MenuItem derived from an ItemStack and a custom ChestMenu.MenuClickHandler
      Parameters:
      item - the ItemStack to display on the guide
      clickHandler - the MenuClickHandler to be executed when the item is clicked
      Returns:
      Returns a new MenuItem