mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-08 07:36:42 +02:00
Only enable teleport protection on plugin/command caused teleport events.
This commit is contained in:
@@ -405,7 +405,7 @@ public class EssentialsPlayerListener implements Listener
|
|||||||
{
|
{
|
||||||
user.setLastLocation();
|
user.setLastLocation();
|
||||||
}
|
}
|
||||||
if (teleportInvulnerability)
|
if (teleportInvulnerability && (event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND))
|
||||||
{
|
{
|
||||||
user.enableInvulnerabilityAfterTeleport();
|
user.enableInvulnerabilityAfterTeleport();
|
||||||
}
|
}
|
||||||
|
@@ -110,7 +110,7 @@ public class Teleport implements net.ess3.api.ITeleport
|
|||||||
{
|
{
|
||||||
teleportee.getBase().leaveVehicle();
|
teleportee.getBase().leaveVehicle();
|
||||||
}
|
}
|
||||||
teleportee.getBase().teleport(LocationUtil.getSafeDestination(teleportee, loc));
|
teleportee.getBase().teleport(LocationUtil.getSafeDestination(teleportee, loc), cause);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -123,7 +123,7 @@ public class Teleport implements net.ess3.api.ITeleport
|
|||||||
{
|
{
|
||||||
teleportee.getBase().leaveVehicle();
|
teleportee.getBase().leaveVehicle();
|
||||||
}
|
}
|
||||||
teleportee.getBase().teleport(LocationUtil.getRoundedDestination(loc));
|
teleportee.getBase().teleport(LocationUtil.getRoundedDestination(loc), cause);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user