diff options
author | KHobbits <rob@khobbits.co.uk> | 2014-03-09 01:13:41 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2014-03-09 01:13:41 +0000 |
commit | 1be30e4a0aa05045891e31a9450c9973c98effc4 (patch) | |
tree | c935ece888933699cb83bea0552e0a3c0cd0052b | |
parent | 28ec7c2d808a74b6fd96fed584cb3c51d774ea09 (diff) | |
download | Essentials-1be30e4a0aa05045891e31a9450c9973c98effc4.tar Essentials-1be30e4a0aa05045891e31a9450c9973c98effc4.tar.gz Essentials-1be30e4a0aa05045891e31a9450c9973c98effc4.tar.lz Essentials-1be30e4a0aa05045891e31a9450c9973c98effc4.tar.xz Essentials-1be30e4a0aa05045891e31a9450c9973c98effc4.zip |
Only enable teleport protection on plugin/command caused teleport events.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java | 2 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/Teleport.java | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 2f7128d39..b6743a59f 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -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(); } diff --git a/Essentials/src/com/earth2me/essentials/Teleport.java b/Essentials/src/com/earth2me/essentials/Teleport.java index 251e92646..225397b37 100644 --- a/Essentials/src/com/earth2me/essentials/Teleport.java +++ b/Essentials/src/com/earth2me/essentials/Teleport.java @@ -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); } } |