Skip to content

Commit b1190fc

Browse files
Add schemas for Fusion resource pack metadata (#3476)
* Add Fusion properties to minecraft-pack-mcmeta.json * Add Fusion properties to minecraft-texture-mcmeta.json * Fix Fusion texture metadata * Add positive tests for Fusion pack and texture metadata * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Prefix Fusion schemas with 'partial-' * Apply Fusion metadata tests tot regular Minecraft schemas * Add empty 'fileMatch' properties for Fusion schemas in `catalog.json` * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 4535ec1 commit b1190fc

File tree

10 files changed

+354
-36
lines changed

10 files changed

+354
-36
lines changed

src/api/json/catalog.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1873,6 +1873,18 @@
18731873
"fileMatch": ["function.json"],
18741874
"url": "https://json.schemastore.org/function.json"
18751875
},
1876+
{
1877+
"name": "Fusion resource pack metadata",
1878+
"description": "Fusion properties for Minecraft resource pack metadata",
1879+
"fileMatch": [],
1880+
"url": "https://json.schemastore.org/partial-fusion-pack-metadata.json"
1881+
},
1882+
{
1883+
"name": "Fusion texture metadata",
1884+
"description": "Fusion properties for Minecraft texture metadata",
1885+
"fileMatch": [],
1886+
"url": "https://json.schemastore.org/partial-fusion-texture-metadata.json"
1887+
},
18761888
{
18771889
"name": "G2P Mapping Configuration",
18781890
"description": "defining mappings for Python-based grapheme-to-phoneme engine 'g2p'",
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"animation": {
3+
"frames": [
4+
0,
5+
1,
6+
2,
7+
{
8+
"index": 10,
9+
"time": 20
10+
}
11+
],
12+
"frametime": 8,
13+
"height": 8,
14+
"interpolate": true,
15+
"width": 8
16+
},
17+
"fusion": {
18+
"layout": "compact",
19+
"render_type": "opaque",
20+
"type": "connecting"
21+
}
22+
}

src/schema-validation.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,16 @@
615615
"unknownKeywords": ["examples"]
616616
}
617617
},
618+
{
619+
"minecraft-pack-mcmeta.json": {
620+
"externalSchema": ["partial-fusion-pack-metadata.json"]
621+
}
622+
},
623+
{
624+
"minecraft-texture-mcmeta.json": {
625+
"externalSchema": ["partial-fusion-texture-metadata.json"]
626+
}
627+
},
618628
{
619629
"ninjs-2.0.json": {
620630
"unknownKeywords": ["name"],

src/schemas/json/minecraft-pack-mcmeta.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
},
4444
"additionalProperties": false
4545
}
46+
},
47+
"fusion": {
48+
"$comment": "Fusion properties for Minecraft resource packs",
49+
"$ref": "https://json.schemastore.org/partial-fusion-pack-metadata.json#/definitions/fusion-properties"
4650
}
4751
},
4852
"title": "pack metadata",

src/schemas/json/minecraft-texture-mcmeta.json

