Handle ping in bot/basic

This commit is contained in:
SushiLeader
2024-04-25 19:15:41 +08:00
parent 2445ff3f71
commit 032acf0d21
2 changed files with 24 additions and 0 deletions

View File

@ -40,6 +40,7 @@ func NewPlayer(c *bot.Client, settings Settings, events EventsListener) *Player
bot.PacketHandler{Priority: 0, ID: packetid.ClientboundLogin, F: p.handleLoginPacket},
bot.PacketHandler{Priority: 0, ID: packetid.ClientboundKeepAlive, F: p.handleKeepAlivePacket},
bot.PacketHandler{Priority: 0, ID: packetid.ClientboundRespawn, F: p.handleRespawnPacket},
bot.PacketHandler{Priority: 0, ID: packetid.ClientboundPing, F: p.handlePingPacket},
)
events.attach(p)
return p