From 1be30e4a0aa05045891e31a9450c9973c98effc4 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 9 Mar 2014 01:13:41 +0000 Subject: Only enable teleport protection on plugin/command caused teleport events. --- Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java | 2 +- 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); } } -- cgit v1.2.3