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>
|
<description>Minimal implementation of the Minecraft protocol for use in BungeeCord</description>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.md-5</groupId>
|
||||||
|
<artifactId>bungeecord-chat</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.netty</groupId>
|
<groupId>io.netty</groupId>
|
||||||
<artifactId>netty-codec</artifactId>
|
<artifactId>netty-codec</artifactId>
|
||||||
|
@ -9,6 +9,8 @@ import net.md_5.bungee.protocol.AbstractPacketHandler;
|
|||||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
|
import net.md_5.bungee.chat.ComponentSerializer;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@ -89,7 +91,7 @@ public class PlayerListItem extends DefinedPacket
|
|||||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_SNAPSHOT )
|
if ( protocolVersion < ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||||
{
|
{
|
||||||
Item item = items[0]; // Only one at a time
|
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.writeBoolean( action != Action.REMOVE_PLAYER );
|
||||||
buf.writeShort( item.ping );
|
buf.writeShort( item.ping );
|
||||||
} else
|
} else
|
||||||
|
@ -100,9 +100,11 @@ public class Global extends TabList
|
|||||||
{
|
{
|
||||||
PlayerListItem packet = new PlayerListItem();
|
PlayerListItem packet = new PlayerListItem();
|
||||||
packet.setAction( playerListItem.getAction() );
|
packet.setAction( playerListItem.getAction() );
|
||||||
PlayerListItem.Item[] it = new PlayerListItem.Item[ 1 ];
|
|
||||||
it[0] = item;
|
packet.setItems( new PlayerListItem.Item[]
|
||||||
packet.setItems( it );
|
{
|
||||||
|
item
|
||||||
|
} );
|
||||||
player.unsafe().sendPacket( packet );
|
player.unsafe().sendPacket( packet );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -82,9 +82,11 @@ public class ServerUnique extends TabList
|
|||||||
{
|
{
|
||||||
PlayerListItem p2 = new PlayerListItem();
|
PlayerListItem p2 = new PlayerListItem();
|
||||||
p2.setAction( packet.getAction() );
|
p2.setAction( packet.getAction() );
|
||||||
PlayerListItem.Item[] it = new PlayerListItem.Item[ 1 ];
|
|
||||||
it[0] = item;
|
p2.setItems( new PlayerListItem.Item[]
|
||||||
p2.setItems( it );
|
{
|
||||||
|
item
|
||||||
|
} );
|
||||||
player.unsafe().sendPacket( p2 );
|
player.unsafe().sendPacket( p2 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user