vanillia-modpack/Makefile

100 lines
3.1 KiB
Makefile
Raw Permalink Normal View History

2021-11-30 20:37:34 +00:00
default:
@echo "No Default make command configured"
@echo "Please use either"
2023-05-17 18:38:23 +01:00
@echo " - make multimc"
@echo " - make curseforge"
@echo " - make modrinth"
@echo " - make technic"
@echo " - make server"
@echo " - make all"
@echo ""
@echo "Curseforge will make a curseforge import file"
@echo ""
@echo "Modrinth will make a modrinth import file"
2021-11-30 20:37:34 +00:00
@echo ""
@echo "Multimc will make a multimc zip file which contains"
@echo " the packwiz updater"
@echo ""
@echo "Technic will make a technic pack zip"
@echo ""
2023-05-17 18:38:23 +01:00
@echo "Server will make a server pack zip"
@echo " This will include the packwiz updater,"
@echo " but will not be configured to run by default"
@echo ""
@echo "All will make all packs it can"
@echo ""
2023-03-05 19:48:20 +00:00
PACKNAME := $(notdir $(CURDIR))
2023-05-17 18:38:23 +01:00
PACKURL := $(shell pw detect)
2023-03-05 19:48:20 +00:00
2023-05-11 03:27:55 +01:00
curseforge: refresh
2023-02-23 06:10:48 +00:00
-mkdir .build
@echo "Making Curseforge pack"
2023-03-05 19:48:20 +00:00
packwiz curseforge export --pack-file .minecraft/pack.toml
2023-05-11 03:27:55 +01:00
mv ./*.zip ./.build/${PACKNAME}-curseforge.zip
2022-03-02 02:50:49 +00:00
2023-05-11 03:27:55 +01:00
modrinth: refresh
2023-02-23 06:10:48 +00:00
-mkdir .build
2022-03-02 02:50:49 +00:00
@echo "Making Modrinth pack"
2023-05-17 18:38:23 +01:00
packwiz modrinth export --pack-file .minecraft/pack.toml
mv ./*.mrpack ./.build/${PACKNAME}-modrinth.mrpack
2021-11-30 20:37:34 +00:00
2023-05-11 03:27:55 +01:00
multimc: refresh
2023-02-23 06:10:48 +00:00
-mkdir .build
@echo "Making MultiMC pack"
2023-03-05 19:48:20 +00:00
7z d .build/${PACKNAME}-multimc.zip ./* -r
7z d .build/${PACKNAME}-multimc.zip ./.minecraft -r
2023-05-17 18:38:23 +01:00
@sed -i 's#{PACKURL}#${PACKURL}#' instance.cfg
2023-03-05 19:48:20 +00:00
7z a .build/${PACKNAME}-multimc.zip ./* -r
7z a .build/${PACKNAME}-multimc.zip ./.minecraft -r
7z d .build/${PACKNAME}-multimc.zip ./.build ./.minecraft/mods ./.minecraft/pack.toml ./.minecraft/index.toml -r
2023-05-17 18:38:23 +01:00
@sed -i 's#${PACKURL}#{PACKURL}#' instance.cfg
2021-11-30 20:37:34 +00:00
2023-05-11 03:27:55 +01:00
technic: refresh
2023-02-23 06:10:48 +00:00
-mkdir .build
@echo "Making Technic pack"
-rm -rf .technic
-cp -r .minecraft .technic
2023-03-05 19:48:20 +00:00
cp ${PACKNAME}_icon.png .technic/icon.png
2023-02-23 06:30:29 +00:00
cd .technic && java -jar ../.minecraft/packwiz-installer-bootstrap.jar ../.minecraft/pack.toml && cd ..
2022-03-02 03:45:39 +00:00
-rm -rf .technic/packwiz* .technic/index.toml .technic/pack.toml .technic/mods/*.toml
2023-03-05 19:48:20 +00:00
7z d .build/${PACKNAME}-technic.zip ./* ./.* -r
7z a .build/${PACKNAME}-technic.zip ./.technic/* -r
2021-11-30 20:37:34 +00:00
2023-05-11 03:40:45 +01:00
server: refresh
-mkdir .build
@echo "Making Server pack"
-rm -rf .server
-cp -r .minecraft .server
2023-05-17 18:38:23 +01:00
cp ${PACKNAME}_icon.png .server/server-icon.png
2023-05-11 03:40:45 +01:00
cd .server && java -jar ../.minecraft/packwiz-installer-bootstrap.jar -s server ../.minecraft/pack.toml && cd ..
7z d .build/${PACKNAME}-server.zip ./* ./.* -r
7z a .build/${PACKNAME}-server.zip ./.server/* -r
2023-05-11 03:27:55 +01:00
preClean: refresh
2023-03-05 19:48:20 +00:00
-rm -rf .build
2023-05-17 18:38:23 +01:00
-rm -rf .server
2023-05-11 03:27:55 +01:00
postClean: refresh
2022-02-25 21:38:29 +00:00
-rm -rf .technic
2023-05-17 18:38:23 +01:00
-rm -rf .server
2022-02-25 21:38:29 +00:00
-git gc --aggressive --prune
2023-05-17 18:38:23 +01:00
clean: preClean postClean
2022-02-25 21:38:29 +00:00
2023-05-11 03:40:45 +01:00
all: preClean curseforge modrinth multimc technic server postClean
2022-06-10 20:19:07 +01:00
2023-05-11 03:27:55 +01:00
refresh:
cd .minecraft && packwiz refresh
2022-06-10 20:19:07 +01:00
update-packwiz:
go install github.com/packwiz/packwiz@latest
2023-05-11 03:27:55 +01:00
go install github.com/Merith-TK/packwiz-wrapper/cmd/pw@main
2022-06-10 20:19:07 +01:00
clear
@echo "Packwiz has been Updated"
run-server:
2023-06-23 15:51:34 +01:00
@cd .minecraft && pw refresh && cd ..
@-mkdir .run
@echo "eula=true" > .run/eula.txt
2023-07-11 18:46:07 +01:00
#@cd .run && java -jar ../.minecraft/packwiz-installer-bootstrap.jar ../.minecraft/pack.toml -s server && cd ..
2023-06-23 15:51:34 +01:00
@cd .run && java -Xmx2G -Xms2G -jar server.jar nogui && cd ..