Added permission node for Nickname Prefix bypass (#4995)

Allow a permission to determine whether the nickname prefix gets applied to a group or user. It also removes a statement that is not true in the essentials config, the nickname prefix is NOT included in the nickname max length.

Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>
Co-authored-by: Josh Roy <10731363+JRoy@users.noreply.github.com>
This commit is contained in:
Baylem 2022-10-25 02:44:05 -04:00 committed by GitHub
parent 879e70fb6b
commit 20011b9996
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

@ -464,7 +464,11 @@ public class User extends UserData implements Comparable<User>, IMessageRecipien
} else if (nick.equalsIgnoreCase(getName())) {
nickname = nick;
} else {
nickname = FormatUtil.replaceFormat(ess.getSettings().getNicknamePrefix()) + nick;
if (isAuthorized("essentials.nick.hideprefix")) {
nickname = nick;
} else {
nickname = FormatUtil.replaceFormat(ess.getSettings().getNicknamePrefix()) + nick;
}
suffix = "§r";
}

View File

@ -27,9 +27,10 @@
ops-name-color: '4'
# The character(s) to prefix all nicknames, so that you know they are not true usernames.
# Users with essentials.nick.hideprefix will not be prefixed with the character(s)
nickname-prefix: '~'
# The maximum length allowed in nicknames. The nickname prefix is included in this.
# The maximum length allowed in nicknames. The nickname prefix is not included in this.
max-nick-length: 15
# A list of phrases that cannot be used in nicknames. You can include regular expressions here.

View File

@ -709,3 +709,6 @@ permissions:
essentials.sudo.exempt: true
essentials.tempban.exempt: true
essentials.exempt.protect: true
essentials.nick.hideprefix:
default: false
description: Players with this permission will not have the nickname prefix applied to them