Add playerinfo recorder for chat message

This commit is contained in:
Tnze
2022-12-30 01:09:08 +08:00
parent 6fba193255
commit 77857a1a85
6 changed files with 206 additions and 39 deletions

View File

@ -13,6 +13,7 @@ import (
"github.com/Tnze/go-mc/bot"
"github.com/Tnze/go-mc/bot/basic"
"github.com/Tnze/go-mc/bot/msg"
"github.com/Tnze/go-mc/bot/playerlist"
"github.com/Tnze/go-mc/bot/screen"
"github.com/Tnze/go-mc/bot/world"
"github.com/Tnze/go-mc/chat"
@ -31,6 +32,7 @@ var (
var (
client *bot.Client
player *basic.Player
playerList *playerlist.PlayerList
chatHandler *msg.Manager
worldManager *world.World
screenManager *screen.Manager
@ -52,7 +54,8 @@ func main() {
HealthChange: onHealthChange,
Death: onDeath,
})
chatHandler = msg.New(client, player, msg.EventsHandler{
playerList = playerlist.New(client)
chatHandler = msg.New(client, player, playerList, msg.EventsHandler{
PlayerChatMessage: onPlayerMsg,
})
worldManager = world.NewWorld(client, player, world.EventsListener{