Only enable teleport protection on plugin/command caused teleport events.

This commit is contained in:
KHobbits 2014-03-09 01:13:41 +00:00
parent 28ec7c2d80
commit 1be30e4a0a
2 changed files with 3 additions and 3 deletions

View file

@ -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();
} }

View file

@ -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);
} }
} }