Class PredicateButton
java.lang.Object
me.hsgamer.hscore.minecraft.gui.button.impl.PredicateButton
- All Implemented Interfaces:
Button,me.hsgamer.hscore.ui.property.Initializable
The button with predicates
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanforceSetAction(@NotNull UUID uuid) Get the buttonGet the fallback buttonvoidhandleAction(ClickEvent event) voidinit()Set the buttonsetClickFuturePredicate(@NotNull Function<@NotNull ClickEvent, @NotNull CompletableFuture<@NotNull Boolean>> clickFuturePredicate) Set the click future predicatesetClickPredicate(@NotNull Predicate<@NotNull ClickEvent> clickPredicate) Set the click predicatesetFallbackButton(@NotNull Button fallbackButton) Set the fallback buttonsetPreventSpamClick(boolean preventSpamClick) Set whether to prevent spam click when checking click predicatesetViewPredicate(@NotNull Predicate<@NotNull UUID> viewPredicate) Set the view predicatevoidstop()
-
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
Set whether to prevent spam click when checking click predicate- Parameters:
preventSpamClick- true if it should- Returns:
- this instance
-
getButton
Get the button- Returns:
- the button
-
setButton
Set the button- Parameters:
button- the button- Returns:
- this instance
-
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
-
handleAction
- Specified by:
handleActionin interfaceButton
-
forceSetAction
- Specified by:
forceSetActionin interfaceButton
-
init
public void init()- Specified by:
initin interfaceme.hsgamer.hscore.ui.property.Initializable
-
stop
public void stop()- Specified by:
stopin interfaceme.hsgamer.hscore.ui.property.Initializable
-