public interface NucleusKitService
Modifier and Type | Interface and Description |
---|---|
static interface |
NucleusKitService.RedeemResult
The result for a successful redemption.
|
Modifier and Type | Method and Description |
---|---|
Kit |
createKit(String name)
Gets a new kit object for use with the Kit service.
|
Collection<org.spongepowered.api.item.inventory.ItemStack> |
getItemsForPlayer(Kit kit,
org.spongepowered.api.entity.living.player.Player player)
Returns the items for a kit that the target player would redeem
(that is, with token replacements if applicable).
|
Optional<Kit> |
getKit(String name)
Gets the requested kit if it exists.
|
Set<String> |
getKitNames()
Gets the names of all the kits currently in NucleusPlugin.
|
NucleusKitService.RedeemResult |
redeemKit(Kit kit,
org.spongepowered.api.entity.living.player.Player player,
boolean performChecks)
Redeems a kit on a player.
|
NucleusKitService.RedeemResult |
redeemKit(Kit kit,
org.spongepowered.api.entity.living.player.Player player,
boolean performChecks,
boolean mustRedeemAll)
Redeems a kit on a player.
|
boolean |
removeKit(String kitName)
Removes the requested kit.
|
void |
renameKit(String kitName,
String newKitName)
Renames a kit.
|
void |
saveKit(Kit kit)
Saves a kit.
|
default void |
saveKit(String kitName,
Kit kit)
Deprecated.
kitName is now ignored.
|
Optional<Kit> getKit(String name)
name
- The name of the kit.Optional
that might contain the kit.Collection<org.spongepowered.api.item.inventory.ItemStack> getItemsForPlayer(Kit kit, org.spongepowered.api.entity.living.player.Player player)
kit
- The kit to processplayer
- The playerNucleusKitService.RedeemResult redeemKit(Kit kit, org.spongepowered.api.entity.living.player.Player player, boolean performChecks) throws KitRedeemException
kit
- The kit to redeemplayer
- The player to redeem the kit againstperformChecks
- Whether to perform standard permission and cooldown checksNucleusKitService.RedeemResult
KitRedeemException
- thrown if a problem occurs.NucleusKitService.RedeemResult redeemKit(Kit kit, org.spongepowered.api.entity.living.player.Player player, boolean performChecks, boolean mustRedeemAll) throws KitRedeemException
kit
- The kit to redeemplayer
- The player to redeem the kit againstperformChecks
- Whether to perform standard permission and cooldown checksmustRedeemAll
- Whether all items must be redeemed to count as a successNucleusKitService.RedeemResult
KitRedeemException
- thrown if a problem occurs.boolean removeKit(String kitName)
kitName
- The name of the kit to remove.true
if a kit was removed.void renameKit(String kitName, String newKitName) throws IllegalArgumentException
kitName
- The name of the kit to renamenewKitName
- The new name of the kitIllegalArgumentException
- if either the kit or the target name are unavailable@Deprecated default void saveKit(String kitName, Kit kit)
kitName
- The name of the kit to save.kit
- The kit to save.void saveKit(Kit kit)
kit
- The kit.Kit createKit(String name) throws IllegalArgumentException
Do not make your own kit type, it will not get saved! Use this instead.
name
- The name of the kit to createKit
IllegalArgumentException
- if the kit name already exists, or is invalid