Package net.godlycow.org.essc.api.kit
Interface KitManager
public interface KitManager
The kit system. Get it from
EssentialsCAPI.getKitManager().
If kits are disabled everything just returns empty or false.-
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if custom item names are stripped on claim.claimKitForPlayer(org.bukkit.entity.Player player, Kit kit) Claims the kit for the player.fetchClaimProfile(org.bukkit.entity.Player player, Kit kit) Gets the player's claim history for the kit.fetchCooldownRemainingAsync(org.bukkit.entity.Player player, Kit kit) Gets the remaining cooldown, fetching fresh data.findKitByName(String name) Finds a kit by name.getKitsAvailableTo(org.bukkit.entity.Player player) Gets the kits a player can claim right now.Gets all loaded kits.intgetPlayerClaimCount(org.bukkit.entity.Player player, Kit kit) Gets how many times the player claimed the kit.longgetRemainingCooldownSeconds(org.bukkit.entity.Player player, Kit kit) Gets the cached remaining cooldown in seconds, 0 if none.intGets how many kits are loaded.booleanhasCooldownExpiredFor(org.bukkit.entity.Player player, Kit kit) Checks if the player's cooldown for a kit is over.booleanhasPlayerClaimed(org.bukkit.entity.Player player, Kit kit) Checks if the player ever claimed the kit.booleanisClaimAllowedFor(org.bukkit.entity.Player player, Kit kit) Checks if the player is allowed to claim the kit right now.booleanisKitLoaded(String name) Checks if a kit with this name is loaded.booleanisPermittedToUse(org.bukkit.entity.Player player, Kit kit) Checks if the player has the kit permission.voidReloads kits from disk.
-
Method Details
-
getLoadedKits
Collection<Kit> getLoadedKits()Gets all loaded kits.- Returns:
- loaded kits, never null
-
findKitByName
Finds a kit by name.- Parameters:
name- the kit name- Returns:
- the kit, or null if not found
-
getKitsAvailableTo
Gets the kits a player can claim right now.- Parameters:
player- the player- Returns:
- available kits
-
hasCooldownExpiredFor
Checks if the player's cooldown for a kit is over.- Parameters:
player- the playerkit- the kit- Returns:
- true if no cooldown left
-
fetchCooldownRemainingAsync
Gets the remaining cooldown, fetching fresh data.- Parameters:
player- the playerkit- the kit- Returns:
- future with remaining seconds, 0 if none
-
getRemainingCooldownSeconds
Gets the cached remaining cooldown in seconds, 0 if none.- Parameters:
player- the playerkit- the kit- Returns:
- remaining seconds
-
hasPlayerClaimed
Checks if the player ever claimed the kit.- Parameters:
player- the playerkit- the kit- Returns:
- true if claimed before
-
getPlayerClaimCount
Gets how many times the player claimed the kit.- Parameters:
player- the playerkit- the kit- Returns:
- total claims
-
fetchClaimProfile
Gets the player's claim history for the kit.- Parameters:
player- the playerkit- the kit- Returns:
- the claim profile
-
isClaimAllowedFor
Checks if the player is allowed to claim the kit right now.- Parameters:
player- the playerkit- the kit- Returns:
- true if allowed
-
isPermittedToUse
Checks if the player has the kit permission.- Parameters:
player- the playerkit- the kit- Returns:
- true if permitted
-
reloadKitDefinitions
void reloadKitDefinitions()Reloads kits from disk. -
claimKitForPlayer
Claims the kit for the player. The future fails if the claim is rejected (permission, cooldown, limits).- Parameters:
player- the playerkit- the kit- Returns:
- future that completes when the items are given
-
getTotalLoadedKitCount
int getTotalLoadedKitCount()Gets how many kits are loaded.- Returns:
- loaded kit count
-
isKitLoaded
Checks if a kit with this name is loaded.- Parameters:
name- the kit name- Returns:
- true if loaded
-
areItemNamesStrippedOnClaim
boolean areItemNamesStrippedOnClaim()Checks if custom item names are stripped on claim.- Returns:
- true if stripped
-