Class GUIButton.AbstractBuilder<B extends GUIButton.AbstractBuilder<B,P>,P extends GUIButton>

Type Parameters:
B - The Builder that implements this one
P - The GUIButton that is built
Direct Known Subclasses:
CommandGUIButton.AbstractBuilder, CycleGUIButton.Builder, GUIButton.Builder, PaginatorGUIButton.AbstractBuilder, SubmitGUIButton.AbstractBuilder, SwitchGUIButton.AbstractBuilder, TeleportGUIButton.AbstractBuilder, ToggleGUIButton.AbstractBuilder
Enclosing class:
GUIButton

protected abstract static class GUIButton.AbstractBuilder<B extends GUIButton.AbstractBuilder<B,P>,P extends GUIButton> extends GUIItem.AbstractBuilder<B,P>
Abstract Builder for creating various GUIButton
  • Constructor Details

    • AbstractBuilder

      protected AbstractBuilder(GUI gui)
      Creates a new Builder
      Parameters:
      gui - The GUI this Pane belongs to
  • Method Details

    • permission

      public B permission(String permission)
      Sets the permission attribute
      Parameters:
      permission - The permission that is required to click on the button
      Returns:
      Itself
    • cooldown

      public B cooldown(int cooldown)
      Sets the cooldown attribute
      Parameters:
      cooldown - The cooldown after which the button can be pressed again
      Returns:
      Itself
    • sound

      public B sound(org.bukkit.Sound sound)
      Sets the sound attribute
      Parameters:
      sound - The sound which is played when the button is pressed
      Returns:
      Itself
    • onClick

      public B onClick(Consumer<ClickData> callback)
      Sets the onClick attribute
      Parameters:
      callback - Gets executed when the button is clicked
      Returns:
      Itself
    • onShiftClick

      public B onShiftClick(Consumer<ClickData> onShiftClick)
      Sets the onShiftClick attribute
      Parameters:
      onShiftClick - Gets executed when the button is shift-clicked
      Returns:
      Itself
    • onRightClick

      public B onRightClick(Consumer<ClickData> onRightClick)
      Sets the onShiftClick attribute
      Parameters:
      onRightClick - Gets executed when the button is right-clicked
      Returns:
      Itself
    • onLeftClick

      public B onLeftClick(Consumer<ClickData> onLeftClick)
      Sets the onLeftClick attribute
      Parameters:
      onLeftClick - Gets executed when the button is left-clicked
      Returns:
      Itself
    • onShiftRightClick

      public B onShiftRightClick(Consumer<ClickData> onShiftRightClick)
      Sets the onShiftRightClick attribute
      Parameters:
      onShiftRightClick - Gets executed when the button is shift-right-clicked
      Returns:
      Itself
    • onShiftLeftClick

      public B onShiftLeftClick(Consumer<ClickData> onShiftLeftClick)
      Sets the onShiftLeftClick attribute
      Parameters:
      onShiftLeftClick - Gets executed when the button is shift-left-clicked
      Returns:
      Itself