mapping-io icon indicating copy to clipboard operation
mapping-io copied to clipboard

Add JsonWriter

Open jackassmc opened this issue 3 years ago • 4 comments

This PR adds support for writing mappings as JSON files.

jackassmc avatar May 07 '22 14:05 jackassmc

i hope there's a spec on the json format.

liach avatar May 07 '22 21:05 liach

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
                        }
                    ]
                }
            ]
        }
    ]
}

jackassmc avatar May 08 '22 03:05 jackassmc

Why is this needed though? Does any other application use this format? If not, shouldn't mapping-io also provide a reader then?

NebelNidas avatar Sep 23 '22 22:09 NebelNidas

Parchment has an actually standardized format, so once https://github.com/ParchmentMC/Feather/issues/9 is ready, I think this can be closed

NebelNidas avatar Nov 15 '23 16:11 NebelNidas