Eject passengers before teleporting, Close #114

This commit is contained in:
William committed 2021-12-06 16:25:41 +00:00
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");