From 29132d612cfd9b9d3c9d14e7beb13cd3804d4df6 Mon Sep 17 00:00:00 2001 From: Timo Ley Date: Sat, 22 Aug 2020 13:46:22 +0200 Subject: [PATCH] init --- .gitignore | 2 ++ modpacktoolsconfig.toml | 14 ++++++++++++++ mpt | 43 +++++++++++++++++++++++++++++++++++++++++ src/modpack.json | 22 +++++++++++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 .gitignore create mode 100644 modpacktoolsconfig.toml create mode 100644 mpt create mode 100644 src/modpack.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e767daf --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.mpt +build \ No newline at end of file diff --git a/modpacktoolsconfig.toml b/modpacktoolsconfig.toml new file mode 100644 index 0000000..65ff88e --- /dev/null +++ b/modpacktoolsconfig.toml @@ -0,0 +1,14 @@ +[Locations] + #The location of the twitch manifest file (will be replaced with addonscript in later versions) + manifestFile = "src/twitch/manifest.json" + #The location of the source + src = "src" + #The location used to store temporary files + tempDir = ".mpt" +[Local] + selectedVersion = -1 +[Downloads] + #The maximum number of threads that will be used for downloads + maxThreads = 5 + #The timeout of http requests in ms + httpTimeout = 2147483647 \ No newline at end of file diff --git a/mpt b/mpt new file mode 100644 index 0000000..329213c --- /dev/null +++ b/mpt @@ -0,0 +1,43 @@ +#!/bin/sh +cd "$(dirname "$0")" || exit +case $1 in +install) + if ! [ -d "$HOME/.mpt" ]; + then mkdir $HOME/.mpt + fi + if ! [ -f "$HOME/.mpt/mpt.jar" ]; + then + dl=$(curl https://data.tilera.xyz/api/mpt.php/latest) + echo Downloading $dl ... + curl $dl --output $HOME/.mpt/mpt.jar + fi + ;; +update) + dl=$(curl https://data.tilera.xyz/api/mpt.php/latest) + echo Downloading $dl ... + if [ -f ".mpt/mpt.jar" ] + then + curl $dl --output .mpt/mpt.jar + else + curl $dl --output $HOME/.mpt/mpt.jar + fi + echo Updating Script + curl https://data.tilera.xyz/api/mpt.php/script > mpt + ;; +*) + if ! [ -d ".mpt" ]; + then mkdir .mpt + fi + if [ -f ".mpt/mpt.jar" ]; + then jar=.mpt/mpt.jar + elif [ -f "$HOME.mpt/mpt.jar" ]; + then jar=$HOME.mpt/mpt.jar + else + dl=$(curl https://data.tilera.xyz/api/mpt.php/latest) + echo Downloading $dl ... + curl $dl --output .mpt/mpt.jar + jar=.mpt/mpt.jar + fi + java -jar $jar $* + ;; +esac \ No newline at end of file diff --git a/src/modpack.json b/src/modpack.json new file mode 100644 index 0000000..09ca32f --- /dev/null +++ b/src/modpack.json @@ -0,0 +1,22 @@ +{ + "type": "modpack", + "versions": [ + { + "versionid": -1, + "files": [ + { + "id": "overrides", + "installer": "internal.overrides", + "link": "file://overrides", + "options": [ + "client", + "server", + "required", + "included" + ] + } + ] + } + ], + "asversion": 1 +} \ No newline at end of file