pk.Ary and pk.Array using generic now

This commit is contained in:
Tnze
2022-03-20 01:17:25 +08:00
parent 7997a5faea
commit 4c2510565d
15 changed files with 95 additions and 155 deletions

View File

@ -109,7 +109,6 @@ func ExamplePacket_Scan_joinGame() {
Hardcore pk.Boolean
Gamemode pk.UnsignedByte
PreGamemode pk.Byte
WorldCount pk.VarInt
WorldNames = make([]pk.Identifier, 0) // This cannot replace with "var WorldNames []pk.Identifier" because "nil" has no type information
DimensionCodec struct {
DimensionType interface{} `nbt:"minecraft:dimension_type"`
@ -127,9 +126,7 @@ func ExamplePacket_Scan_joinGame() {
&Hardcore,
&Gamemode,
&PreGamemode,
&WorldCount,
pk.Ary{
Len: &WorldCount,
pk.Ary[pk.VarInt, *pk.VarInt]{
Ary: &WorldNames,
},
pk.NBT(&DimensionCodec),