Package net.godlycow.org.essc.api.home
Interface HomeManager
public interface HomeManager
The homes system. Get it from
EssentialsCAPI.getHomeManager().
Reads are cached and async, writes go through the same checks as the commands.-
Method Summary
Modifier and TypeMethodDescriptionvoidcancelTeleport(org.bukkit.entity.Player player) Cancels the player's pending teleport, if any.voidclearCache(UUID owner) Clears a player's home cache.deleteHome(UUID owner, String name) Deletes a home.Gets one home.fetchHomes(UUID owner) Gets all homes of a player.getCachedHomeNames(UUID owner) Gets cached home names without hitting storage.getHomeCount(UUID owner) Counts a player's homes.intgetMaxHomes(org.bukkit.entity.Player player) Gets how many homes a player may have.longgetRemainingCooldownSeconds(org.bukkit.entity.Player player) Gets remaining home cooldown in seconds, 0 if none.booleanhasPendingTeleport(org.bukkit.entity.Player player) Checks if the player has a teleport warming up.homeExists(UUID owner, String name) Checks if a home exists.booleanChecks if homes are enabled.booleanisOnCooldown(org.bukkit.entity.Player player) Checks if the player is on home cooldown.voidreload()Reloads home config from disk.Sets a home by UUID, works offline too.Sets a home for an online player.voidstartTeleport(org.bukkit.entity.Player player, Home home) Starts a home teleport with warmup and cooldown.
-
Method Details
-
isHomeSystemEnabled
boolean isHomeSystemEnabled()Checks if homes are enabled.- Returns:
- true if enabled
-
fetchHome
Gets one home.- Parameters:
owner- the owner UUIDname- the home name- Returns:
- future with the home, or null if missing
-
fetchHomes
Gets all homes of a player.- Parameters:
owner- the owner UUID- Returns:
- future with the homes, empty if none
-
homeExists
Checks if a home exists.- Parameters:
owner- the owner UUIDname- the home name- Returns:
- future with true if it exists
-
getHomeCount
Counts a player's homes.- Parameters:
owner- the owner UUID- Returns:
- future with the count
-
setHome
CompletableFuture<Boolean> setHome(org.bukkit.entity.Player player, String name, org.bukkit.Location location) Sets a home for an online player.- Parameters:
player- the owner, must be onlinename- the home namelocation- the home location- Returns:
- future with true on success
-
setHome
Sets a home by UUID, works offline too.- Parameters:
owner- the owner UUIDname- the home namelocation- the home location- Returns:
- future with true on success
-
deleteHome
Deletes a home.- Parameters:
owner- the owner UUIDname- the home name- Returns:
- future with true if something was deleted
-
getMaxHomes
int getMaxHomes(org.bukkit.entity.Player player) Gets how many homes a player may have.- Parameters:
player- the player- Returns:
- max homes
-
getCachedHomeNames
Gets cached home names without hitting storage.- Parameters:
owner- the owner UUID- Returns:
- cached home names
-
clearCache
Clears a player's home cache.- Parameters:
owner- the owner UUID
-
isOnCooldown
boolean isOnCooldown(org.bukkit.entity.Player player) Checks if the player is on home cooldown.- Parameters:
player- the player- Returns:
- true if on cooldown
-
getRemainingCooldownSeconds
long getRemainingCooldownSeconds(org.bukkit.entity.Player player) Gets remaining home cooldown in seconds, 0 if none.- Parameters:
player- the player- Returns:
- remaining seconds
-
hasPendingTeleport
boolean hasPendingTeleport(org.bukkit.entity.Player player) Checks if the player has a teleport warming up.- Parameters:
player- the player- Returns:
- true if a teleport is pending
-
cancelTeleport
void cancelTeleport(org.bukkit.entity.Player player) Cancels the player's pending teleport, if any.- Parameters:
player- the player
-
startTeleport
Starts a home teleport with warmup and cooldown.- Parameters:
player- the playerhome- the destination
-
reload
void reload()Reloads home config from disk.
-