Add message for unknown last location for /tpo (#5290)

This commit is contained in:
Josh Roy 2023-04-02 18:04:36 -04:00 committed by GitHub
parent 0f4af9e735
commit ecb1850451
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -21,6 +21,11 @@ public class Commandtpoffline extends EssentialsCommand {
final User target = getPlayer(server, args, 0, true, true);
final Location logout = target.getLogoutLocation();
if (logout == null) {
user.sendMessage(tl("teleportOfflineUnknown", user.getDisplayName()));
throw new NoChargeException();
}
if (user.getWorld() != logout.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + logout.getWorld().getName())) {
throw new Exception(tl("noPerm", "essentials.worlds." + logout.getWorld().getName()));
}

View File

@ -1268,6 +1268,7 @@ teleportRequestTimeoutInfo=\u00a76This request will timeout after\u00a7c {0} sec
teleportTop=\u00a76Teleporting to top.
teleportToPlayer=\u00a76Teleporting to \u00a7c{0}\u00a76.
teleportOffline=\u00a76The player \u00a7c{0}\u00a76 is currently offline. You are able to teleport to them using /otp.
teleportOfflineUnknown=\u00a76Unable to find the last known position of \u00a7c{0}\u00a76.
tempbanExempt=\u00a74You may not tempban that player.
tempbanExemptOffline=\u00a74You may not tempban offline players.
tempbanJoin=You are banned from this server for {0}. Reason: {1}