Class SwitchGUIButton

All Implemented Interfaces:
Sizeable
Direct Known Subclasses:
BackGUIButton

public class SwitchGUIButton extends GUIButton
A GUIButton which automatically switches the GUI to another GUI.
  • Constructor Details

    • SwitchGUIButton

      public SwitchGUIButton(GUI gui, org.bukkit.inventory.ItemStack item, Supplier<GUI> targetGUI)
      Creates a new SwitchGUIButton
      Parameters:
      gui - The GUI
      item - The ItemStack of the Button
      targetGUI - The GUI to be opened
    • SwitchGUIButton

      public SwitchGUIButton(GUI gui, org.bukkit.inventory.ItemStack item, Function<org.bukkit.entity.Player,GUI> targetGUI)
      Creates a new SwitchGUIButton The creation of the targetGUI can use the player which clicked the button
      Parameters:
      gui - The GUI
      item - The ItemStack of the Button
      targetGUI - The GUI to be opened
  • Method Details

    • onClick

      public void onClick(ClickData data)
      Description copied from class: GUIButton
      Is called when the player clicks on the Button no matter how.
      Specified by:
      onClick in class GUIButton
      Parameters:
      data - The ClickData