Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #280 from SpigotMC/master
Browse files Browse the repository at this point in the history
Merge upstream
  • Loading branch information
John authored Aug 29, 2020
2 parents 871be35 + e93c762 commit 668e190
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
4 changes: 2 additions & 2 deletions chat/src/main/java/net/md_5/bungee/api/ChatColor.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" ) )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 668e190

Please sign in to comment.