public static interface NucleusKitEvent.Redeem extends NucleusKitEvent, org.spongepowered.api.event.entity.living.humanoid.player.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 |
---|---|
java.util.Optional<java.util.Collection<java.lang.String>> |
getCommandsToExecute()
Gets the commands that the kit will run, if a plugin has set them.
|
java.util.Optional<java.time.Instant> |
getLastRedeemedTime()
Gets the last time the kit was redeemed, if any.
|
java.lang.String |
getName()
Gets the name of the kit.
|
java.util.Collection<java.lang.String> |
getOriginalCommandsToExecute()
Gets the commands that the kit will run.
|
java.util.Collection<org.spongepowered.api.item.inventory.ItemStackSnapshot> |
getOriginalStacksToRedeem()
Gets the
ItemStackSnapshot s that the kit contains. |
Kit |
getRedeemedKit()
Gets the kit that has been redeemed.
|
java.util.Optional<java.util.Collection<org.spongepowered.api.item.inventory.ItemStackSnapshot>> |
getStacksToRedeem()
Gets the
ItemStackSnapshot s that will be redeemed, if a
plugin has altered it. |
boolean |
isFirstJoin()
Gets whether the redemption is due to a player joining the server for
the first time.
|
boolean isFirstJoin()
java.util.Optional<java.time.Instant> getLastRedeemedTime()
Instant
the kit was last redeemed.java.lang.String getName()
Kit getRedeemedKit()
java.util.Collection<org.spongepowered.api.item.inventory.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.java.util.Optional<java.util.Collection<org.spongepowered.api.item.inventory.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.java.util.Collection<java.lang.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}}
java.util.Optional<java.util.Collection<java.lang.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
.