mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-17 22:28:15 +01:00
Fix tab list
This commit is contained in:
parent
faa284c8fc
commit
f15eed338d
@ -19,6 +19,12 @@
|
||||
<description>Minimal implementation of the Minecraft protocol for use in BungeeCord</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>bungeecord-chat</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-codec</artifactId>
|
||||
|
@ -9,6 +9,8 @@ import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||
|
||||
import java.util.UUID;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.chat.ComponentSerializer;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@ -89,7 +91,7 @@ public class PlayerListItem extends DefinedPacket
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
{
|
||||
Item item = items[0]; // Only one at a time
|
||||
writeString( item.displayName, buf );
|
||||
writeString( TextComponent.toLegacyText( ComponentSerializer.parse( item.displayName ) ), buf );
|
||||
buf.writeBoolean( action != Action.REMOVE_PLAYER );
|
||||
buf.writeShort( item.ping );
|
||||
} else
|
||||
|
@ -100,9 +100,11 @@ public class Global extends TabList
|
||||
{
|
||||
PlayerListItem packet = new PlayerListItem();
|
||||
packet.setAction( playerListItem.getAction() );
|
||||
PlayerListItem.Item[] it = new PlayerListItem.Item[ 1 ];
|
||||
it[0] = item;
|
||||
packet.setItems( it );
|
||||
|
||||
packet.setItems( new PlayerListItem.Item[]
|
||||
{
|
||||
item
|
||||
} );
|
||||
player.unsafe().sendPacket( packet );
|
||||
}
|
||||
}
|
||||
|
@ -82,9 +82,11 @@ public class ServerUnique extends TabList
|
||||
{
|
||||
PlayerListItem p2 = new PlayerListItem();
|
||||
p2.setAction( packet.getAction() );
|
||||
PlayerListItem.Item[] it = new PlayerListItem.Item[ 1 ];
|
||||
it[0] = item;
|
||||
p2.setItems( it );
|
||||
|
||||
p2.setItems( new PlayerListItem.Item[]
|
||||
{
|
||||
item
|
||||
} );
|
||||
player.unsafe().sendPacket( p2 );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user