We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 08e3071 commit 5f76e41Copy full SHA for 5f76e41
nbtlib/tag.py
@@ -361,15 +361,21 @@ def match(self, other):
361
return False
362
return self == other
363
364
- def snbt(self):
+ def snbt(self, indent=None, compact=False, quote=None):
365
"""Return the snbt literal corresponding to the tag instance.
366
367
.. doctest::
368
369
>>> Compound({"foo": Long(123)}).snbt()
370
'{foo: 123L}'
371
+ >>> Compound({"foo": Long(123)}).snbt(compact=True)
372
+ '{foo:123L}'
373
+ >>> print(Compound({"foo": Long(123)}).snbt(indent=4))
374
+ {
375
+ foo: 123L
376
+ }
377
"""
- return serialize_tag(self)
378
+ return serialize_tag(self, indent=indent, compact=compact, quote=quote)
379
380
def unpack(self, json=False):
381
"""Return the unpacked nbt value as an instance of the associated base type.
0 commit comments