add player package with key client-side player functionality, update protocol codecs, and refactor metadata definitions and slot usage

This commit is contained in:
2025-08-23 16:19:45 +08:00
parent cff9d4a809
commit 4528bdc86a
32 changed files with 2613 additions and 468 deletions

25
pkg/bot/player.go Normal file
View File

@ -0,0 +1,25 @@
package bot
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol"
"github.com/go-gl/mathgl/mgl64"
)
type Player interface {
StateID() int32
UpdateStateID(id int32)
Entity() Entity
FlyTo(pos mgl64.Vec3) error
WalkTo(pos mgl64.Vec3) error
LookAt(vec3 mgl64.Vec3) error
BreakBlock(pos protocol.Position) error
PlaceBlock(pos protocol.Position) error
PlaceBlockWithArgs(pos protocol.Position, face int32, cursor mgl64.Vec3) error
OpenContainer(pos protocol.Position) (Container, error)
UseItem(hand int8) error
OpenMenu(command string) (Container, error)
}