@@ -35,9 +35,9 @@ public enum TextFormat {
3535 */
3636 DARK_PURPLE ('5' , 0x5 ),
3737 /**
38- * Represents gold .
38+ * Represents orange .
3939 */
40- GOLD ('6' , 0x6 ),
40+ ORANGE ('6' , 0x6 ),
4141 /**
4242 * Represents gray.
4343 */
@@ -74,6 +74,10 @@ public enum TextFormat {
7474 * Represents white.
7575 */
7676 WHITE ('f' , 0xF ),
77+ /**
78+ * Represents gold.
79+ */
80+ GOLD ('g' , 0x16 ),
7781 /**
7882 * Makes the text obfuscated.
7983 */
@@ -105,7 +109,7 @@ public enum TextFormat {
105109 */
106110 public static final char ESCAPE = '\u00A7' ;
107111
108- private static final Pattern CLEAN_PATTERN = Pattern .compile ("(?i)" + ESCAPE + "[0-9A-FK -OR]" );
112+ private static final Pattern CLEAN_PATTERN = Pattern .compile ("(?i)" + ESCAPE + "[0-9A-GK -OR]" );
109113 private final static Map <Integer , TextFormat > BY_ID = Maps .newTreeMap ();
110114 private final static Map <Character , TextFormat > BY_CHAR = new HashMap <>();
111115
@@ -185,7 +189,7 @@ public static String clean(final String input, final boolean recursive) {
185189 * Translates a string using an alternate format code character into a
186190 * string that uses the internal TextFormat.ESCAPE format code
187191 * character. The alternate format code character will only be replaced if
188- * it is immediately followed by 0-9, A-F , a-f , K-O, k-o, R or r.
192+ * it is immediately followed by 0-9, A-G , a-g , K-O, k-o, R or r.
189193 *
190194 * @param altFormatChar The alternate format code character to replace. Ex: &
191195 * @param textToTranslate Text containing the alternate format code character.
@@ -194,7 +198,7 @@ public static String clean(final String input, final boolean recursive) {
194198 public static String colorize (char altFormatChar , String textToTranslate ) {
195199 char [] b = textToTranslate .toCharArray ();
196200 for (int i = 0 ; i < b .length - 1 ; i ++) {
197- if (b [i ] == altFormatChar && "0123456789AaBbCcDdEeFfKkLlMmNnOoRr " .indexOf (b [i + 1 ]) > -1 ) {
201+ if (b [i ] == altFormatChar && "0123456789AaBbCcDdEeFfGgKkLlMmNnOoRr " .indexOf (b [i + 1 ]) > -1 ) {
198202 b [i ] = TextFormat .ESCAPE ;
199203 b [i + 1 ] = Character .toLowerCase (b [i + 1 ]);
200204 }
@@ -206,7 +210,7 @@ public static String colorize(char altFormatChar, String textToTranslate) {
206210 * Translates a string, using an ampersand (&) as an alternate format code
207211 * character, into a string that uses the internal TextFormat.ESCAPE format
208212 * code character. The alternate format code character will only be replaced if
209- * it is immediately followed by 0-9, A-F , a-f , K-O, k-o, R or r.
213+ * it is immediately followed by 0-9, A-G , a-g , K-O, k-o, R or r.
210214 *
211215 * @param textToTranslate Text containing the alternate format code character.
212216 * @return Text containing the TextFormat.ESCAPE format code character.
0 commit comments