mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 14:38:53 +00:00
Ensure player is dismounted before teleport, fix #496
This commit is contained in:
1 parent
e579b2b05e
commit
2145d6925f
3 files changed
+3
No files matched your search
@@ -136,6 +136,7 @@ public class BukkitUser extends OnlineUser {
|
||||
// Run on the appropriate thread scheduler for this platform
|
||||
plugin.getScheduler().entitySpecificScheduler(player).run(
|
||||
() -> {
|
||||
player.leaveVehicle();
|
||||
if (async || plugin.getScheduler().isUsingFolia()) {
|
||||
PaperLib.teleportAsync(player, bukkitLocation, PlayerTeleportEvent.TeleportCause.PLUGIN);
|
||||
return;
|
||||
|
||||
@@ -131,6 +131,7 @@ public class FabricUser extends OnlineUser {
|
||||
throw new TeleportationException(TeleportationException.Type.ILLEGAL_TARGET_COORDINATES, plugin);
|
||||
}
|
||||
|
||||
player.dismountVehicle();
|
||||
FabricDimensions.teleport(
|
||||
player,
|
||||
server.getWorld(server.getWorldRegistryKeys().stream()
|
||||
|
||||
@@ -113,6 +113,7 @@ public class SpongeUser extends OnlineUser {
|
||||
if (serverLocation.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
player.vehicle().ifPresent(vehicle -> vehicle.get().passengers().remove(player));
|
||||
player.setLocation(serverLocation.get());
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user