更新了几个API

This commit is contained in:
Tnze
2019-06-08 11:07:00 +08:00
parent 722c21bff9
commit d53f77dbae
2 changed files with 138 additions and 12 deletions

View File

@ -358,9 +358,8 @@ func handleJoinGamePacket(c *Client, p pk.Packet) error {
type pluginMessageData []byte
//Encode a PluginMessageData
func (p *pluginMessageData) Encode(r io.Writer) error {
_, err := r.Write([]byte(*p))
return err
func (p pluginMessageData) Encode() []byte {
return []byte(p)
}
//Decode a PluginMessageData
@ -491,8 +490,6 @@ func (b *blockEntities) Decode(r pk.DecodeReader) error {
return nil
}
// var isSpawn bool
func handlePlayerPositionAndLookPacket(c *Client, p pk.Packet) error {
var (
x, y, z pk.Double