forked from RavinMaddHatter/Structura
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manifest.py
41 lines (34 loc) · 1.14 KB
/
manifest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import json
import os
import uuid
def export(pack_name,nameTags=[]):
description="Structura block overlay pack, created by \u00a7o\u00a75DrAv0011\u00a7r, \u00a7o\u00a79 FondUnicycle\u00a7r and\u00a7o\u00a75 RavinMaddHatter\u00a7r"
if len(nameTags)>0:
description=f"Nametags: {', '.join(nameTags)}. {description}"
manifest = {
"format_version": 2,
"header": {
"name": pack_name.replace("/tmp/","").replace("tmp/",""),
"description": description,
"uuid": str(uuid.uuid4()),
"version": [
0,
0,
1
],
"min_engine_version": [
1,
16,
0
]
},
"modules": [
{
"type": "resources",
"uuid": str(uuid.uuid4()),
"version": [
0, 0, 1]}]}
path_to_ani = "{}/manifest.json".format(pack_name)
os.makedirs(os.path.dirname(path_to_ani), exist_ok=True)
with open(path_to_ani, "w+") as json_file:
json.dump(manifest, json_file, indent=2)