1.21.6 Clientbound PlayState Packets

This commit is contained in:
2025-06-20 04:22:08 +08:00
parent e40ed2e534
commit 195d34f32d
204 changed files with 10118 additions and 3287 deletions

View File

@ -10,13 +10,14 @@ type Component interface {
}
type ComponentID int32
type componentCreator func() Component
var components = make(map[ComponentID]Component)
var components = make(map[ComponentID]componentCreator)
func ComponentFromID(id ComponentID) Component {
return components[id]
return components[id]()
}
func RegisterComponent(c Component) {
components[c.Type()] = c
func RegisterComponent(c componentCreator) {
components[c().Type()] = c
}