Open Tnze opened 11 months ago
And what's the relationship of this package and @ironm00n/nbt-ts? Which one is actively maintaining and I should use?
The SNBT implementation is most likely flawed in many other ways as well. It is not maintained. I'll add a note/warning to my unmaintained libraries. Thanks for the notice.
I'm not affiliated with the other npm package in any way.
I remembered that I wrote a newer and more robust parser in this repository:
https://github.com/janispritzkau/deno-minecraft/blob/next/nbt/snbt.ts
I remembered that I wrote a newer and more robust parser in this repository:
https://github.com/janispritzkau/deno-minecraft/blob/next/nbt/snbt.ts
Actually, I'm developing the formatting function for my snbt vscode extension. By simply parse and re-stringify.
Seems like your new implementation doesn't have "pretty" output option, which will be good to have.
The vanilla implement use java's
Character.isWhitespace()
, which includes`,
\t,
\r,
\n` and so on.https://github.com/Mojang/brigadier/blob/b92c420b2a292dd5c20f6adfafff5e21b9835c6d/src/main/java/com/mojang/brigadier/StringReader.java#L95
But in this library, only
` and
\n` are accepted.https://github.com/janispritzkau/nbt-ts/blob/dd983053ac92e0baa688690d6100076cffda0857/src/snbt.ts#L87C66-L87C66
It cause errors when parsing such files.