Skip to content

Conversation

jackassmc
Copy link

This PR adds support for writing mappings as JSON files.

@liach
Copy link

liach commented May 7, 2022

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

@jackassmc
Copy link
Author

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

@NebelNidas
Copy link
Member

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

@NebelNidas
Copy link
Member

Parchment has an actually standardized format, so once ParchmentMC/Feather#9 is ready, I think this can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants