Skip to content

Instantly share code, notes, and snippets.

@roblabla
Created March 20, 2017 11:35
Show Gist options
  • Save roblabla/65e34bd831cd388491062c3bd772fb70 to your computer and use it in GitHub Desktop.
Save roblabla/65e34bd831cd388491062c3bd772fb70 to your computer and use it in GitHub Desktop.
forge-protodef
{
"types": {
"fml|hsMapper": ["mapper", {
"type": "i8",
"mappings": {
"0": "ServerHello",
"1": "ClientHello",
"2": "ModList",
"3": "RegistryData",
"-1": "HandshakeAck",
"-2": "HandshakeReset"
}
}],
"FML|HS": ["container", [
{
"name": "discriminator",
"type": "fml|hsMapper"
},
{
"anon": true,
"type":
[
"switch",
{
"compareTo": "discriminator",
"fields":
{
"ServerHello":
[
"container",
[
{
"name": "fmlProtocolVersion",
"type": "i8"
},
{
"name": "overrideDimension",
"type":
[
"switch",
{
"compareTo": "fmlProtocolVersion",
"fields":
{
"0": "void",
"1": "void"
},
"default": "i32"
}
]
}
]
],
"ClientHello": [
"container",
[
{
"name": "fmlProtocolVersion",
"type": "i8"
}
]
],
"ModList":
[
"container",
[
{
"name": "mods",
"type":
[
"array",
{
"countType": "varint",
"type":
[
"container",
[
{
"name": "modid",
"type": "string"
},
{
"name": "version",
"type": "string"
}
]
]
}
]
}
]
],
"RegistryData":
[
"container",
[
{
"name": "hasMore",
"type": "bool"
},
{
"name": "registryName",
"type": "string"
}
]
],
"HandshakeAck":
[
"container",
[
{
"name": "phase",
"type": "i8"
}
]
]
}
}
]
}
]]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment