#2931: Fix exceptions on ChatColor.of(Color) due to truncation

This commit is contained in:
WinX64 2020-08-22 17:47:01 +10:00 committed by md_5
parent aa22fe68e5
commit 64e4f4658a
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -72,7 +72,7 @@ public final class ChatColor
/** /**
* Represents blue. * Represents blue.
*/ */
public static final ChatColor BLUE = new ChatColor( '9', "blue", new Color( 0x05555FF ) ); public static final ChatColor BLUE = new ChatColor( '9', "blue", new Color( 0x5555FF ) );
/** /**
* Represents green. * Represents green.
*/ */
@ -238,7 +238,7 @@ public final class ChatColor
public static ChatColor of(Color color) public static ChatColor of(Color color)
{ {
return of( "#" + Integer.toHexString( color.getRGB() ).substring( 2 ) ); return of( "#" + String.format( "%08x", color.getRGB() ).substring( 2 ) );
} }
public static ChatColor of(String string) public static ChatColor of(String string)