Allow color-only nickname changes.

This commit is contained in:
Tux 2015-09-13 01:39:56 -04:00 committed by drtshock
parent 2d3691107d
commit 87842a36ba
2 changed files with 3 additions and 0 deletions

View File

@ -79,6 +79,8 @@ public class Commandnick extends EssentialsLoopCommand {
throw new Exception(tl("nickTooLong"));
} else if (FormatUtil.stripFormat(newNick).length() < 1) {
throw new Exception(tl("nickNamesAlpha"));
} else if (user != null && (user.isAuthorized("essentials.nick.changecolors") || user.isAuthorized("essentials.nick.changecolours")) && !FormatUtil.stripFormat(newNick).equals(user.getName())) {
throw new Exception(tl("nickNamesOnlyColorChanges"));
}
return newNick;
}

View File

@ -261,6 +261,7 @@ nickChanged=\u00a76Nickname changed.
nickDisplayName=\u00a74You have to enable change-displayname in Essentials config.
nickInUse=\u00a74That name is already in use.
nickNamesAlpha=\u00a74Nicknames must be alphanumeric.
nickNamesOnlyColorChanges=\u00a74Nicknames can only have their colors changed.
nickNoMore=\u00a76You no longer have a nickname.
nickSet=\u00a76Your nickname is now \u00a7c{0}\u00a76.
nickTooLong=\u00a74That nickname is too long.