Fix nickname feedback message when change-displayname is off (#4980)

Make the feedback message use the nickname instead of the player's display name if change-displayname is disabled. Fixes #4979.
This commit is contained in:
Warrior 2022-07-11 10:02:10 +02:00 committed by GitHub
parent f4b6197a49
commit 09dc49aacb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,12 +53,12 @@ public class Commandnick extends EssentialsLoopCommand {
if (!target.getDisplayName().equalsIgnoreCase(target.getDisplayName())) {
target.sendMessage(tl("nickNoMore"));
}
target.sendMessage(tl("nickSet", target.getDisplayName()));
target.sendMessage(tl("nickSet", ess.getSettings().changeDisplayName() ? target.getDisplayName() : nick));
} else if (nickInUse(target, nick)) {
throw new NotEnoughArgumentsException(tl("nickInUse"));
} else {
setNickname(server, sender, target, nick);
target.sendMessage(tl("nickSet", target.getDisplayName()));
target.sendMessage(tl("nickSet", ess.getSettings().changeDisplayName() ? target.getDisplayName() : nick));
}
}