Refactoring package go-mc/bot
This commit is contained in:
18
bot/basic/keepalive.go
Normal file
18
bot/basic/keepalive.go
Normal file
@ -0,0 +1,18 @@
|
||||
package basic
|
||||
|
||||
import (
|
||||
"github.com/Tnze/go-mc/data/packetid"
|
||||
pk "github.com/Tnze/go-mc/net/packet"
|
||||
)
|
||||
|
||||
func (p Player) handleKeepAlivePacket(packet pk.Packet) error {
|
||||
var KeepAliveID pk.Long
|
||||
if err := packet.Scan(&KeepAliveID); err != nil {
|
||||
return err
|
||||
}
|
||||
// Response
|
||||
return p.c.Conn.WritePacket(pk.Marshal(
|
||||
packetid.KeepAliveServerbound,
|
||||
KeepAliveID,
|
||||
))
|
||||
}
|
Reference in New Issue
Block a user