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 e81a0cc410..272d217e77 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 static ChatColor getByChar(char code) 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) diff --git a/chat/src/main/java/net/md_5/bungee/chat/BaseComponentSerializer.java b/chat/src/main/java/net/md_5/bungee/chat/BaseComponentSerializer.java index efffa90541..ae69b231bf 100644 --- a/chat/src/main/java/net/md_5/bungee/chat/BaseComponentSerializer.java +++ b/chat/src/main/java/net/md_5/bungee/chat/BaseComponentSerializer.java @@ -65,7 +65,7 @@ protected void deserialize(JsonObject object, BaseComponent component, JsonDeser JsonObject event = object.getAsJsonObject( "clickEvent" ); component.setClickEvent( new ClickEvent( ClickEvent.Action.valueOf( event.get( "action" ).getAsString().toUpperCase( Locale.ROOT ) ), - event.get( "value" ).getAsString() ) ); + ( event.has( "value" ) ) ? event.get( "value" ).getAsString() : "" ) ); } if ( object.has( "hoverEvent" ) ) { diff --git a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java index 630a55b89e..ff58734c1b 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -382,6 +382,25 @@ public void handle(PluginMessage pluginMessage) throws Exception out.writeInt( 0 ); } } + if ( subChannel.equals( "IPOther" ) ) + { + ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); + if ( player != null ) + { + out.writeUTF( "IPOther" ); + out.writeUTF( player.getName() ); + if ( player.getSocketAddress() instanceof InetSocketAddress ) + { + InetSocketAddress address = (InetSocketAddress) player.getSocketAddress(); + out.writeUTF( address.getHostString() ); + out.writeInt( address.getPort() ); + } else + { + out.writeUTF( "unix://" + ( (DomainSocketAddress) player.getSocketAddress() ).path() ); + out.writeInt( 0 ); + } + } + } if ( subChannel.equals( "PlayerCount" ) ) { String target = in.readUTF();