mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 06:28:49 +00:00
Added offline player handling
Signed-off-by: BuildTools <[email protected]>
This commit is contained in:
1 parent
8b104a04cd
commit
10210da792
8 files changed
+82
-15
No files matched your search
@@ -85,6 +85,20 @@ public class TeleportManager {
|
||||
new TimedTeleport(player, point, TimedTeleport.TargetType.POINT).begin();
|
||||
}
|
||||
|
||||
public static void teleportToOfflinePlayer(Player player, String targetPlayer, Connection connection) throws SQLException {
|
||||
final Integer playerID = DataManager.getPlayerId(targetPlayer, connection);
|
||||
if (playerID == null) {
|
||||
MessageManager.sendMessage(player, "error_player_not_found", targetPlayer);
|
||||
return;
|
||||
}
|
||||
TeleportationPoint offlinePoint = DataManager.getPlayerOfflinePosition(playerID, connection);
|
||||
if (offlinePoint == null) {
|
||||
MessageManager.sendMessage(player, "error_no_offline_position", targetPlayer);
|
||||
return;
|
||||
}
|
||||
teleportPlayer(player, offlinePoint, connection);
|
||||
}
|
||||
|
||||
public static void queueBackTeleport(Player player, Connection connection) throws SQLException {
|
||||
try {
|
||||
TeleportationPoint lastPosition = DataManager.getPlayerLastPosition(player, connection);
|
||||
|
||||
Reference in new issue
Block a user