Class PartyInviteEvent
java.lang.Object
org.bukkit.event.Event
dev.itsharshxd.zentrix.api.events.ZentrixEvent
dev.itsharshxd.zentrix.api.events.party.PartyInviteEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
Called when a party leader invites a player, after Zentrix's own checks passed and before the
invitation is stored or anyone is messaged.
Cancel to refuse the invitation; Zentrix sends no message then, so explain it to the leader if needed. The expiry can be changed within 5 to 3600 seconds. Main thread; only fired while a listener is registered.
- Since:
- 1.8.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe longest expiry a listener may set.static final intThe shortest expiry a listener may set. -
Constructor Summary
ConstructorsConstructorDescriptionPartyInviteEvent(@NotNull ZentrixParty party, @NotNull UUID inviterId, @NotNull UUID inviteeId, int expirationSeconds) -
Method Summary
Modifier and TypeMethodDescriptionintSeconds until the invitation expires; the configured expiry unless a listener changed it.static @NotNull org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListGets the handler list for this event.@NotNull UUIDThe invited player.@NotNull UUIDThe leader sending the invitation.@NotNull ZentrixPartygetParty()The inviting party.booleanvoidsetCancelled(boolean cancelled) voidsetExpirationSeconds(int seconds) Changes how long the invitation stays open.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Field Details
-
MIN_EXPIRATION_SECONDS
public static final int MIN_EXPIRATION_SECONDSThe shortest expiry a listener may set.- See Also:
-
MAX_EXPIRATION_SECONDS
public static final int MAX_EXPIRATION_SECONDSThe longest expiry a listener may set.- See Also:
-
-
Constructor Details
-
PartyInviteEvent
public PartyInviteEvent(@NotNull @NotNull ZentrixParty party, @NotNull @NotNull UUID inviterId, @NotNull @NotNull UUID inviteeId, int expirationSeconds)
-
-
Method Details
-
getParty
The inviting party. -
getInviterId
The leader sending the invitation. -
getInviteeId
The invited player. -
getExpirationSeconds
public int getExpirationSeconds()Seconds until the invitation expires; the configured expiry unless a listener changed it. -
setExpirationSeconds
public void setExpirationSeconds(int seconds) Changes how long the invitation stays open. -
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
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()
-