
SNBT format breaks strings
tryashtar opened this issue ยท 2 comments
Hello, thanks for the great mod!
I noticed that when I click the "format text" button in the SNBT view, strings with spaces in them get changed to not have spaces anymore. And strings that contain characters like {
get formatted, inserting whitespace and newlines. And this even persists after saving, which can break stuff.
How to reproduce
I guess this is the code that handles formatting? I think vanilla has a builtin SNBT formatter that's a bit more robust (looks like yarn calls it net.minecraft.nbt.visitor.NbtTextFormatter
), that might help make things a bit easier, if you don't mind the roundabout process of parsing to NBT and back.
Thank you for the report. I don't even know why I didn't think that it was going to break spaces in strings.
Thanks for telling me about the vanilla formatter btw, I didn't know it existed. I'll see if I can use it instead.