mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 14:38:53 +00:00
Eject passengers before teleporting, Close #114
This commit is contained in:
1 parent
a1c4ed0e16
commit
4605cc89e9
2 files changed
+15
-5
No files matched your search
@@ -92,6 +92,9 @@ public class TeleportManager {
|
||||
DataManager.setPlayerTeleporting(player, false, connection);
|
||||
DataManager.deletePlayerDestination(player.getName(), connection);
|
||||
Location targetLocation = targetPoint[0].getLocation();
|
||||
if (!player.isEmpty()) {
|
||||
player.eject(); // Eject passengers before teleporting
|
||||
}
|
||||
Bukkit.getScheduler().runTask(plugin, () -> PaperLib.teleportAsync(player, targetLocation).thenRun(() -> {
|
||||
player.playSound(targetLocation, HuskHomes.getSettings().getTeleportationCompleteSound(), 1, 1);
|
||||
MessageManager.sendMessage(player, "teleporting_complete");
|
||||
|
||||
Reference in new issue
Block a user