Archived
0

PlayerListHeaderAndFooterPacket

This commit is contained in:
2021-05-09 15:36:19 +03:00
parent 0d72a8a29c
commit 47ccc3252a
4 changed files with 69 additions and 2 deletions

View File

@@ -7,6 +7,8 @@ import mc.protocol.api.ConnectionContext;
import mc.protocol.model.Location;
import mc.protocol.model.Look;
import mc.protocol.model.ServerInfo;
import mc.protocol.model.text.Text;
import mc.protocol.model.text.TextColor;
import mc.protocol.packets.PingPacket;
import mc.protocol.packets.client.HandshakePacket;
import mc.protocol.packets.client.LoginStartPacket;
@@ -139,7 +141,20 @@ public class PacketHandler {
.hasDisplayName(false)
.build());
context.sendNow(playerListItemPacket);
context.send(playerListItemPacket);
var playerListHeaderAndFooterPacket = new PlayerListHeaderAndFooterPacket();
playerListHeaderAndFooterPacket.setHeader(Text.builder()
.append("") //TODO bug component
.append(Text.of(TextColor.GREEN, "==="))
.append(Text.of(TextColor.RED, " MC-PROJECT "))
.append(Text.of(TextColor.GREEN, "==="))
.build());
playerListHeaderAndFooterPacket.setFoother(Text.of(TextColor.GRAY, "develop by DmitriyMX"));
context.send(playerListHeaderAndFooterPacket);
context.flushSending();
}
private static String faviconToBase64(Path iconPath) {