#2154: Always send action bar differently to account for colours

This commit is contained in:
md_5 2017-06-08 19:02:37 +10:00
parent a6483db3df
commit eab710b0aa

View File

@ -420,8 +420,8 @@ public final class UserConnection implements ProxiedPlayer
@Override @Override
public void sendMessage(ChatMessageType position, BaseComponent... message) public void sendMessage(ChatMessageType position, BaseComponent... message)
{ {
// Action bar on 1.8 doesn't display the new JSON formattings, legacy works - send it using this for now // Action bar 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 ) if ( position == ChatMessageType.ACTION_BAR )
{ {
sendMessage( position, ComponentSerializer.toString( new TextComponent( BaseComponent.toLegacyText( message ) ) ) ); sendMessage( position, ComponentSerializer.toString( new TextComponent( BaseComponent.toLegacyText( message ) ) ) );
} else } else
@ -433,8 +433,8 @@ public final class UserConnection implements ProxiedPlayer
@Override @Override
public void sendMessage(ChatMessageType position, BaseComponent message) public void sendMessage(ChatMessageType position, BaseComponent message)
{ {
// Action bar on 1.8 doesn't display the new JSON formattings, legacy works - send it using this for now // Action bar 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 ) if ( position == ChatMessageType.ACTION_BAR )
{ {
sendMessage( position, ComponentSerializer.toString( new TextComponent( BaseComponent.toLegacyText( message ) ) ) ); sendMessage( position, ComponentSerializer.toString( new TextComponent( BaseComponent.toLegacyText( message ) ) ) );
} else } else