Mojang / DataFixerUpper

A set of utilities designed for incremental building, merging and optimization of data transformations.
MIT License
1.2k stars 138 forks source link

Split between Type and Codec #46

Closed RainWarrior closed 4 years ago

RainWarrior commented 4 years ago
boq commented 4 years ago

Also, not sure if using my expectations are correct, but Codec.EMPTY.codec().encode(Unit.INSTANCE, JsonOps.INSTANCE, JsonOps.INSTANCE.empty()); != JsonOps.INSTANCE.empty() (returns empty map instead of JsonNull)

RainWarrior commented 4 years ago

That's expected since EMPTY is a MapCodec (returns a map); on decoding JsonOps.INSTANCE.empty() will get expanded to empty map too iirc since the typing is not that strict