Add permission for storing user's last location on teleportation (#3272)

This commit is contained in:
Josh Roy 2020-05-13 18:53:36 -04:00 committed by GitHub
parent 8f5b97b9d2
commit 302f0acbaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View file

@ -458,7 +458,7 @@ public class EssentialsPlayerListener implements Listener {
} }
final User user = ess.getUser(player); final User user = ess.getUser(player);
//There is TeleportCause.COMMMAND but plugins have to actively pass the cause in on their teleports. //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(); user.setLastLocation();
} }
if (teleportInvulnerability && (event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND)) { if (teleportInvulnerability && (event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND)) {

View file

@ -129,7 +129,9 @@ public class Teleport implements ITeleport {
return; return;
} }
teleportee.setLastLocation(); if (teleportee.isAuthorized("essentials.back.onteleport")) {
teleportee.setLastLocation();
}
if (!teleportee.getBase().isEmpty()) { if (!teleportee.getBase().isEmpty()) {
if (!ess.getSettings().isTeleportPassengerDismount()) { if (!ess.getSettings().isTeleportPassengerDismount()) {

View file

@ -632,6 +632,12 @@ permissions:
essentials.balancetop.exclude: essentials.balancetop.exclude:
default: false default: false
description: Players with this permission are excluded from the balancetop 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: essentials.exempt:
default: false default: false
description: Parent permission to be exempt from many moderator actions description: Parent permission to be exempt from many moderator actions