commit fbd1f63b3b33ea738a6689289be7f63655bc2ca3 Author: merith-tk Date: Thu Oct 10 11:34:10 2024 -0700 Modpack Template diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..e33eab6 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,39 @@ +name: Build Modpack + +on: + pull_request: + push: + branches: + - main # Change this to your preferred branch + tags-ignore: + - 'v*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up JDK + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: '16' # Change to '8' for Java 8 + + - name: Install 7z + run: | + sudo apt-get update + sudo apt-get install -y p7zip-full + + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: '1.23' + + - name: Update Packwiz + run: make update-packwiz + + - name: Make Modpack + run: make preClean multimc curseforge modrinth postClean \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..45955a9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,46 @@ +name: Release Modpack + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up JDK + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: '16' # Change to '8' for Java 8 + + - name: Install 7z + run: | + sudo apt-get update + sudo apt-get install -y p7zip-full + + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: '1.23' + + - name: Update Packwiz + run: make update-packwiz + + - name: Make Modpack + run: make preClean multimc curseforge modrinth postClean + + - name: Make Modlist + run: make release-file + + - name: Create Release + uses: ncipollo/release-action@v1 + with: + artifacts: ".build/*" + allowUpdates: true + bodyFile: ".build/CHANGELOG.md" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..857f17c --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +## Prevent Vanillia Minecraft folders from being tracked +.minecraft/coremods +.minecraft/logs +.minecraft/resourcepacks +.minecraft/saves +.minecraft/screenshots +.minecraft/server-resource-packs +.minecraft/texturepacks +.minecraft/realms_persistence.json + +## Ignore Modpack Updater Script loose files +.build +.run +.server +.technic + +*.zip +*.mrpack + +## Add your modded folders/files to ignore here +.minecraft/packwiz-installer.jar +.minecraft/packwiz.json diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 0000000..f64ba8d --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,7 @@ +FROM gitpod/workspace-go + +RUN sudo apt-get -q update && \ + sudo apt install p7zip-full make && \ + sudo apt install -yq openjdk-17-jdk + +RUN sudo update-java-alternatives --set java-1.17.0-openjdk-amd64 \ No newline at end of file diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..988b34c --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,5 @@ +image: + file: .gitpod.Dockerfile + +tasks: +- command: make update-packwiz diff --git a/.minecraft/icon.png b/.minecraft/icon.png new file mode 100644 index 0000000..d81d8c4 Binary files /dev/null and b/.minecraft/icon.png differ diff --git a/.minecraft/index.toml b/.minecraft/index.toml new file mode 100644 index 0000000..9351d2d --- /dev/null +++ b/.minecraft/index.toml @@ -0,0 +1,19 @@ +hash-format = "sha256" + +[[files]] +file = "icon.png" +hash = "50f74a7debb4a852e1384434500515f2478b8dcf0d71b75eba148ca34d89715c" + +[[files]] +file = "mods/lithium.pw.toml" +hash = "b3b33c53f8356928f86223f26eaebd7a266d610f8628e5077cda196192b0b7e4" +metafile = true + +[[files]] +file = "mods/sodium.pw.toml" +hash = "d24ad43869dfe068c041cc7da0a7ed5926f742d1676eb765ad66515e1e9568a6" +metafile = true + +[[files]] +file = "packwiz-installer-bootstrap.jar" +hash = "a8fbb24dc604278e97f4688e82d3d91a318b98efc08d5dbfcbcbcab6443d116c" diff --git a/.minecraft/mods/lithium.pw.toml b/.minecraft/mods/lithium.pw.toml new file mode 100644 index 0000000..ff7b0ef --- /dev/null +++ b/.minecraft/mods/lithium.pw.toml @@ -0,0 +1,13 @@ +name = "Lithium" +filename = "lithium-fabric-mc1.21.1-0.13.0.jar" +side = "both" + +[download] +url = "https://cdn.modrinth.com/data/gvQqBUqZ/versions/5szYtenV/lithium-fabric-mc1.21.1-0.13.0.jar" +hash-format = "sha1" +hash = "25ab173627db3ed587380ddf635844d7a97ec6c4" + +[update] +[update.modrinth] +mod-id = "gvQqBUqZ" +version = "5szYtenV" diff --git a/.minecraft/mods/sodium.pw.toml b/.minecraft/mods/sodium.pw.toml new file mode 100644 index 0000000..643548e --- /dev/null +++ b/.minecraft/mods/sodium.pw.toml @@ -0,0 +1,13 @@ +name = "Sodium" +filename = "sodium-fabric-0.6.0-beta.1+mc1.21.jar" +side = "client" + +[download] +url = "https://cdn.modrinth.com/data/AANobbMI/versions/oZOSEhyy/sodium-fabric-0.6.0-beta.1%2Bmc1.21.jar" +hash-format = "sha1" +hash = "1f3eae51029d9fad59a3c448010eb6b6b45e3035" + +[update] +[update.modrinth] +mod-id = "AANobbMI" +version = "oZOSEhyy" diff --git a/.minecraft/pack.toml b/.minecraft/pack.toml new file mode 100644 index 0000000..7407e04 --- /dev/null +++ b/.minecraft/pack.toml @@ -0,0 +1,13 @@ +name = "Modpack Template" +author = "Merith.TK" +version = "1.0.0" +pack-format = "packwiz:1.1.0" + +[index] +file = "index.toml" +hash-format = "sha256" +hash = "c108bf23bd93b176bf893a8863c8eb3d1c3fb2abb7a4bb9651135daeca814e82" + +[versions] +fabric = "0.16.4" +minecraft = "1.21.1" diff --git a/.minecraft/packwiz-installer-bootstrap.jar b/.minecraft/packwiz-installer-bootstrap.jar new file mode 100644 index 0000000..84b934c Binary files /dev/null and b/.minecraft/packwiz-installer-bootstrap.jar differ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3c577b0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d90d476 --- /dev/null +++ b/Makefile @@ -0,0 +1,109 @@ +default: + @echo "No Default make command configured" + @echo "Please use either" + @echo " - make multimc" + @echo " - make local multimc" + @echo " - make curseforge" + @echo " - make modrinth" + @echo " - make local technic" + @echo " - make technic" + @echo " - make server" + @echo " - make all" + @echo "" + +PACKNAME := $(notdir $(shell pwd)) +ICONNAME := $(shell echo $(PACKNAME) | sed 's/[^a-zA-Z0-9]/_/g') + +build: refresh + @mkdir -p .build + @echo "PACKNAME: ${PACKNAME}" + @echo "ICONNAME: ${ICONNAME}" + @echo "PACKURL: $(shell pw detect)" + +curseforge: build + @echo "Making Curseforge pack" + packwiz curseforge export --pack-file .minecraft/pack.toml + mv ./*.zip ./.build/${PACKNAME}-curseforge.zip + +modrinth: build + @echo "Making Modrinth pack" + packwiz modrinth export --pack-file .minecraft/pack.toml + mv ./*.mrpack ./.build/${PACKNAME}-modrinth.mrpack + +multimc: build + @echo "Making MultiMC pack" + cp .minecraft/icon.png ./${ICONNAME}_icon.png + 7z d .build/${PACKNAME}-multimc.zip ./* -r + 7z d .build/${PACKNAME}-multimc.zip ./.minecraft -r + @sed -i 's#{PACKURL}#$(shell pw detect)#g' instance.cfg + @sed -i 's#{ICONNAME}#${ICONNAME}#g' instance.cfg + 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 + rm ./${ICONNAME}_icon.png + @sed -i 's#$(shell pw detect)#{PACKURL}#g' instance.cfg + @sed -i 's#${ICONNAME}#{ICONNAME}#g' instance.cfg + +technic: build + @echo "Making Technic pack" + @mkdir -p .technic + -rm -rf .technic + cp -r .minecraft .technic + cp .minecraft/icon.png .technic/icon.png + cd .technic && java -jar ../.minecraft/packwiz-installer-bootstrap.jar ../.minecraft/pack.toml && cd .. + -rm -rf .technic/packwiz* .technic/index.toml .technic/pack.toml .technic/mods/*.toml + 7z d .build/${PACKNAME}-technic.zip ./* ./.* -r + 7z a .build/${PACKNAME}-technic.zip ./.technic/* -r + +server: build + @echo "Making Server pack" + -rm -rf .server + @mkdir -p .server + mc-server-icon --icon .minecraft/icon.png --output .server/server-icon.png + 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 + +preClean: + -rm -rf .build .server .technic + -rm -f ./instance.cfga* + +postClean: + -git gc --aggressive --prune + -rm -f ./*_icon.png + +clean: preClean postClean + +all: preClean curseforge modrinth multimc technic server postClean + +refresh: + cd .minecraft && packwiz refresh + +update-packwiz: + go install github.com/packwiz/packwiz@latest + go install github.com/Merith-TK/packwiz-wrapper/cmd/pw@main + go install github.com/Merith-TK/utils/cmd/mc-server-icon@main + -clear + @echo "Packwiz has been Updated" + +release-file: build + @echo "Generating changelog" + @pw modlist versions + @git log --pretty=format:"%h - %s (%ci)" --abbrev-commit > .build/CHANGELOG.md + @echo "" >> .build/CHANGELOG.md + @echo "
Mod List" >> .build/CHANGELOG.md + @echo "" >> .build/CHANGELOG.md + @cat modlist.md >> .build/CHANGELOG.md + @echo "
" >> .build/CHANGELOG.md + +run-server: + @cd .minecraft && pw refresh + @mkdir -p .run + @echo "eula=true" > .run/eula.txt + @mc-server-icon --icon .minecraft/icon.png --output .run/server-icon.png + @cd .run && java -jar ../.minecraft/packwiz-installer-bootstrap.jar ../.minecraft/pack.toml -s server + @if [ ! -f .run/server.jar ]; then \ + echo "Downloading Fabric server jar..."; \ + curl -o .run/server.jar https://meta.fabricmc.net/v2/versions/loader/1.21.1/0.16.5/1.0.1/server/jar; \ + fi + @cd .run && java -Xmx2G -Xms2G -jar server.jar nogui diff --git a/README.md b/README.md new file mode 100644 index 0000000..60cc3d9 --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +## Update Pack Template +This is a template modpack makers can use to easily release their modpack onto multiple platforms. +currently this template only supports +- Curseforge + - Please note recent API changes to curseforge have broken support for most mods from curseforge in the other three formats + - Multi/PolyMC requires users to download mods manually + - Technc requires modpack makers to download mods manually + - Modrinth just doesnt support it at all +- [Multi/PolyMC](https://polymc.org) +- Technic +- Modrinth + + +### How to use this? +[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-908a85?logo=gitpod)](https://gitpod.io/from-referrer/) +- Modpack Makers + - Well first your going to need to install `busybox`, `git`, `go` `7zip`, and `make` on your computer, + - On Windows I personally reccomend getting all of these through [Scoop](https://scoop.sh/) + - After installing scoop, just run + - `scoop install busybox git go make 7zip` + - On Linux, + - Ubuntu/Debian + - `sudo apt install git p7zip make` + - golang needs the latest release, which is unfortunately not in the repos, please manually install it, there are plenty of guides online for this + - Arch + - please use an AUR helper such as `yay` + - `yay -Syu git go p7zip make` + + - after you install go, run this command to install packwiz + - `go install github.com/packwiz/packwiz@latest` + + - I reccomend using VSCode to manage your modpack as you have a full visual editor and git manager built in. + - to add mods, run `packwiz install ` + - for sodium from curseforge, `packwiz cf install sodium` + - to make a release, run `make multimc` or `make technic` + + - Dont forget to make a git repo for your modpack, I reccomend using [GitLab](https://gitlab.com) due to its free Large File Support. + - or a place to host the packwiz-data folder! + +- Modpack Users + - MultiMC + - Use Java 17, MC 1.16.5 runs just fine on forge AND fabric on java 17 diff --git a/instance.cfg b/instance.cfg new file mode 100644 index 0000000..55b212b --- /dev/null +++ b/instance.cfg @@ -0,0 +1,6 @@ +[General] +InstanceType=OneSix +iconKey={ICONNAME}_icon +name=Modpack Template +OverrideCommands=true +PreLaunchCommand="$INST_JAVA" -jar packwiz-installer-bootstrap.jar {PACKURL} \ No newline at end of file diff --git a/mmc-pack.json b/mmc-pack.json new file mode 100644 index 0000000..4b85ca6 --- /dev/null +++ b/mmc-pack.json @@ -0,0 +1,21 @@ +{ + "components": [ + { + "uid": "net.minecraft", + "version": "1.21.1" + }, + { + "cachedName": "LWJGL 3", + "cachedVersion": "3.2.2", + "cachedVolatile": true, + "dependencyOnly": true, + "uid": "org.lwjgl3", + "version": "3.2.2" + }, + { + "uid": "net.fabricmc.fabric-loader", + "version": "0.16.4" + } + ], + "formatVersion": 1 +} \ No newline at end of file diff --git a/modlist.md b/modlist.md new file mode 100644 index 0000000..7fc4acb --- /dev/null +++ b/modlist.md @@ -0,0 +1,11 @@ +# Modlist + +## Client Mods + +- [Sodium](https://modrinth.com/mod/AANobbMI/version/oZOSEhyy) + +## Shared Mods + +- [Lithium](https://modrinth.com/mod/gvQqBUqZ/version/5szYtenV) + +