support multi handler for same packetID and handler priority.

This commit is contained in:
Tnze
2023-01-06 20:01:05 +08:00
parent 36bec6e63d
commit 4e23ad63a2
3 changed files with 29 additions and 40 deletions

View File

@ -1,10 +1,11 @@
package bot
import (
"github.com/google/uuid"
"github.com/Tnze/go-mc/data/packetid"
"github.com/Tnze/go-mc/net"
"github.com/Tnze/go-mc/yggdrasil/user"
"github.com/google/uuid"
)
// Client is used to access Minecraft server
@ -34,7 +35,7 @@ func (c *Client) Close() error {
func NewClient() *Client {
return &Client{
Auth: Auth{Name: "Steve"},
Events: Events{handlers: make(map[packetid.ClientboundPacketID]*handlerHeap)},
Events: Events{handlers: make([][]PacketHandler, packetid.ClientboundPacketIDGuard)},
}
}