1.21.8 data
Some checks failed
CodeQL / Analyze (go) (push) Has been cancelled
Go / Test (1.22) (push) Has been cancelled
Go / Test (^1.22) (push) Has been cancelled

This commit is contained in:
2025-08-22 06:17:33 +08:00
parent 133e3fab4a
commit 0958972953
173 changed files with 13782 additions and 406 deletions

23
bot/basic/ping.go Normal file
View File

@ -0,0 +1,23 @@
package basic
import (
"github.com/Tnze/go-mc/data/packetid"
pk "github.com/Tnze/go-mc/net/packet"
)
func (p *Player) handlePingPacket(packet pk.Packet) error {
var pingID pk.Int
if err := packet.Scan(&pingID); err != nil {
return Error{err}
}
// Response
err := p.c.Conn.WritePacket(pk.Packet{
ID: int32(packetid.ServerboundPong),
Data: packet.Data,
})
if err != nil {
return Error{err}
}
return nil
}