diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bd63fe5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +## 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 +update-pack.data/.* +update-pack.data/*/ +update-pack.data/update.sh +update-pack.data/busybox.exe + +## Add your modded folders/files to ignore here diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fa50669 --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +default: + @echo "No Default make command configured" + @echo "Please use either" + @echo " - make multimc" + @echo " - make technic" + @echo " - make all" + @echo "" + @echo "MultiMC will make a pack with the updater.exe built in" + @echo " along with the git history" + @echo "" + @echo "Techic will make a pack that can be used for technic" + @echo "" + @echo "All will make both technic and MultiMC packs" + +multimc: + -rm -rf update-pack.data/temp + -rm -rf update-pack.data/bin + -rm -rf update-pack.data/busybox.exe + 7z d ../modpack.zip ./* -r + 7z d ../modpack.zip ./.* -r + 7z a ../modpack.zip ./* -r + 7z a ../modpack.zip ./.git -r + 7z a ../modpack.zip ./.minecraft -r + +technic: + 7z d ../modpack-technic.zip ./* -r + 7z a ../modpack-technic.zip ./.minecraft/* -r + cp modpack.icon.png icon.png + 7z a ../modpack-technic.zip ./icon.png + rm icon.png + +all: multimc technic \ No newline at end of file diff --git a/README.md b/README.md index e69d05e..95a060e 100644 --- a/README.md +++ b/README.md @@ -17,19 +17,24 @@ currently this template only supports - Dont forget to make a git repo for your modpack, I reccomend using [GitLab](https://gitlab.com) due to its free Large File Support. - There are a few files you will need to edit as a maintainer to properly use this tool, - - `Makefile` - - Edit this so that you can name your release zips how you want them to - `.gitignore` - Your modpack will create files that can and most likely will create issues with the updater, input the filepaths you wish for the updater to ignore, (usually files/folders that do not need to be bundled as they will be automatically created) - `.minecraft/icon.png` - This is your Modpack Icon, please change it, you may alter this one if you do not have one made specifically for you, the image is a 32x32 pixel image scaled up to 1024x1024 + - Also change the file name for it + - `instance.cfg` + - iconKey=icon, change this to whatever you named your modpack icon (excluding file extension) + - name=Example Modpack, change this to your modpack name + - `Makefile` + - Edit this so that you can name your release zips how you want them to + - I highly suggest using this mod or simular to push custom configs as players may make changes to their settings which *will* break the updater - https://www.curseforge.com/minecraft/mc-mods/yosbr - Modpack Users - MultiMC - - Add this into your instance settings + - Add this into your instance settings if not already there - `$INST_DIR/update-pack.exe` - ![](https://i.imgur.com/wjBuHYG.png) - Technic diff --git a/instance.cfg b/instance.cfg new file mode 100644 index 0000000..8b5a9b3 --- /dev/null +++ b/instance.cfg @@ -0,0 +1,43 @@ +AutoCloseConsole=false +ForgeVersion= +InstanceType=OneSix +IntendedVersion= +JavaPath= +JoinServerOnLaunch=false +JoinServerOnLaunchAddress= +JvmArgs= +LWJGLVersion= +LaunchMaximized=false +LiteloaderVersion= +LogPrePostOutput=true +MCLaunchMethod=LauncherPart +MaxMemAlloc=2048 +MinMemAlloc=204 +MinecraftWinHeight=480 +MinecraftWinWidth=854 +OverrideCommands=false +OverrideConsole=false +OverrideGameTime=false +OverrideJava=false +OverrideJavaArgs=false +OverrideJavaLocation=false +OverrideMCLaunchMethod=false +OverrideMemory=false +OverrideNativeWorkarounds=false +OverrideWindow=false +PermGen=128 +PostExitCommand= +PreLaunchCommand=$INST_DIR/update-pack.exe +RecordGameTime=true +ShowConsole=false +ShowConsoleOnError=true +ShowGameTime=true +UseNativeGLFW=false +UseNativeOpenAL=false +WrapperCommand= +iconKey=modpack.icon +lastLaunchTime= +lastTimePlayed= +name=Example Modpack +notes= +totalTimePlayed= diff --git a/mmc-pack.json b/mmc-pack.json new file mode 100644 index 0000000..7443c7b --- /dev/null +++ b/mmc-pack.json @@ -0,0 +1,27 @@ +{ + "components": [ + { + "cachedName": "LWJGL 3", + "cachedVersion": "3.2.2", + "cachedVolatile": true, + "dependencyOnly": true, + "uid": "org.lwjgl3", + "version": "3.2.2" + }, + { + "cachedName": "Minecraft", + "cachedRequires": [ + { + "equals": "3.2.2", + "suggests": "3.2.2", + "uid": "org.lwjgl3" + } + ], + "cachedVersion": "1.17.1", + "important": true, + "uid": "net.minecraft", + "version": "1.17.1" + } + ], + "formatVersion": 1 +} diff --git a/modpack.icon.png b/modpack.icon.png new file mode 100644 index 0000000..d81d8c4 Binary files /dev/null and b/modpack.icon.png differ diff --git a/update-pack.data/config.toml b/update-pack.data/config.toml new file mode 100644 index 0000000..b2be67b --- /dev/null +++ b/update-pack.data/config.toml @@ -0,0 +1,23 @@ +# The program to run, can be defined as a direct +# file path, or as an EXE in the $PATH variable +program = "busybox.exe" +programArgs = "bash -c '{data}/start.sh'" + +# Working Directory +workingDirectory = "{data}/" + +# Do not include windows path +# If True, only the data directory will be +# treated as $PATH +isolatedPath = true + +# Global Environment variables to be set +# to aid with portability, +[environment] + # Please do not edit these values unless you + # know what you are doing + APPDATA = "{data}/APPDATA" + LOCALAPPDATA = "{data}/APPDATA" + HOME = "{data}/" + USERPROFILE = "{data}/" + # Put your custom environment variables here \ No newline at end of file diff --git a/update-pack.data/start.sh b/update-pack.data/start.sh new file mode 100644 index 0000000..8706d5b --- /dev/null +++ b/update-pack.data/start.sh @@ -0,0 +1,6 @@ +## DO NOT EDIT THIS FILE, ## +## DOING SO WILL BREAK ## +## THE UPDATER +cp updater.sh update.sh +bash update.sh +rm update.sh \ No newline at end of file diff --git a/update-pack.data/updater.sh b/update-pack.data/updater.sh new file mode 100644 index 0000000..74188ab --- /dev/null +++ b/update-pack.data/updater.sh @@ -0,0 +1,18 @@ +GITURL="https://github.com/git-for-windows/git/releases/download/v2.33.0.windows.1/PortableGit-2.33.0-64-bit.7z.exe" + +#install git if not found +if [ ! -f "bin/git/bin/git.exe" ]; then + if [ ! -d "temp" ]; then + mkdir temp + fi + if [ ! -f "temp/git.install.exe" ]; then + wget $GITURL -O temp/git.install.exe + fi + temp/git.install.exe -o bin/git -y +fi + +cd ../ +update-pack.data/bin/git/bin/git.exe config --global pull.rebase false +update-pack.data/bin/git/bin/git.exe pull origin main + +echo "[$0] If there were any errors, please inform the Modpack Author" \ No newline at end of file diff --git a/update-pack.exe b/update-pack.exe new file mode 100644 index 0000000..9cf0da8 Binary files /dev/null and b/update-pack.exe differ