update 1.19.2 server
This commit is contained in:
@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
// WorldInfo content player info in server.
|
// WorldInfo content player info in server.
|
||||||
type WorldInfo struct {
|
type WorldInfo struct {
|
||||||
DimensionCodec DimensionCodec
|
RegistryCodec RegistryCodec
|
||||||
DimensionType string
|
DimensionType string
|
||||||
DimensionNames []string // Identifiers for all worlds on the server.
|
DimensionNames []string // Identifiers for all worlds on the server.
|
||||||
DimensionName string // Name of the world being spawned into.
|
DimensionName string // Name of the world being spawned into.
|
||||||
@ -46,7 +46,7 @@ type Dimension struct {
|
|||||||
MonsterSpawnBlockLightLimit int32 `nbt:"monster_spawn_block_light_limit"`
|
MonsterSpawnBlockLightLimit int32 `nbt:"monster_spawn_block_light_limit"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DimensionCodec struct {
|
type RegistryCodec struct {
|
||||||
// What is Below? (wiki.vg)
|
// What is Below? (wiki.vg)
|
||||||
ChatType Registry[nbt.RawMessage] `nbt:"minecraft:chat_type"`
|
ChatType Registry[nbt.RawMessage] `nbt:"minecraft:chat_type"`
|
||||||
DimensionType Registry[Dimension] `nbt:"minecraft:dimension_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.UnsignedByte)(&p.Gamemode),
|
||||||
(*pk.Byte)(&p.PrevGamemode),
|
(*pk.Byte)(&p.PrevGamemode),
|
||||||
pk.Array((*[]pk.Identifier)(unsafe.Pointer(&p.DimensionNames))),
|
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.WorldInfo.DimensionType),
|
||||||
(*pk.Identifier)(&p.DimensionName),
|
(*pk.Identifier)(&p.DimensionName),
|
||||||
(*pk.Long)(&p.HashedSeed),
|
(*pk.Long)(&p.HashedSeed),
|
||||||
|
@ -39,7 +39,7 @@ func (w *World) onPlayerSpawn(pk.Packet) error {
|
|||||||
|
|
||||||
func (w *World) handleLevelChunkWithLightPacket(packet pk.Packet) error {
|
func (w *World) handleLevelChunkWithLightPacket(packet pk.Packet) error {
|
||||||
var pos level.ChunkPos
|
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)
|
chunk := level.EmptyChunk(int(currentDimType.Height) / 16)
|
||||||
if err := packet.Scan(&pos, chunk); err != nil {
|
if err := packet.Scan(&pos, chunk); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -34,8 +34,8 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
)
|
)
|
||||||
|
|
||||||
const ProtocolName = "1.19"
|
const ProtocolName = "1.19.2"
|
||||||
const ProtocolVersion = 759
|
const ProtocolVersion = 760
|
||||||
|
|
||||||
type Server struct {
|
type Server struct {
|
||||||
*log.Logger
|
*log.Logger
|
||||||
|
Reference in New Issue
Block a user