Skip to content

v0.3.0

Choose a tag to compare

@m-stilling m-stilling released this 13 Jun 22:00
· 44 commits to main since this release

What's Changed

This release focuses on parser correctness, fixing several string and number edge cases, and broadens SNBT compatibility, alongside stricter internal typing.

Fixes

  • Strings: spaces inside quoted strings are no longer stripped
  • Strings: values are now escaped via json_encode, fixing malformed output for strings containing quotes, backslashes, tabs, or newlines
  • Strings: correctly terminate strings ending in an escaped backslash (e.g. "C:\\")
  • Arrays: empty typed arrays ([I;], [B;], [L;]) now parse to [] instead of [0]
  • Numbers: full float/double precision is preserved instead of being rounded to 14 significant digits (e.g. 0.10000000149011612d)

Features

  • Allow dots, dashes, and plus signs in unquoted compound keys
  • Tolerate tabs and newlines between tokens, so pretty-printed SNBT parses
  • Malformed input now throws a dedicated SNBTParseException (implements SNBTException, extends RuntimeException) instead of a bare Exception (still catchable as \Exception)

Tooling

  • Static analysis with PHPStan at level 8 across src and tests, enforced in CI
  • Development-only files are trimmed from the distributed package via .gitattributes

Full Changelog: v0.2.0...v0.3.0