fix item displays name on example/daze

This commit is contained in:
Tnze
2024-07-28 16:21:24 +08:00
parent cbd9bb96de
commit 330d7e6c3e
5 changed files with 31 additions and 11 deletions

View File

@ -0,0 +1,17 @@
package bootstrap
import (
"github.com/Tnze/go-mc/data/registryid"
"github.com/Tnze/go-mc/level/block"
"github.com/Tnze/go-mc/registry"
)
func RegisterBlocks(reg *registry.Registry[block.Block]) {
reg.Clear()
for i, key := range registryid.Block {
id, val := reg.Put(key, block.FromID[key])
if int32(i) != id || val == nil || *val == nil {
panic("register blocks failed")
}
}
}