Lines changed: 49 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,63 @@
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"$id": "https://json.schemastore.org/minecraft-texture-mcmeta.json",
44
"description": "A mcmeta file for an animated texture for a Minecraft resource pack config schema",
5-
"properties": {
6-
"animation": {
7-
"description": "Animation",
8-
"type": "object",
5+
"oneOf": [
6+
{
97
"properties": {
10-
"interpolate": {
11-
"type": "boolean",
12-
"default": false
13-
},
14-
"width": {
15-
"type": "integer"
16-
},
17-
"height": {
18-
"type": "integer"
19-
},
20-
"frametime": {
21-
"type": "integer",
22-
"default": 1
23-
},
24-
"frames": {
25-
"type": "array",
26-
"items": {
27-
"oneOf": [
28-
{
29-
"type": "integer"
30-
},
31-
{
32-
"type": "object",
33-
"properties": {
34-
"index": {
8+
"animation": {
9+
"description": "Animation",
10+
"type": "object",
11+
"properties": {
12+
"interpolate": {
13+
"type": "boolean",
14+
"default": false
15+
},
16+
"width": {
17+
"type": "integer"
18+
},
19+
"height": {
20+
"type": "integer"
21+
},
22+
"frametime": {
23+
"type": "integer",
24+
"default": 1
25+
},
26+
"frames": {
27+
"type": "array",
28+
"items": {
29+
"oneOf": [
30+
{
3531
"type": "integer"
3632
},
37-
"time": {
38-
"type": "integer"
33+
{
34+
"type": "object",
35+
"properties": {
36+
"index": {
37+
"type": "integer"
38+
},
39+
"time": {
40+
"type": "integer"
41+
}
42+
}
3943
}
40-
}
44+
]
4145
}
42-
]
46+
}
4347
}
4448
}
45-
}
49+
},
50+
"required": ["animation"]
51+
},
52+
{
53+
"properties": {
54+
"fusion": {
55+
"$comment": "Fusion properties for Minecraft texture metadata",
56+
"$ref": "https://json.schemastore.org/partial-fusion-texture-metadata.json#/definitions/fusion-properties"
57+
}
58+
},
59+
"required": ["fusion"]
4660
}
47-
},
48-
"required": ["animation"],
61+
],
4962
"title": "Minecraft Resource Pack Texture Mcmeta",
5063
"type": "object"
5164
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://json.schemastore.org/partial-fusion-pack-metadata.json",
4+
"additionalProperties": false,
5+
"definitions": {
6+
"fusion-properties": {
7+
"additionalProperties": false,
8+
"description": "Fusion options for the current pack\nhttps://github.com/SuperMartijn642/Fusion/wiki",
9+
"properties": {
10+
"overrides_folder": {
11+
"default": "fusion",
12+
"description": "Folder which contains files which should override regular files when Fusion is loaded\nhttps://github.com/SuperMartijn642/Fusion/wiki/Optional-Fusion-Overwrites",
13+
"minLength": 1,
14+
"title": "Fusion Overrides Folder",
15+
"type": "string"
16+
}
17+
},
18+
"title": "Fusion Options",
19+
"type": "object"
20+
}
21+
},
22+
"description": "Fusion extension for Minecraft resource pack metadata",
23+
"properties": {
24+
"filter": {
25+
"additionalProperties": {
26+
"additionalProperties": false,
27+
"description": "A pattern for the current pack\nhttps://minecraft.wiki/w/Data_pack",
28+
"properties": {
29+
"namespace": {
30+
"description": "A namespace regular expression for the current pack\nhttps://minecraft.wiki/w/Data_pack",
31+
"type": "string"
32+
},
33+
"path": {
34+
"description": "A path regular expression for the current pack\nhttps://minecraft.wiki/w/Data_pack",
35+
"type": "string"
36+
}
37+
},
38+
"title": "pattern",
39+
"type": "object"
40+
},
41+
"description": "Filter options for the current pack\nhttps://minecraft.wiki/w/Data_pack",
42+
"title": "filter options",
43+
"type": "object"
44+
},
45+
"fusion": {
46+
"$ref": "#/definitions/fusion-properties"
47+
},
48+
"pack": {
49+
"additionalProperties": false,
50+
"description": "Options for the current pack\nhttps://minecraft.wiki/w/Data_pack#Contents",
51+
"properties": {
52+
"description": {
53+
"description": "A description for the current pack\nhttps://minecraft.wiki/w/Data_pack#Contents",
54+
"title": "description"
55+
},
56+
"pack_format": {
57+
"default": 4,
58+
"description": "A version for the current pack\nhttps://minecraft.wiki/w/Data_pack#Contents",
59+
"maximum": 18,
60+
"minimum": 1,
61+
"type": "integer"
62+
}
63+
},
64+
"title": "pack options",
65+
"type": "object"
66+
}
67+
},
68+
"title": "Fusion Resource Pack Metadata",
69+
"type": "object"
70+
}

0 commit comments

Comments
 (0)