This repository has been archived by the owner on May 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
make.py
executable file
·62 lines (58 loc) · 2.13 KB
/
make.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env python3
import json
from io import TextIOWrapper
from zipfile import ZipFile
tools: dict[str, dict] = {
"minecraft:netherite_axe": {
"type": "computercraft:tool",
"item": "minecraft:netherite_axe",
"adjective": "upgrade.minecraft.diamond_axe.adjective",
"damageMultiplier": 6,
"allowEnchantments": True,
"consumeDurability": "when_enchanted",
},
"minecraft:netherite_pickaxe": {
"type": "computercraft:tool",
"item": "minecraft:netherite_pickaxe",
"adjective": "upgrade.minecraft.diamond_pickaxe.adjective",
"allowEnchantments": True,
"consumeDurability": "when_enchanted",
},
"minecraft:netherite_hoe": {
"type": "computercraft:tool",
"item": "minecraft:netherite_hoe",
"adjective": "upgrade.minecraft.diamond_hoe.adjective",
"breakable": "computercraft:turtle_hoe_harvestable",
"allowEnchantments": True,
"consumeDurability": "when_enchanted",
},
"minecraft:netherite_shovel": {
"type": "computercraft:tool",
"item": "minecraft:netherite_shovel",
"adjective": "upgrade.minecraft.diamond_shovel.adjective",
"breakable": "computercraft:turtle_shovel_harvestable",
"allowEnchantments": True,
"consumeDurability": "when_enchanted",
},
"minecraft:netherite_sword": {
"type": "computercraft:tool",
"item": "minecraft:netherite_sword",
"adjective": "upgrade.minecraft.diamond_sword.adjective",
"breakable": "computercraft:turtle_sword_harvestable",
"damageMultiplier": 9,
"allowEnchantments": True,
"consumeDurability": "when_enchanted",
},
}
extra_files = [
"pack.mcmeta",
]
with ZipFile("netherite-tools.zip", "w") as zip:
for id, tool in tools.items():
mod, path = id.split(":", maxsplit=1)
with zip.open(f"data/{mod}/computercraft/turtle_upgrades/{path}.json", "w") as out:
with TextIOWrapper(out) as wrapper:
json.dump(tool, wrapper)
for file in extra_files:
with open(file, "rb") as input:
zip.write(file)