API interface for interacting with EssentialsC's warp system. Manages named teleport locations with permissions, economy costs, categories, and usage tracking. All data is persisted to SQLite.
Retrieve an instance via EssentialsCAPI.getWarpApi().
WarpApi warp = APIProvider.getAPI().getWarpApi();
warp.getWarp("spawn").ifPresent(w -> {
player.teleport(w.location());
});
The WarpEntry record lives in the
net.godlycow.org.essc.api.warp sub-package.
Method Summary
| boolean |
isSystemEnabled() Returns whether the warp system is globally enabled. |
| Optional<WarpEntry> |
getWarp(String name) Returns the warp with the given name, if it exists. |
| boolean |
warpExists(String name) Returns whether a warp with the given name exists. |
| List<WarpEntry> |
getAllWarps() Returns all warps including hidden ones. |
| List<WarpEntry> |
getVisibleWarps() Returns all non-hidden warps sorted alphabetically. |
| List<WarpEntry> |
getWarpsByCategory(String category) Returns warps in the specified category. |
| Set<String> |
getCategories() Returns all unique category names. |
| CompletableFuture<Boolean> |
createWarp(String name, Location location) Creates a new warp at the given location (async). |
| CompletableFuture<Boolean> |
deleteWarp(String name) Deletes the warp with the given name (async). |
| CompletableFuture<Boolean> |
updateWarp(WarpEntry warp) Updates an existing warp's properties (async). |
| long |
getRemainingCooldown(UUID uuid) Returns the remaining cooldown in seconds for the player. |
| CompletableFuture<Integer> |
getWarpUsage(UUID uuid, String warpName) Returns the number of times the player has used the specified warp (async). |
| void |
reload() Reloads all warps from the database. |
Returns whether the warp system is globally enabled.
Returns:| boolean | true if warps are enabled in config |
Returns the warp with the given name, if it exists.
Parameters:| name | the warp name; must not be null |
| Optional<WarpEntry> | an Optional containing the warp, or empty if not found |
Returns whether a warp with the given name exists.
Parameters:| name | the warp name to check; must not be null |
| boolean | true if the warp exists |
Returns all warps including hidden ones.
Returns:| List<WarpEntry> | an unmodifiable list of all warps; never null |
Returns all non-hidden warps sorted alphabetically.
Returns:| List<WarpEntry> | an unmodifiable list of visible warps; never null |
Returns warps in the specified category.
Parameters:| category | the category name; must not be null |
| List<WarpEntry> | an unmodifiable list of warps in the category; never null |
Returns all unique category names.
Returns:| Set<String> | an unmodifiable set of category names; never null |
Creates a new warp at the given location.
| name | the unique warp name; must not be null |
| location | the location to set; must not be null |
| CompletableFuture<Boolean> | a future resolving to true if created |
Deletes the warp with the given name.
| name | the warp name to delete; must not be null |
| CompletableFuture<Boolean> | a future resolving to true if deleted |
Updates an existing warp's properties.
| warp | the warp entry with updated values; must not be null |
| CompletableFuture<Boolean> | a future resolving to true if updated |
Returns the remaining cooldown in seconds for the player.
Parameters:| uuid | the player's UUID; must not be null |
| long | remaining cooldown in seconds, or 0 if none |
Returns the number of times the player has used the specified warp.
| uuid | the player's UUID; must not be null |
| warpName | the warp name; must not be null |
| CompletableFuture<Integer> | a future resolving to the usage count |
Reloads all warps from the database. Clears caches and re-reads from SQLite.