Add registry implement

This commit is contained in:
Tnze
2024-07-27 22:48:40 +08:00
parent 300304eed3
commit d88ee401fd
7 changed files with 118 additions and 99 deletions

View File

@ -41,7 +41,7 @@ func (w *World) onPlayerSpawn(pk.Packet) error {
func (w *World) handleLevelChunkWithLightPacket(packet pk.Packet) error {
var pos level.ChunkPos
currentDimType := w.c.Registries.DimensionType.FindByID(w.p.DimensionType)
currentDimType := w.c.Registries.DimensionType.GetByID(w.p.DimensionType)
if currentDimType == nil {
return fmt.Errorf("dimension type %d not found", w.p.DimensionType)
}