Expand the HuskHomes API to add methods for teleporting players

This commit is contained in:
William278 committed 2021-04-16 14:49:41 +01:00
1 parent a8f4a1371f
commit 9784623d45
2 files changed
+32 -1

No files matched your search

@@ -140,4 +140,35 @@ public class HuskHomesAPI {
public TeleportationPoint getSpawnPosition() {
return TeleportManager.getSpawnLocation();
}
/**
* Teleport a player to a specific TeleportationPoint
* @param player The player to be teleported
* @param point The target teleportationPoint
* @param timed Whether or not to do a warmup countdown
* @see TeleportationPoint
*/
public void teleportPlayer(Player player, TeleportationPoint point, boolean timed) {
if (timed) {
TeleportManager.queueTimedTeleport(player, point);
} else {
TeleportManager.teleportPlayer(player, point);
}
}
/**
* Teleport a player to a specific TeleportationPoint
* @param player The player to be teleported
* @param targetPlayerName The target player's name
* @param timed Whether or not to do a warmup countdown
* @see TeleportationPoint
*/
public void teleportPlayer(Player player, String targetPlayerName, boolean timed) {
if (timed) {
TeleportManager.queueTimedTeleport(player, targetPlayerName);
} else {
TeleportManager.teleportPlayer(player, targetPlayerName);
}
}
}