mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 14:38:53 +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
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>me.William278</groupId>
|
<groupId>me.William278</groupId>
|
||||||
<artifactId>HuskHomes</artifactId>
|
<artifactId>HuskHomes</artifactId>
|
||||||
<version>2.4</version>
|
<version>2.4.1</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>HuskHomes</name>
|
<name>HuskHomes</name>
|
||||||
|
|||||||
@@ -140,4 +140,35 @@ public class HuskHomesAPI {
|
|||||||
public TeleportationPoint getSpawnPosition() {
|
public TeleportationPoint getSpawnPosition() {
|
||||||
return TeleportManager.getSpawnLocation();
|
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