Initial commit
This commit is contained in:
commit
92785e88ab
8 changed files with 137 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
_build
|
||||
|
3
README.md
Normal file
3
README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Create + ExtendedCopper Compatibility
|
||||
|
||||
This datapack ensures compatibility between the Create and ExtendedCopper mod.
|
52
build.py
Normal file
52
build.py
Normal file
|
@ -0,0 +1,52 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from json import load
|
||||
from os import chdir
|
||||
from pathlib import Path
|
||||
from shutil import copy
|
||||
from shutil import copytree
|
||||
from shutil import make_archive
|
||||
from shutil import rmtree
|
||||
|
||||
|
||||
project_dir = Path(".").resolve()
|
||||
build_root_dir = project_dir / "_build"
|
||||
|
||||
fabric_mod_json_path = project_dir / "fabric.mod.json"
|
||||
source_files = [
|
||||
fabric_mod_json_path,
|
||||
project_dir / "pack.mcmeta",
|
||||
project_dir / "data"
|
||||
]
|
||||
|
||||
|
||||
def get_build_name(mod_info: dict) -> str:
|
||||
return f"{mod_info['id'].replace('_', '-')}-{mod_info['version']}-mc{mod_info['depends']['minecraft']}"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# load mod info
|
||||
with fabric_mod_json_path.open("r") as f:
|
||||
mod_info = load(f)
|
||||
# get build name
|
||||
build_name = get_build_name(mod_info)
|
||||
# clear/create required directories
|
||||
build_tmp_dir = build_root_dir / build_name
|
||||
if build_tmp_dir.exists():
|
||||
rmtree(build_tmp_dir)
|
||||
build_tmp_dir.mkdir(parents=True)
|
||||
# copy source files
|
||||
for s in source_files:
|
||||
if s.is_dir():
|
||||
copytree(s, build_tmp_dir / s.name)
|
||||
else:
|
||||
copy(s, build_tmp_dir / s.name)
|
||||
# create jar archive
|
||||
chdir(build_root_dir)
|
||||
make_archive(build_name, "zip", build_tmp_dir.name)
|
||||
output_file = Path(build_name + ".zip").rename(build_name + ".jar").resolve()
|
||||
chdir(project_dir)
|
||||
# cleanup
|
||||
rmtree(build_tmp_dir)
|
||||
# done
|
||||
print("Done. The resulting jar file is at ", output_file)
|
12
data/crafting/recipes/copper_button_create.json
Normal file
12
data/crafting/recipes/copper_button_create.json
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "create:copper_nugget"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "extendedcopper:copper_button",
|
||||
"count": 1
|
||||
}
|
||||
}
|
20
data/crafting/recipes/copper_chain_create.json
Normal file
20
data/crafting/recipes/copper_chain_create.json
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"N",
|
||||
"I",
|
||||
"N"
|
||||
],
|
||||
"key": {
|
||||
"I": {
|
||||
"item": "minecraft:copper_ingot"
|
||||
},
|
||||
"N": {
|
||||
"item": "create:copper_nugget"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "extendedcopper:copper_chain",
|
||||
"count": 1
|
||||
}
|
||||
}
|
20
data/crafting/recipes/copper_lantern_create.json
Normal file
20
data/crafting/recipes/copper_lantern_create.json
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"XXX",
|
||||
"X#X",
|
||||
"XXX"
|
||||
],
|
||||
"key": {
|
||||
"#": {
|
||||
"item": "minecraft:torch"
|
||||
},
|
||||
"X": {
|
||||
"item": "create:copper_nugget"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "extendedcopper:copper_lantern",
|
||||
"count": 1
|
||||
}
|
||||
}
|
22
fabric.mod.json
Normal file
22
fabric.mod.json
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "create_expandedcopper_compat",
|
||||
"version": "1.0.0",
|
||||
"name": "Create ExpandedCopper Compatibility",
|
||||
"description": "Adds compatibility between the Create and ExtendedCopper mods.",
|
||||
"authors": [
|
||||
"ChaoticByte"
|
||||
],
|
||||
"contact": {
|
||||
"sources": "https://github.com/ChaoticByte/create-expandedcopper-compat",
|
||||
"issues": "https://github.com/ChaoticByte/create-expandedcopper-compat/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"environment": "*",
|
||||
"depends": {
|
||||
"minecraft": "1.20.1",
|
||||
"fabric-resource-loader-v0": "*",
|
||||
"create": "0.5.x",
|
||||
"extendedcopper": "1.4.x"
|
||||
}
|
||||
}
|
6
pack.mcmeta
Normal file
6
pack.mcmeta
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"pack": {
|
||||
"pack_format": 15,
|
||||
"description": "This datapacks adds compatibility between the Create and ExtendedCopper mods"
|
||||
}
|
||||
}
|
Reference in a new issue