Class PredicateButton

java.lang.Object
me.hsgamer.hscore.minecraft.gui.button.impl.PredicateButton
All Implemented Interfaces:
Button, Initializable

public class PredicateButton extends Object implements Button
The button with predicates
  • Constructor Details

    • PredicateButton

      public PredicateButton()
  • Method Details

    • setViewPredicate

      @Contract("_ -> this") public PredicateButton setViewPredicate(@NotNull @NotNull Predicate<@NotNull UUID> viewPredicate)
      Set the view predicate
      Parameters:
      viewPredicate - the view predicate
      Returns:
      this instance
    • setClickPredicate

      @Contract("_ -> this") public PredicateButton setClickPredicate(@NotNull @NotNull Predicate<@NotNull ClickEvent> clickPredicate)
      Set the click predicate
      Parameters:
      clickPredicate - the click predicate
      Returns:
      this instance
    • setClickFuturePredicate

      @Contract("_ -> this") public PredicateButton setClickFuturePredicate(@NotNull @NotNull Function<@NotNull ClickEvent,@NotNull CompletableFuture<@NotNull Boolean>> clickFuturePredicate)
      Set the click future predicate
      Parameters:
      clickFuturePredicate - the click future predicate
      Returns:
      this instance
    • setPreventSpamClick

      @Contract("_ -> this") public PredicateButton setPreventSpamClick(boolean preventSpamClick)
      Set whether to prevent spam click when checking click predicate
      Parameters:
      preventSpamClick - true if it should
      Returns:
      this instance
    • getButton

      public Button getButton()
      Get the button
      Returns:
      the button
    • setButton

      @Contract("_ -> this") public PredicateButton setButton(@NotNull @NotNull Button button)
      Set the button
      Parameters:
      button - the button
      Returns:
      this instance
    • getFallbackButton

      public Button getFallbackButton()
      Get the fallback button
      Returns:
      the fallback button
    • setFallbackButton

      @Contract("_ -> this") public PredicateButton setFallbackButton(@NotNull @NotNull Button fallbackButton)
      Set the fallback button
      Parameters:
      fallbackButton - the fallback button
      Returns:
      this instance
    • display

      public DisplayButton display(@NotNull @NotNull UUID uuid)
      Description copied from interface: Button
      Display the button
      Specified by:
      display in interface Button
      Parameters:
      uuid - the unique id
      Returns:
      the display button
    • init

      public void init()
      Description copied from interface: Initializable
      Initialize some properties for the object
      Specified by:
      init in interface Initializable
    • stop

      public void stop()
      Description copied from interface: Initializable
      Stop the object
      Specified by:
      stop in interface Initializable