Class PredicateButton
java.lang.Object
me.hsgamer.hscore.minecraft.gui.button.impl.PredicateButton
- All Implemented Interfaces:
Button
,Initializable
The button with predicates
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDisplay the buttonGet the buttonGet the fallback buttonvoid
init()
Initialize some properties for the objectSet 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 predicatevoid
stop()
Stop the object
-
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
-
display
Description copied from interface:Button
Display the button -
init
public void init()Description copied from interface:Initializable
Initialize some properties for the object- Specified by:
init
in interfaceInitializable
-
stop
public void stop()Description copied from interface:Initializable
Stop the object- Specified by:
stop
in interfaceInitializable
-