public static interface NucleusKitEvent.Redeem extends NucleusKitEvent, TargetPlayerEvent
Pre
is fired before the kit is redeemed, and the contents of the kit may be altered at this stage for this redemption
only.
Post
is fired after a kit is redeemed successfully (defined as a kit would not be redeemable again if it was a one time
kit).
Modifier and Type | Interface and Description |
---|---|
static interface |
NucleusKitEvent.Redeem.Failed
Fired when a player's kit could not be updated.
|
static interface |
NucleusKitEvent.Redeem.Post
Fired when a player's kit has been updated.
|
static interface |
NucleusKitEvent.Redeem.Pre
Fired when a player is redeeming a kit.
|
NucleusKitEvent.Redeem
Modifier and Type | Method and Description |
---|---|
Optional<Collection<String>> |
getCommandsToExecute()
Gets the commands that the kit will run, if a plugin has set them.
|
Optional<Instant> |
getLastRedeemedTime()
Gets the last time the kit was redeemed, if any.
|
String |
getName()
Gets the name of the kit.
|
Collection<String> |
getOriginalCommandsToExecute()
Gets the commands that the kit will run.
|
Collection<ItemStackSnapshot> |
getOriginalStacksToRedeem()
Gets the
ItemStackSnapshot s that the kit contains. |
Kit |
getRedeemedKit()
Gets the kit that has been redeemed.
|
Optional<Collection<ItemStackSnapshot>> |
getStacksToRedeem()
Gets the
ItemStackSnapshot s that will be redeemed, if a
plugin has altered it. |
getTargetEntity
getCause, getContext, getSource
Optional<Instant> getLastRedeemedTime()
Instant
the kit was last redeemed.String getName()
Kit getRedeemedKit()
Collection<ItemStackSnapshot> getOriginalStacksToRedeem()
ItemStackSnapshot
s that the kit contains.
Note that other plugins might alter what is finally
redeemed by the kit, see getStacksToRedeem()
If getStacksToRedeem()
is null
, this
is what will be redeemed.
ItemStackSnapshot
s that would be redeemed.Optional<Collection<ItemStackSnapshot>> getStacksToRedeem()
ItemStackSnapshot
s that will be redeemed, if a
plugin has altered it.
This might not represent what the kit actually contains, plugins may alter this.
For NucleusKitEvent.Redeem.Post
, this is what was actually redeemed.
ItemStackSnapshot
s that would be redeemed, if
altered.Collection<String> getOriginalCommandsToExecute()
Note that other plugins might alter what is finally
redeemed by the kit, see getCommandsToExecute()
If getCommandsToExecute()
()} is null
, this
is what will be executed. Note that these are run by the ConsoleSource
.
The token that represents the player in commands is {{player}}
Optional<Collection<String>> getCommandsToExecute()
This might not represent what the kit might actually contain. See
getOriginalCommandsToExecute()
for that.
If this is Optional.empty()
, then getOriginalCommandsToExecute()
will be used.
The token that represents the player in commands is {{player}}
Note that these are run by the ConsoleSource
.