Deny teleport requests to players lacking permission to accept (#3361)

This PR will deny any teleport requests to players lacking permission to accept the request (`essentials.tpaccept`).

Closes #1259.
This commit is contained in:
oxygencraft 2020-06-15 22:36:13 +10:00 committed by GitHub
parent 3d096c1f31
commit 3e5bd4cf09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -28,6 +28,9 @@ public class Commandtpa extends EssentialsCommand {
if (user.getName().equalsIgnoreCase(player.getName())) {
throw new NotEnoughArgumentsException();
}
if (!player.isAuthorized("essentials.tpaccept")) {
throw new Exception(tl("teleportNoAcceptPermission", player.getDisplayName()));
}
if (!player.isTeleportEnabled()) {
throw new Exception(tl("teleportDisabled", player.getDisplayName()));
}

View File

@ -538,6 +538,7 @@ teleportHome=\u00a76Teleporting to \u00a7c{0}\u00a76.
teleporting=\u00a76Teleporting...
teleportInvalidLocation=Value of coordinates cannot be over 30000000
teleportNewPlayerError=\u00a74Failed to teleport new player\!
teleportNoAcceptPermission=\u00a7c{0} \u00a74does not have permission to accept teleport requests.
teleportRequest=\u00a7c{0}\u00a76 has requested to teleport to you.
teleportRequestAllCancelled=\u00a76All outstanding teleport requests cancelled.
teleportRequestCancelled=\u00a76Your teleport request to \u00a7c{0}\u00a76 was cancelled.