@@ -73,6 +73,7 @@ abstract class TextFormat{
7373 public const MATERIAL_DIAMOND = TextFormat::ESCAPE . "s " ;
7474 public const MATERIAL_LAPIS = TextFormat::ESCAPE . "t " ;
7575 public const MATERIAL_AMETHYST = TextFormat::ESCAPE . "u " ;
76+ public const MATERIAL_RESIN = TextFormat::ESCAPE . "v " ;
7677
7778 public const COLORS = [
7879 self ::BLACK => self ::BLACK ,
@@ -102,6 +103,7 @@ abstract class TextFormat{
102103 self ::MATERIAL_DIAMOND => self ::MATERIAL_DIAMOND ,
103104 self ::MATERIAL_LAPIS => self ::MATERIAL_LAPIS ,
104105 self ::MATERIAL_AMETHYST => self ::MATERIAL_AMETHYST ,
106+ self ::MATERIAL_RESIN => self ::MATERIAL_RESIN ,
105107 ];
106108
107109 public const OBFUSCATED = TextFormat::ESCAPE . "k " ;
@@ -150,7 +152,7 @@ private static function preg_replace(string $pattern, string $replacement, strin
150152 * @return string[]
151153 */
152154 public static function tokenize (string $ string ) : array {
153- $ result = preg_split ("/( " . TextFormat::ESCAPE . "[0-9a-u ])/u " , $ string , -1 , PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
155+ $ result = preg_split ("/( " . TextFormat::ESCAPE . "[0-9a-v ])/u " , $ string , -1 , PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
154156 if ($ result === false ) throw self ::makePcreError ();
155157 return $ result ;
156158 }
@@ -164,7 +166,7 @@ public static function clean(string $string, bool $removeFormat = true) : string
164166 $ string = mb_scrub ($ string , 'UTF-8 ' );
165167 $ string = self ::preg_replace ("/[\x{E000}-\x{F8FF}]/u " , "" , $ string ); //remove unicode private-use-area characters (they might break the console)
166168 if ($ removeFormat ){
167- $ string = str_replace (TextFormat::ESCAPE , "" , self ::preg_replace ("/ " . TextFormat::ESCAPE . "[0-9a-u ]/u " , "" , $ string ));
169+ $ string = str_replace (TextFormat::ESCAPE , "" , self ::preg_replace ("/ " . TextFormat::ESCAPE . "[0-9a-v ]/u " , "" , $ string ));
168170 }
169171 return str_replace ("\x1b" , "" , self ::preg_replace ("/ \x1b[ \\( \\][[0-9; \\[ \\(]+[Bm]/u " , "" , $ string ));
170172 }
@@ -175,7 +177,7 @@ public static function clean(string $string, bool $removeFormat = true) : string
175177 * @param string $placeholder default "&"
176178 */
177179 public static function colorize (string $ string , string $ placeholder = "& " ) : string {
178- return self ::preg_replace ('/ ' . preg_quote ($ placeholder , "/ " ) . '([0-9a-u ])/u ' , TextFormat::ESCAPE . '$1 ' , $ string );
180+ return self ::preg_replace ('/ ' . preg_quote ($ placeholder , "/ " ) . '([0-9a-v ])/u ' , TextFormat::ESCAPE . '$1 ' , $ string );
179181 }
180182
181183 /**
@@ -252,6 +254,7 @@ public static function toHTML(string $string) : string{
252254 TextFormat::MATERIAL_DIAMOND => "color:#2cb9a8 " ,
253255 TextFormat::MATERIAL_LAPIS => "color:#20487a " ,
254256 TextFormat::MATERIAL_AMETHYST => "color:#9a5cc5 " ,
257+ TextFormat::MATERIAL_RESIN => "color:#fc7812 " ,
255258 TextFormat::BOLD => "font-weight:bold " ,
256259 TextFormat::ITALIC => "font-style:italic " ,
257260 default => null
0 commit comments