Skip to content

Commit 5f76e41

Browse files
committed
fix: forward snbt arguments
1 parent 08e3071 commit 5f76e41

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

nbtlib/tag.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -361,15 +361,21 @@ def match(self, other):
361361
return False
362362
return self == other
363363

364-
def snbt(self):
364+
def snbt(self, indent=None, compact=False, quote=None):
365365
"""Return the snbt literal corresponding to the tag instance.
366366
367367
.. doctest::
368368
369369
>>> Compound({"foo": Long(123)}).snbt()
370370
'{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+
}
371377
"""
372-
return serialize_tag(self)
378+
return serialize_tag(self, indent=indent, compact=compact, quote=quote)
373379

374380
def unpack(self, json=False):
375381
"""Return the unpacked nbt value as an instance of the associated base type.

0 commit comments

Comments
 (0)