This commit is contained in:
Tnze
2022-12-11 21:58:51 +08:00
parent 55d12fc76f
commit 06260e2b00
2 changed files with 2 additions and 2 deletions

View File

@ -173,7 +173,7 @@ func (p *Packet) unpackWithoutCompression(r io.Reader) error {
lengthOfData := int(Length) - int(n) lengthOfData := int(Length) - int(n)
if lengthOfData < 0 || lengthOfData > MaxDataLength { if lengthOfData < 0 || lengthOfData > MaxDataLength {
return fmt.Errorf("uncompressed packet error: lenght is %d", lengthOfData) return fmt.Errorf("uncompressed packet error: length is %d", lengthOfData)
} }
if cap(p.Data) < lengthOfData { if cap(p.Data) < lengthOfData {
p.Data = make([]byte, lengthOfData) p.Data = make([]byte, lengthOfData)

View File

@ -111,7 +111,7 @@ func ExamplePacket_Scan_joinGame() {
Hardcore pk.Boolean Hardcore pk.Boolean
Gamemode pk.UnsignedByte Gamemode pk.UnsignedByte
PreGamemode pk.Byte PreGamemode pk.Byte
WorldNames = make([]pk.Identifier, 0) // This cannot replace with "var DimensionNames []pk.Identifier" because "nil" has no type information WorldNames = []pk.Identifier{} // This cannot replace with "var DimensionNames []pk.Identifier" because "nil" has no type information
DimensionCodec struct { DimensionCodec struct {
DimensionType interface{} `nbt:"minecraft:dimension_type"` DimensionType interface{} `nbt:"minecraft:dimension_type"`
WorldgenBiome interface{} `nbt:"minecraft:worldgen/biome"` WorldgenBiome interface{} `nbt:"minecraft:worldgen/biome"`