Class MultiButton

java.lang.Object
me.hsgamer.hscore.minecraft.gui.button.MultiButton
All Implemented Interfaces:
Function<@NotNull InventoryContext,@Nullable ActionItem>, GUIElement
Direct Known Subclasses:
AnimatedButton, ListButton

public abstract class MultiButton extends Object implements GUIElement, Function<@NotNull InventoryContext,@Nullable ActionItem>
A base button that handles multiple child buttons
  • Field Details

  • Constructor Details

    • MultiButton

      public MultiButton()
  • Method Details

    • requireChildButtons

      protected boolean requireChildButtons()
      Whether to require child buttons
      Returns:
      true if child buttons are required
    • addButton

      public final <T extends Function<@NotNull InventoryContext, @Nullable ActionItem>> void addButton(@NotNull @NotNull Collection<@NotNull T> buttons)
      Add child buttons
      Type Parameters:
      T - the type of the button
      Parameters:
      buttons - the child buttons
    • addButton

      @SafeVarargs public final void addButton(@NotNull @NotNull Function<@NotNull InventoryContext,@Nullable ActionItem>... button)
      Add child buttons
      Parameters:
      button - the button
    • getButtons

      public final List<Function<@NotNull InventoryContext,@Nullable ActionItem>> getButtons()
      Get the list of child buttons
      Returns:
      the list of child buttons
    • init

      public void init()
      Description copied from interface: GUIElement
      Initialize the element. Should be called before adding to the GUI.
      Specified by:
      init in interface GUIElement
    • stop

      public void stop()
      Description copied from interface: GUIElement
      Stop the element. Should be called after removing from the GUI.
      Specified by:
      stop in interface GUIElement