From 64e4f4658a1652cca16b451b57c4a4eb35d4818d Mon Sep 17 00:00:00 2001 From: WinX64 Date: Sat, 22 Aug 2020 17:47:01 +1000 Subject: [PATCH] #2931: Fix exceptions on ChatColor.of(Color) due to truncation --- chat/src/main/java/net/md_5/bungee/api/ChatColor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chat/src/main/java/net/md_5/bungee/api/ChatColor.java b/chat/src/main/java/net/md_5/bungee/api/ChatColor.java index e81a0cc4..272d217e 100644 --- a/chat/src/main/java/net/md_5/bungee/api/ChatColor.java +++ b/chat/src/main/java/net/md_5/bungee/api/ChatColor.java @@ -72,7 +72,7 @@ public final class ChatColor /** * 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. */ @@ -238,7 +238,7 @@ public final class ChatColor 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)