Initialize Commit

This commit is contained in:
2025-06-19 15:01:07 +08:00
commit e40ed2e534
164 changed files with 19741 additions and 0 deletions

22
codec/slot/component.go Normal file
View File

@ -0,0 +1,22 @@
package slot
import pk "github.com/Tnze/go-mc/net/packet"
type Component interface {
Type() ComponentID
ID() string
pk.Field
}
type ComponentID int32
var components = make(map[ComponentID]Component)
func ComponentFromID(id ComponentID) Component {
return components[id]
}
func RegisterComponent(c Component) {
components[c.Type()] = c
}