mapping-io
mapping-io copied to clipboard
Add JsonWriter
This PR adds support for writing mappings as JSON files.
i hope there's a spec on the json format.
There isn't one but I can write one. Where should I put it?
In the meantime here is an example of the format:
{
"type": "mapping",
"version": 1,
"namespaces": ["source", "dest1", "dest2"],
"meta": {
"key": "value"
},
"classes": [
{
"name": ["sourceName", "dest1name", "dest2name"],
"fields": [
{
"name": ["sourceName", "dest1name", "dest2name"],
"desc": "desc",
}
],
"methods": [
{
"name": ["sourceName", "dest1name", "dest2name"],
"desc": "desc",
"parameters": [
{
"name": ["sourceName", "dest1name", "dest2name"],
"lvIndex": 1
}
],
"variables": [
{
"name": ["sourceName", "dest1name", "dest2name"],
"lvIndex": 1,
"lvStartOffset": 1,
"lvtIndex": 1
}
]
}
]
}
]
}
Why is this needed though? Does any other application use this format? If not, shouldn't mapping-io also provide a reader then?
Parchment has an actually standardized format, so once https://github.com/ParchmentMC/Feather/issues/9 is ready, I think this can be closed