mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
Make sure we leave any vehicles before teleporting.
This commit is contained in:
parent
18b31a7e50
commit
161862bc53
1 changed files with 8 additions and 0 deletions
|
@ -105,6 +105,10 @@ public class Teleport implements net.ess3.api.ITeleport
|
||||||
{
|
{
|
||||||
if (ess.getSettings().isTeleportSafetyEnabled())
|
if (ess.getSettings().isTeleportSafetyEnabled())
|
||||||
{
|
{
|
||||||
|
if (teleportee.getBase().isInsideVehicle())
|
||||||
|
{
|
||||||
|
teleportee.getBase().leaveVehicle();;
|
||||||
|
}
|
||||||
teleportee.getBase().teleport(LocationUtil.getSafeDestination(teleportee, loc));
|
teleportee.getBase().teleport(LocationUtil.getSafeDestination(teleportee, loc));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -114,6 +118,10 @@ public class Teleport implements net.ess3.api.ITeleport
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (teleportee.getBase().isInsideVehicle())
|
||||||
|
{
|
||||||
|
teleportee.getBase().leaveVehicle();;
|
||||||
|
}
|
||||||
teleportee.getBase().teleport(loc);
|
teleportee.getBase().teleport(loc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue