added helper scripts to repo

This commit is contained in:
krumel
2022-06-12 11:08:55 +02:00
parent aef7f46724
commit 54ae6414da
4 changed files with 85 additions and 1 deletions

7
.gitignore vendored
View File

@ -5,6 +5,7 @@
!readme.md
!.gitignore
!modlist.md
!refreshmods.sh
#include configs
!config
@ -14,4 +15,8 @@
!saves/
!saves/world/
!saves/world/serverconfig/
!saves/world/serverconfig/**
!saves/world/serverconfig/**
#include datapack generation
!datapacks
!datapacks/**

31
datapacks/gen_crushing.py Normal file
View File

@ -0,0 +1,31 @@
import os.path
template_path = "./templates/sheetmetal_crushing.json"
output_path = "../openloader/modpack_datapack/data/modpack_datapack/recipes"
output_name = "sheetmetal_crushing_{}.json"
recipes = [
["copper", "immersiveengineering:sheetmetal_copper", "create:crushed_copper_ore"],
["aluminum", "immersiveengineering:sheetmetal_aluminum", "create:crushed_aluminum_ore"],
["lead", "immersiveengineering:sheetmetal_lead", "create:crushed_lead_ore"],
["silver", "immersiveengineering:sheetmetal_silver", "create:crushed_silver_ore"],
["nickel", "immersiveengineering:sheetmetal_nickel", "create:crushed_nickel_ore"],
["uranium", "immersiveengineering:sheetmetal_uranium", "create:crushed_uranium_ore"],
# ["constantan", "immersiveengineering:sheetmetal_copper", "create:crushed_copper_ore"],
# ["electrum", "immersiveengineering:sheetmetal_copper", "create:crushed_copper_ore"],
# ["steel", "immersiveengineering:sheetmetal_copper", "create:crushed_copper_ore"],
["iron", "immersiveengineering:sheetmetal_iron", "create:crushed_iron_ore"],
["gold", "immersiveengineering:sheetmetal_gold", "create:crushed_gold_ore"],
["gold_cdeco", "createdeco:gold_sheet_metal", "create:crushed_gold_ore"],
["iron_cdeco", "createdeco:iron_sheet_metal", "create:crushed_iron_ore"],
["copper_cdeco", "createdeco:copper_sheet_metal", "create:crushed_copper_ore"],
["zinc_cdeco", "createdeco:zinc_sheet_metal", "create:crushed_zinc_ore"]
]
template = open(template_path, "r").readlines()
for recipe in recipes:
print(recipe[0])
with open(os.path.join(output_path, output_name.format(recipe[0])), "w") as outfile:
for line in template:
outfile.write(line.replace("{input}", recipe[1]).replace("{output}", recipe[2]))

View File

@ -0,0 +1,16 @@
{
"type": "create:crushing",
"group": "minecraft:misc",
"ingredients": [
{
"item": "{input}"
}
],
"results": [
{
"item": "{output}",
"count": 1
}
],
"processingTime": 300
}

32
refreshmods.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
# if you cloned this from the repository, you might have to edit your paths
# this is mainly for me, so I can easily update the pack on the server
echo "Sync mods"
rsync -Pr --delete --filter="- /user/" --filter="- /.old/" ~/Games/Minecraft/modpack_dev/ ~/.local/share/PolyMC/instances/modpack_dev/.minecraft/mods/
echo "Create modlist"
echo "# Automatically downloaded" > modlist.md
ferium list >> modlist.md
echo "# Manually downloaded" >> modlist.md
ls ~/Games/Minecraft/modpack_dev/user >> modlist.md
# add extra newlines
gawk -i inplace 1 ORS='\n\n' modlist.md
echo "Zip the mods"
tar -czvf /tmp/krumels_pack_dev_$(date -Idate -u).tar.gz mods
echo "Move mods to the webroot"
rsync -e ssh /tmp/krumels_pack_dev_$(date -Idate -u).tar.gz minecraft@krumel.moe:~/webroot/mods
echo "Sync mods with server"
rsync -Pr --delete --filter="- /DistantHorizons-*" mods/ minecraft@krumel.moe:~/Krumelcraft/mods/
echo "Sync config with server"
rsync -Pr --delete config/ minecraft@krumel.moe:~/Krumelcraft/config/
echo "Sync level-config with server"
rsync -Pr --delete saves/world/serverconfig/ minecraft@krumel.moe:~/Krumelcraft/world/serverconfig