mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
Expand the HuskHomes API to add methods for teleporting players
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user