Start implementing boilerplate for manipulating inventory

This commit is contained in:
Tom
2020-09-26 18:05:40 -07:00
parent 1a269d9b63
commit 670799df8d
4 changed files with 39 additions and 2 deletions

View File

@ -9,7 +9,9 @@ import (
"github.com/Tnze/go-mc/bot/world"
"github.com/Tnze/go-mc/bot/world/entity"
"github.com/Tnze/go-mc/bot/world/entity/player"
"github.com/Tnze/go-mc/data"
"github.com/Tnze/go-mc/net"
"github.com/Tnze/go-mc/net/packet"
pk "github.com/Tnze/go-mc/net/packet"
)
@ -47,6 +49,10 @@ func (c *Client) Close() error {
return err
}
func (c *Client) SendCloseWindow(windowID byte) error {
return c.conn.WritePacket(packet.Marshal(data.CloseWindowServerbound, pk.UnsignedByte(windowID)))
}
// NewClient init and return a new Client.
//
// A new Client has default name "Steve" and zero UUID.