java.lang.Object
io.github.projectunified.craftux.spigot.button.InputButton
All Implemented Interfaces:
Button, Element

public class InputButton extends Object implements Element, Button
The button that stores the input item
  • Constructor Details

    • InputButton

      public InputButton()
  • Method Details

    • apply

      public boolean apply(@NotNull @NotNull UUID uuid, @NotNull @NotNull ActionItem actionItem)
      Description copied from interface: Button
      Apply actions to the action item
      Specified by:
      apply in interface Button
      Parameters:
      uuid - the uuid of the player
      actionItem - the action item
      Returns:
      true if any action was applied. Can return false in a conditional case (e.g. predicate button)
    • stop

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

      public void setInputItem(@NotNull @NotNull UUID uuid, @Nullable @Nullable org.bukkit.inventory.ItemStack itemStack)
      Set the input item for the unique id
      Parameters:
      uuid - the unique id
      itemStack - the item, or null to remove the input item
    • getInputItem

      @Nullable public @Nullable org.bukkit.inventory.ItemStack getInputItem(@NotNull @NotNull UUID uuid)
      Get the input item for the unique id
      Parameters:
      uuid - the unique id
      Returns:
      the item
    • setDisplayItemFunction

      @Contract("_ -> this") public InputButton setDisplayItemFunction(@NotNull @NotNull BiFunction<UUID,org.bukkit.inventory.ItemStack,org.bukkit.inventory.ItemStack> displayItemFunction)
      Set the function to display the item on the GUI
      Parameters:
      displayItemFunction - the function
      Returns:
      this instance