Class ClassKitGrantEvent
java.lang.Object
org.bukkit.event.Event
dev.itsharshxd.zentrix.api.events.ZentrixEvent
dev.itsharshxd.zentrix.api.events.ZentrixGameEvent
dev.itsharshxd.zentrix.api.events.classes.ClassKitGrantEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public final class ClassKitGrantEvent
extends ZentrixGameEvent
implements org.bukkit.event.Cancellable
Called before a player is handed their class kit: at match start, and when a revival or
RevivalService#restoreLoadout restores class items.
getItems() is the mutable list of copies about to be added to the player's
inventory; listeners may add, remove or replace items. Initial ability effects - the
Fisherman's Luck - follow unless setApplyEffects(boolean) turns them off. Cancelling
hands out neither.
Main thread; only fired while a listener is registered.
- Since:
- 1.8.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhy a class kit is handed out.Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionClassKitGrantEvent(@NotNull ZentrixGame game, @NotNull org.bukkit.entity.Player player, @NotNull String classType, @NotNull ClassKitGrantEvent.Cause cause, @NotNull List<org.bukkit.inventory.ItemStack> items) -
Method Summary
Modifier and TypeMethodDescription@NotNull ClassKitGrantEvent.CausegetCause()Why the kit is handed out.@NotNull StringTheir class, asPlayerClass#getType()names it, such asWARRIOR.static @NotNull org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListGets the handler list for this event.@NotNull List<org.bukkit.inventory.ItemStack> getItems()The items about to be added, in order; listeners may change the list.@NotNull org.bukkit.entity.PlayerThe player receiving the kit.booleanWhether the class's initial ability effects are applied with the kit.booleanvoidsetApplyEffects(boolean applyEffects) Applies or skips the class's initial ability effects.voidsetCancelled(boolean cancelled) Methods inherited from class dev.itsharshxd.zentrix.api.events.ZentrixGameEvent
getArenaName, getGame, getGameId, getGameState, getGameTypeName, getPlayerCount, getRuntimeId, getSourceArenaNameMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
ClassKitGrantEvent
public ClassKitGrantEvent(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String classType, @NotNull @NotNull ClassKitGrantEvent.Cause cause, @NotNull @NotNull List<org.bukkit.inventory.ItemStack> items)
-
-
Method Details
-
getPlayer
@NotNull public @NotNull org.bukkit.entity.Player getPlayer()The player receiving the kit. -
getClassType
Their class, asPlayerClass#getType()names it, such asWARRIOR. -
getCause
Why the kit is handed out. -
getItems
The items about to be added, in order; listeners may change the list. -
isApplyEffects
public boolean isApplyEffects()Whether the class's initial ability effects are applied with the kit. -
setApplyEffects
public void setApplyEffects(boolean applyEffects) Applies or skips the class's initial ability effects. -
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:ZentrixGameEventGets the handler list for this event.- Overrides:
getHandlersin classZentrixGameEvent- Returns:
- The handler list
-
getHandlerList
@NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()
-