Disconnect method, SendPacket and ReceivePacket.

This commit is contained in:
Tnze
2019-08-16 12:46:09 +08:00
parent 78a50b7160
commit 0c48980309
5 changed files with 34 additions and 15 deletions

View File

@ -3,6 +3,8 @@ package bot
import (
"github.com/Tnze/go-mc/bot/world/entity"
"github.com/Tnze/go-mc/chat"
pk "github.com/Tnze/go-mc/net/packet"
)
type eventBroker struct {
@ -15,6 +17,10 @@ type eventBroker struct {
PluginMessage func(channel string, data []byte) error
HeldItemChange func(slot int) error
WindowsItem func(id byte, slots []entity.Slot) error
WindowsItemChange func(id byte, slotID int, slot entity.Slot)error
WindowsItem func(id byte, slots []entity.Slot) error
WindowsItemChange func(id byte, slotID int, slot entity.Slot) error
// ReceivePacket will be called when new packet arrive.
// Default handler will run only if pass == false.
ReceivePacket func(p pk.Packet) (pass bool, err error)
}