diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 2a33c03cc..3fdc2db30 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -458,7 +458,7 @@ public class EssentialsPlayerListener implements Listener { } final User user = ess.getUser(player); //There is TeleportCause.COMMMAND but plugins have to actively pass the cause in on their teleports. - if (backListener && (event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND)) { + if (user.isAuthorized("essentials.back.onteleport") && backListener && (event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND)) { user.setLastLocation(); } if (teleportInvulnerability && (event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND)) { diff --git a/Essentials/src/com/earth2me/essentials/Teleport.java b/Essentials/src/com/earth2me/essentials/Teleport.java index d63378c37..bab29fb1f 100644 --- a/Essentials/src/com/earth2me/essentials/Teleport.java +++ b/Essentials/src/com/earth2me/essentials/Teleport.java @@ -129,7 +129,9 @@ public class Teleport implements ITeleport { return; } - teleportee.setLastLocation(); + if (teleportee.isAuthorized("essentials.back.onteleport")) { + teleportee.setLastLocation(); + } if (!teleportee.getBase().isEmpty()) { if (!ess.getSettings().isTeleportPassengerDismount()) { diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index b5dca8fa6..5de7a6e45 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -632,6 +632,12 @@ permissions: essentials.balancetop.exclude: default: false description: Players with this permission are excluded from the balancetop + essentials.back.onteleport: + default: true + description: Players with this permission will have back location stored during any teleportation + essentials.back.ondeath: + default: false + description: Players with this permission will have back location stored during death essentials.exempt: default: false description: Parent permission to be exempt from many moderator actions