mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-04 19:46:27 +00:00
Add permission for storing user's last location on teleportation (#3272)
This commit is contained in:
parent
8f5b97b9d2
commit
302f0acbaa
3 changed files with 10 additions and 2 deletions
|
@ -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)) {
|
||||||
|
|
|
@ -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()) {
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue