Apotheosis

Apotheosis

90M Downloads

Empty NBT entries causing issues with SNBT serialization

manugame opened this issue ยท 5 comments

commented

apotheosis add empty nbt entries to items

Image

this is causing issue when trying to serialize item to snbt :

Image

commented

What issues does this produce with SNBT? This is legal syntax to add an empty argument to a translatable component.

commented

Oh the second image is the SNBT. This seems like an issue with SNBT? I guess I can use a different marker?

I don't know why NBT->SNBT is converting the empty string "" into {"": ""}, though. I don't think that's going to be any different with another kind of marker string.

commented

Yeah, no, using CommonComponents.space will also serialize it to "". This is an issue with whatever conversion logic you're using, I think (even if it's Mojang's built-in conversion logic).

commented

Yeah, no, using CommonComponents.space will also serialize it to "". This is an issue with whatever conversion logic you're using, I think (even if it's Mojang's built-in conversion logic).

We are using mojang's TagParser class because we need to transfer NBT over json

commented

If you need to transfer NBT over json you should use NbtOps and JsonOps to convert between the two datatypes (CompoundTag and JsonObject)