Upload folder via GUI - src
This commit is contained in:
@@ -73,8 +73,15 @@ public class TeleportManager {
|
||||
private void executeTeleport(Player player, TeleportLocation dest) {
|
||||
String localServer = plugin.getConfigManager().getServerName();
|
||||
|
||||
// Always save last location and apply cooldown, regardless of server
|
||||
plugin.getDatabaseManager().saveLastLocation(player.getUniqueId(),
|
||||
new TeleportLocation(player.getLocation(), localServer));
|
||||
cooldowns.put(player.getUniqueId(), System.currentTimeMillis());
|
||||
|
||||
if (!dest.isLocalServer(localServer)) {
|
||||
// BungeeCord-Teleport
|
||||
// BungeeCord cross-server teleport:
|
||||
// connectToServer sends the LOCATION payload BEFORE the Connect message
|
||||
// so the player arrives directly at the target coordinates.
|
||||
if (plugin.getBungeeMessenger() != null) {
|
||||
plugin.getBungeeMessenger().connectToServer(player, dest.getServer(), dest.getWorld(),
|
||||
dest.getX(), dest.getY(), dest.getZ(), dest.getYaw(), dest.getPitch());
|
||||
@@ -85,16 +92,11 @@ public class TeleportManager {
|
||||
|
||||
Location loc = dest.toBukkitLocation();
|
||||
if (loc == null || loc.getWorld() == null) {
|
||||
player.sendMessage("§cZielwelt nicht gefunden!");
|
||||
player.sendMessage("\u00a7cZielwelt nicht gefunden!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Save last location to database
|
||||
plugin.getDatabaseManager().saveLastLocation(player.getUniqueId(),
|
||||
new TeleportLocation(player.getLocation(), localServer));
|
||||
|
||||
player.teleport(loc);
|
||||
cooldowns.put(player.getUniqueId(), System.currentTimeMillis());
|
||||
player.sendMessage(plugin.getConfigManager().getMessage("teleport-success"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user