#3107: Fix action bar messages in 1.17

This commit is contained in:
Antoine L 2021-06-09 18:57:53 +10:00 committed by md_5
parent 6cda6b6c10
commit 633ff1cfc8
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -478,7 +478,7 @@ public final class UserConnection implements ProxiedPlayer
// transform score components
message = ChatComponentTransformer.getInstance().transform( this, true, message );
if ( position == ChatMessageType.ACTION_BAR )
if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() < ProtocolConstants.MINECRAFT_1_17 )
{
// Versions older than 1.11 cannot send the Action bar with the new JSON formattings
// Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145