diff --git a/bot/basic/info.go b/bot/basic/info.go index 81fc4ac..fc870b2 100644 --- a/bot/basic/info.go +++ b/bot/basic/info.go @@ -10,7 +10,7 @@ import ( // WorldInfo content player info in server. type WorldInfo struct { - DimensionCodec DimensionCodec + RegistryCodec RegistryCodec DimensionType string DimensionNames []string // Identifiers for all worlds on the server. DimensionName string // Name of the world being spawned into. @@ -46,7 +46,7 @@ type Dimension struct { MonsterSpawnBlockLightLimit int32 `nbt:"monster_spawn_block_light_limit"` } -type DimensionCodec struct { +type RegistryCodec struct { // What is Below? (wiki.vg) ChatType Registry[nbt.RawMessage] `nbt:"minecraft:chat_type"` DimensionType Registry[Dimension] `nbt:"minecraft:dimension_type"` @@ -90,7 +90,7 @@ func (p *Player) handleLoginPacket(packet pk.Packet) error { (*pk.UnsignedByte)(&p.Gamemode), (*pk.Byte)(&p.PrevGamemode), pk.Array((*[]pk.Identifier)(unsafe.Pointer(&p.DimensionNames))), - pk.NBT(&p.WorldInfo.DimensionCodec), + pk.NBT(&p.WorldInfo.RegistryCodec), (*pk.Identifier)(&p.WorldInfo.DimensionType), (*pk.Identifier)(&p.DimensionName), (*pk.Long)(&p.HashedSeed), diff --git a/bot/world/chunks.go b/bot/world/chunks.go index 688a08d..6baaab5 100644 --- a/bot/world/chunks.go +++ b/bot/world/chunks.go @@ -39,7 +39,7 @@ func (w *World) onPlayerSpawn(pk.Packet) error { func (w *World) handleLevelChunkWithLightPacket(packet pk.Packet) error { var pos level.ChunkPos - currentDimType := w.p.WorldInfo.DimensionCodec.DimensionType.Find(w.p.DimensionType) + currentDimType := w.p.WorldInfo.RegistryCodec.DimensionType.Find(w.p.DimensionType) chunk := level.EmptyChunk(int(currentDimType.Height) / 16) if err := packet.Scan(&pos, chunk); err != nil { return err diff --git a/server/server.go b/server/server.go index ac07e23..3836caf 100644 --- a/server/server.go +++ b/server/server.go @@ -34,8 +34,8 @@ import ( "log" ) -const ProtocolName = "1.19" -const ProtocolVersion = 759 +const ProtocolName = "1.19.2" +const ProtocolVersion = 760 type Server struct { *log.Logger