From 87842a36ba01f136c4c1f3abd51d60026ff553f3 Mon Sep 17 00:00:00 2001 From: Tux Date: Sun, 13 Sep 2015 01:39:56 -0400 Subject: [PATCH] Allow color-only nickname changes. --- .../src/com/earth2me/essentials/commands/Commandnick.java | 2 ++ Essentials/src/messages_en.properties | 1 + 2 files changed, 3 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnick.java b/Essentials/src/com/earth2me/essentials/commands/Commandnick.java index 4ef363e90..a9f17df09 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandnick.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandnick.java @@ -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; } diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 7213ded8f..890945bbe 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -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.