mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-04-26 08:29:44 +00:00
Only enable teleport protection on plugin/command caused teleport events.
This commit is contained in:
parent
28ec7c2d80
commit
1be30e4a0a
2 changed files with 3 additions and 3 deletions
|
@ -405,7 +405,7 @@ public class EssentialsPlayerListener implements Listener
|
|||
{
|
||||
user.setLastLocation();
|
||||
}
|
||||
if (teleportInvulnerability)
|
||||
if (teleportInvulnerability && (event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND))
|
||||
{
|
||||
user.enableInvulnerabilityAfterTeleport();
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ public class Teleport implements net.ess3.api.ITeleport
|
|||
{
|
||||
teleportee.getBase().leaveVehicle();
|
||||
}
|
||||
teleportee.getBase().teleport(LocationUtil.getSafeDestination(teleportee, loc));
|
||||
teleportee.getBase().teleport(LocationUtil.getSafeDestination(teleportee, loc), cause);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -123,7 +123,7 @@ public class Teleport implements net.ess3.api.ITeleport
|
|||
{
|
||||
teleportee.getBase().leaveVehicle();
|
||||
}
|
||||
teleportee.getBase().teleport(LocationUtil.getRoundedDestination(loc));
|
||||
teleportee.getBase().teleport(LocationUtil.getRoundedDestination(loc), cause);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue