33import lombok .AllArgsConstructor ;
44import lombok .Getter ;
55import net .minecraft .ChatFormatting ;
6- import net .minecraft .network .chat .Component ;
7- import org .jetbrains .annotations .NotNull ;
86
9- import java .util . Optional ;
7+ import java .awt . Color ;
108
11- import static java .util .Arrays .stream ;
129import static net .minecraft .ChatFormatting .BLUE ;
1310import static net .minecraft .ChatFormatting .DARK_AQUA ;
1411import static net .minecraft .ChatFormatting .DARK_BLUE ;
15- import static net .minecraft .ChatFormatting .DARK_GRAY ;
1612import static net .minecraft .ChatFormatting .DARK_PURPLE ;
1713import static net .minecraft .ChatFormatting .DARK_RED ;
1814import static net .minecraft .ChatFormatting .GOLD ;
1915import static net .minecraft .ChatFormatting .GRAY ;
2016import static net .minecraft .ChatFormatting .GREEN ;
2117import static net .minecraft .ChatFormatting .LIGHT_PURPLE ;
2218import static net .minecraft .ChatFormatting .RED ;
19+ import static net .minecraft .ChatFormatting .WHITE ;
2320import static net .minecraft .ChatFormatting .YELLOW ;
24- import static net .minecraft .network .chat .Component .empty ;
25- import static net .minecraft .network .chat .Component .literal ;
2621
2722@ Getter
2823@ AllArgsConstructor
2924public enum Faction {
3025
31- NULL ("" , "" , false , GRAY , "" ),
26+ NULL ("" , "" , false , WHITE , "" ),
3227 FBI ("FBI" , "fbi" , false , DARK_BLUE , "✯" ),
3328 POLIZEI ("Polizei" , "police" , false , BLUE , "✯" ),
3429 RETTUNGSDIENST ("Rettungsdienst" , "medic" , false , DARK_RED , "✚" ),
@@ -49,18 +44,7 @@ public enum Faction {
4944 private final ChatFormatting color ;
5045 private final String icon ;
5146
52- public Component getNameTagSuffix () {
53- return this != NULL
54- ? empty ()
55- .append (literal ("⌜" ).withStyle (DARK_GRAY ))
56- .append (literal (this .icon ).withStyle (this .color ))
57- .append (literal ("⌟" ).withStyle (DARK_GRAY ))
58- : empty ();
59- }
60-
61- public static @ NotNull Optional <Faction > fromDisplayName (String displayName ) {
62- return stream (values ())
63- .filter (faction -> faction .getDisplayName ().equals (displayName ))
64- .findFirst ();
47+ public Color getAwtColor () {
48+ return this .color .getColor () != null ? new Color (this .color .getColor ()) : Color .WHITE ;
6549 }
6650}
0 commit comments