Package net.godlycow.org.essc.api.warp
Interface WarpManager
public interface WarpManager
The warp system. Get it from
EssentialsCAPI.getWarpManager().
If warps are disabled lookups come back empty and writes return false.-
Method Summary
Modifier and TypeMethodDescriptionvoidcancelWarp(org.bukkit.entity.Player player) Cancels the player's pending warp, if any.createWarp(String name, org.bukkit.Location location) Creates a warp.deleteWarp(String name) Deletes a warp.Gets all warps, including hidden ones.Gets all category names.longgetRemainingCooldownSeconds(org.bukkit.entity.Player player) Gets remaining warp cooldown in seconds, 0 if none.Gets only public warps.Gets a warp by name.getWarpsByCategory(String category) Gets warps in one category.getWarpUsage(UUID playerId, String warpName) Counts how often a player used a warp.booleanhasPendingWarp(org.bukkit.entity.Player player) Checks if the player has a warp warming up.booleanisOnCooldown(org.bukkit.entity.Player player) Checks if the player is on warp cooldown.booleanChecks if warps are enabled.voidreload()Reloads warps from disk.updateWarp(Warp warp) Saves changes made to a warp.booleanwarpExists(String name) Checks if a warp exists.
-
Method Details
-
isWarpSystemEnabled
boolean isWarpSystemEnabled()Checks if warps are enabled.- Returns:
- true if enabled
-
getWarp
Gets a warp by name.- Parameters:
name- the warp name- Returns:
- the warp, or null if missing
-
warpExists
Checks if a warp exists.- Parameters:
name- the warp name- Returns:
- true if it exists
-
getAllWarps
Collection<Warp> getAllWarps()Gets all warps, including hidden ones.- Returns:
- all warps, never null
-
getVisibleWarps
Collection<Warp> getVisibleWarps()Gets only public warps.- Returns:
- visible warps, never null
-
getWarpsByCategory
Gets warps in one category.- Parameters:
category- the category name- Returns:
- warps in the category, empty if none
-
getCategories
Gets all category names.- Returns:
- category names, never null
-
createWarp
Creates a warp.- Parameters:
name- the warp namelocation- the warp location- Returns:
- future with true on success
-
deleteWarp
Deletes a warp.- Parameters:
name- the warp name- Returns:
- future with true if something was deleted
-
updateWarp
Saves changes made to a warp.- Parameters:
warp- the changed warp- Returns:
- future with true on success
-
getWarpUsage
Counts how often a player used a warp.- Parameters:
playerId- the player UUIDwarpName- the warp name- Returns:
- future with the usage count
-
isOnCooldown
boolean isOnCooldown(org.bukkit.entity.Player player) Checks if the player is on warp cooldown.- Parameters:
player- the player- Returns:
- true if on cooldown
-
getRemainingCooldownSeconds
long getRemainingCooldownSeconds(org.bukkit.entity.Player player) Gets remaining warp cooldown in seconds, 0 if none.- Parameters:
player- the player- Returns:
- remaining seconds
-
hasPendingWarp
boolean hasPendingWarp(org.bukkit.entity.Player player) Checks if the player has a warp warming up.- Parameters:
player- the player- Returns:
- true if pending
-
cancelWarp
void cancelWarp(org.bukkit.entity.Player player) Cancels the player's pending warp, if any.- Parameters:
player- the player
-
reload
void reload()Reloads warps from disk.
-