Deny tpahere requests to players without permission to accept (#3478)

This commit is contained in:
MD 2020-07-09 18:45:14 +01:00 committed by GitHub
parent b58c98bea0
commit 07fa87dc6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -25,6 +25,9 @@ public class Commandtpahere 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()));
}