mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 14:38:53 +00:00
Add an API event to get if a user is warming up to teleport
This commit is contained in:
1 parent
ab0455c29a
commit
ea808a37d2
2 files changed
+22
No files matched your search
@@ -98,6 +98,18 @@ public abstract class BaseHuskHomesAPI {
|
||||
return plugin.getDatabase().getRespawnPosition(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if a user is currently warming up for a timed teleport; that is, they are in the state where they
|
||||
* must stand still and not take damage for the set amount of seconds before a teleport can be executed.
|
||||
*
|
||||
* @param user The {@link User} to check
|
||||
* @return {@code true} if the user is currently warming up, otherwise {@code false}
|
||||
* @since 3.0.2
|
||||
*/
|
||||
public boolean isUserWarmingUp(@NotNull User user) {
|
||||
return plugin.getTeleportManager().isWarmingUp(user.uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save {@link UserData} to the database, updating it if data for the user already exists, or adding new user data if it doesn't.
|
||||
*
|
||||
|
||||
@@ -489,4 +489,14 @@ public class TeleportManager {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the player is currently warming up to teleport
|
||||
*
|
||||
* @param uuid the player's {@link UUID}
|
||||
* @return {@code true} if the player is warming up, {@code false} otherwise
|
||||
*/
|
||||
public boolean isWarmingUp(@NotNull final UUID uuid) {
|
||||
return currentlyOnWarmup.contains(uuid);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user