Class SimpleButton

java.lang.Object
io.github.projectunified.craftux.simple.SimpleButton
All Implemented Interfaces:
Button

public class SimpleButton extends Object implements Button
A simple button
  • Constructor Details

    • SimpleButton

      public SimpleButton(@NotNull @NotNull Function<@NotNull UUID,@Nullable Object> itemFunction, @NotNull @NotNull Consumer<@NotNull Object> consumer)
      Create a new simple button
      Parameters:
      itemFunction - the item function
      consumer - the consumer
    • SimpleButton

      public SimpleButton(@Nullable @Nullable Object item, @NotNull @NotNull Consumer<@NotNull Object> consumer)
      Create a new button
      Parameters:
      item - the item
      consumer - the consumer
    • SimpleButton

      public SimpleButton(@NotNull @NotNull Consumer<@NotNull Object> consumer)
      Create a new button with a null item
      Parameters:
      consumer - the consumer
    • SimpleButton

      public SimpleButton(@NotNull @NotNull Function<@NotNull UUID,@Nullable Object> itemFunction)
      Create a new button
      Parameters:
      itemFunction - the item function
    • SimpleButton

      public SimpleButton(@Nullable @Nullable Object item)
      Create a new button
      Parameters:
      item - the item
  • 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)