Skip to content

Commit

Permalink
Send action bar messages using BaseComponent for 1.9 clients
Browse files Browse the repository at this point in the history
Action Bar packets in 1.9 now correctly support the JSON format, however sending them the 1.8 way will kick the client. This keeps the compatibility with 1.8 clients with the version check whilst correctly sending the packet to 1.9 clients.
clankstar authored and md-5 committed Mar 1, 2016
1 parent 7926230 commit b6671cd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions proxy/src/main/java/net/md_5/bungee/UserConnection.java
Original file line number Diff line number Diff line change
@@ -416,8 +416,8 @@ private void sendMessage(ChatMessageType position, String message)
@Override
public void sendMessage(ChatMessageType position, BaseComponent... message)
{
// Action bar doesn't display the new JSON formattings, legacy works - send it using this for now
if ( position == ChatMessageType.ACTION_BAR )
// Action bar on 1.8 doesn't display the new JSON formattings, legacy works - send it using this for now
if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() <= ProtocolConstants.MINECRAFT_1_8 )
{
sendMessage( position, ComponentSerializer.toString( new TextComponent( TextComponent.toLegacyText( message ) ) ) );
} else
@@ -429,8 +429,8 @@ public void sendMessage(ChatMessageType position, BaseComponent... message)
@Override
public void sendMessage(ChatMessageType position, BaseComponent message)
{
// Action bar doesn't display the new JSON formattings, legacy works - send it using this for now
if ( position == ChatMessageType.ACTION_BAR )
// Action bar on 1.8 doesn't display the new JSON formattings, legacy works - send it using this for now
if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() <= ProtocolConstants.MINECRAFT_1_8 )
{
sendMessage( position, ComponentSerializer.toString( new TextComponent( TextComponent.toLegacyText( message ) ) ) );
} else

0 comments on commit b6671cd

Please sign in to comment.