twoolie / NBT

Python Parser/Writer for the NBT file format, and it's container the RegionFile.
MIT License
361 stars 74 forks source link

Use of TAG_Int_Array unclear/undocumented #173

Closed GrJo closed 10 months ago

GrJo commented 11 months ago

How do i create a TAG_Int_Array with three integers? I have tried these versions, but all fail

offset_array = TAG_Int_Array("Offset")
offset_array.append(TAG_Int(42))

offset_array = TAG_Int_Array("Offset", [42,33,11])
offset_array = TAG_Int_Array("Offset", np.array([42,33,11]))
twoolie commented 10 months ago

Yeah sorry, this could be better constructed/documented. The following code should work.

offset_array = TAG_Int_Array("Offset")
offset_array.value = [42, 33, 11]
GrJo commented 10 months ago

thanks :)