Class PerkLimitReachedEvent
java.lang.Object
org.bukkit.event.Event
dev.itsharshxd.zentrix.api.events.ZentrixEvent
dev.itsharshxd.zentrix.api.events.perk.PerkLimitReachedEvent
Called when a perk limit stops a player: hosting one more custom game than their tier allows,
making a private game, inviting someone to a full party, using the team changer.
The action has already been refused; the player is sent the limit message from
locales/en.yml after this event, naming getNextTier() when there is one. A shop
plugin can offer that tier, and may suppress the message to send its own.
Main thread; only fired while a listener is registered.
- Since:
- 1.9.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionPerkLimitReachedEvent(@NotNull org.bukkit.entity.Player player, @NotNull Perk perk, int limit, @Nullable PerkTier currentTier, @Nullable PerkTier nextTier) -
Method Summary
Modifier and TypeMethodDescriptionThe tier the player belongs to, or empty when they hold none.static @NotNull org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListGets the handler list for this event.intgetLimit()The player's value of aPerk.Type.NUMBERperk, which they reached; 0 for a toggle perk they are not allowed.The lowest tier above theirs that would allow the action, or empty when none would.@NotNull PerkgetPerk()The perk that stopped them.@NotNull org.bukkit.entity.PlayerThe player who was stopped.booleanWhether the limit message is withheld.voidsetMessageSuppressed(boolean messageSuppressed) Withholds the limit message, for a listener that tells the player itself.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PerkLimitReachedEvent
-
-
Method Details
-
getPlayer
@NotNull public @NotNull org.bukkit.entity.Player getPlayer()The player who was stopped. -
getPerk
The perk that stopped them. -
getLimit
public int getLimit()The player's value of aPerk.Type.NUMBERperk, which they reached; 0 for a toggle perk they are not allowed. -
getCurrentTier
The tier the player belongs to, or empty when they hold none. -
getNextTier
The lowest tier above theirs that would allow the action, or empty when none would. -
isMessageSuppressed
public boolean isMessageSuppressed()Whether the limit message is withheld. -
setMessageSuppressed
public void setMessageSuppressed(boolean messageSuppressed) Withholds the limit message, for a listener that tells the player itself. -
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Description copied from class:ZentrixEventGets the handler list for this event.- Overrides:
getHandlersin classZentrixEvent- Returns:
- The handler list
-
getHandlerList
@NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()
-