mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 20:00:46 +00:00
vanished admins can't be teleported to
This commit is contained in:
parent
220ddf1c1e
commit
18776a8f05
5 changed files with 16 additions and 0 deletions
|
@ -30,6 +30,10 @@ public class Commandtp extends EssentialsCommand {
|
||||||
case 1:
|
case 1:
|
||||||
final User player = getPlayer(server, user, args, 0, false, true);
|
final User player = getPlayer(server, user, args, 0, false, true);
|
||||||
|
|
||||||
|
if (getTFMHandler().isVanished(player) && !getTFMHandler().isAdmin(user)) {
|
||||||
|
throw new PlayerNotFoundException();
|
||||||
|
}
|
||||||
|
|
||||||
if (!player.isTeleportEnabled()) {
|
if (!player.isTeleportEnabled()) {
|
||||||
throw new Exception(tl("teleportDisabled", player.getDisplayName()));
|
throw new Exception(tl("teleportDisabled", player.getDisplayName()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,9 @@ public class Commandtpa extends EssentialsCommand {
|
||||||
if (user.getName().equalsIgnoreCase(player.getName())) {
|
if (user.getName().equalsIgnoreCase(player.getName())) {
|
||||||
throw new NotEnoughArgumentsException();
|
throw new NotEnoughArgumentsException();
|
||||||
}
|
}
|
||||||
|
if (getTFMHandler().isVanished(player) && !getTFMHandler().isAdmin(user)) {
|
||||||
|
throw new PlayerNotFoundException();
|
||||||
|
}
|
||||||
if (!player.isAuthorized("essentials.tpaccept")) {
|
if (!player.isAuthorized("essentials.tpaccept")) {
|
||||||
throw new Exception(tl("teleportNoAcceptPermission", player.getDisplayName()));
|
throw new Exception(tl("teleportNoAcceptPermission", player.getDisplayName()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,9 @@ public class Commandtpahere extends EssentialsCommand {
|
||||||
if (user.getName().equalsIgnoreCase(player.getName())) {
|
if (user.getName().equalsIgnoreCase(player.getName())) {
|
||||||
throw new NotEnoughArgumentsException();
|
throw new NotEnoughArgumentsException();
|
||||||
}
|
}
|
||||||
|
if (getTFMHandler().isVanished(player) && !getTFMHandler().isAdmin(user)) {
|
||||||
|
throw new PlayerNotFoundException();
|
||||||
|
}
|
||||||
if (!player.isTeleportEnabled()) {
|
if (!player.isTeleportEnabled()) {
|
||||||
throw new Exception(tl("teleportDisabled", player.getDisplayName()));
|
throw new Exception(tl("teleportDisabled", player.getDisplayName()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,9 @@ public class Commandtphere extends EssentialsCommand {
|
||||||
@Override
|
@Override
|
||||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception {
|
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception {
|
||||||
final User player = getPlayer(server, user, args, 0);
|
final User player = getPlayer(server, user, args, 0);
|
||||||
|
if (getTFMHandler().isVanished(player) && !getTFMHandler().isAdmin(user)) {
|
||||||
|
throw new PlayerNotFoundException();
|
||||||
|
}
|
||||||
if (!player.isTeleportEnabled()) {
|
if (!player.isTeleportEnabled()) {
|
||||||
throw new Exception(tl("teleportDisabled", player.getDisplayName()));
|
throw new Exception(tl("teleportDisabled", player.getDisplayName()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,6 +65,9 @@ public class Commandtppos extends EssentialsCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
User user = getPlayer(server, args, 0, true, false);
|
User user = getPlayer(server, args, 0, true, false);
|
||||||
|
if (getTFMHandler().isVanished(user) && !getTFMHandler().isAdmin(sender.getSender())) {
|
||||||
|
throw new PlayerNotFoundException();
|
||||||
|
}
|
||||||
final double x = args[1].startsWith("~") ? user.getLocation().getX() + (args[1].length() > 1 ? Integer.parseInt(args[1].substring(1)) : 0) : Integer.parseInt(args[1]);
|
final double x = args[1].startsWith("~") ? user.getLocation().getX() + (args[1].length() > 1 ? Integer.parseInt(args[1].substring(1)) : 0) : Integer.parseInt(args[1]);
|
||||||
final double y = args[2].startsWith("~") ? user.getLocation().getY() + (args[2].length() > 1 ? Integer.parseInt(args[2].substring(1)) : 0) : Integer.parseInt(args[2]);
|
final double y = args[2].startsWith("~") ? user.getLocation().getY() + (args[2].length() > 1 ? Integer.parseInt(args[2].substring(1)) : 0) : Integer.parseInt(args[2]);
|
||||||
final double z = args[3].startsWith("~") ? user.getLocation().getZ() + (args[3].length() > 1 ? Integer.parseInt(args[3].substring(1)) : 0) : Integer.parseInt(args[3]);
|
final double z = args[3].startsWith("~") ? user.getLocation().getZ() + (args[3].length() > 1 ? Integer.parseInt(args[3].substring(1)) : 0) : Integer.parseInt(args[3]);
|
||||||
|
|
Loading…
Reference in a new issue