Class PredicateButton

java.lang.Object
me.hsgamer.hscore.minecraft.gui.button.impl.PredicateButton
All Implemented Interfaces:
Button, me.hsgamer.hscore.ui.property.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
    • getItem

      public Item getItem(@NotNull @NotNull UUID uuid)
      Specified by:
      getItem in interface Button
    • handleAction

      public void handleAction(ClickEvent event)
      Specified by:
      handleAction in interface Button
    • forceSetAction

      public boolean forceSetAction(@NotNull @NotNull UUID uuid)
      Specified by:
      forceSetAction in interface Button
    • init

      public void init()
      Specified by:
      init in interface me.hsgamer.hscore.ui.property.Initializable
    • stop

      public void stop()
      Specified by:
      stop in interface me.hsgamer.hscore.ui.property.Initializable