Fix other code for compatible with new go-mc/net packet

This commit is contained in:
Tnze
2021-02-25 20:22:06 +08:00
parent 27a30efe7b
commit f8b3501b60
16 changed files with 461 additions and 478 deletions

View File

@ -85,8 +85,7 @@ func (c *Conn) ReadPacket(p *pk.Packet) error {
//WritePacket write a Packet to Conn.
func (c *Conn) WritePacket(p pk.Packet) error {
_, err := c.Write(p.Pack(c.threshold))
return err
return p.Pack(c, c.threshold)
}
// SetCipher load the decode/encode stream to this Conn