From 09dc49aacb702408f00ec8418b6b6c0527436924 Mon Sep 17 00:00:00 2001 From: Warrior <50800980+Warriorrrr@users.noreply.github.com> Date: Mon, 11 Jul 2022 10:02:10 +0200 Subject: [PATCH] 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. --- .../java/com/earth2me/essentials/commands/Commandnick.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandnick.java b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandnick.java index d82c9bb4d35..699fef7130d 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandnick.java +++ b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandnick.java @@ -53,12 +53,12 @@ protected void updatePlayer(final Server server, final CommandSource sender, fin 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)); } }