From 90d721763d070894d4a6d101c646897e078fac3e Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 21 Jan 2019 21:07:38 -0600 Subject: [PATCH] Add support for CurseForge modpacks with ServerStartLinux.sh entry Add CurseForge info in README Fixes #284 --- minecraft-server/README.md | 30 +++++++++++++++++++----------- minecraft-server/start-deployFTB | 12 ++++++++---- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/minecraft-server/README.md b/minecraft-server/README.md index b6d7b0fe..1d21d115 100644 --- a/minecraft-server/README.md +++ b/minecraft-server/README.md @@ -330,31 +330,39 @@ This works well if you want to have a common set of plugins in a separate location, but still have multiple worlds with different server requirements in either persistent volumes or a downloadable archive. -## Running a Server with a Feed-The-Beast (FTB) modpack +## Running a Server with a Feed-The-Beast (FTB) / CurseForge modpack -Enable this server mode by adding a `-e TYPE=FTB` to your command-line, +Enable this server mode by adding a `-e TYPE=FTB` or `-e TYPE=CURSEFORGE` to your command-line, but note the following additional steps needed... -You need to specify a modpack to run, using the `FTB_SERVER_MOD` environment -variable. An FTB server modpack is available together with its respective -client modpack on https://www.feed-the-beast.com under "Additional Files." -Because of the interactive delayed download mechanism on that web site, you -must manually download the server modpack. Copy the modpack to the `/data` +You need to specify a modpack to run, using the `FTB_SERVER_MOD` or `CF_SERVER_MOD` environment +variable. An FTB/CurseForge server modpack is available together with its respective +client modpack on https://www.feed-the-beast.com under "Additional Files." Similar you can +locate the modpacks for CurseForge at https://minecraft.curseforge.com/modpacks . + +There are a couple of options for obtaining an FTB/CurseForge modpack. +One options is that you can pre-download the **server** modpack and copy the modpack to the `/data` directory (see "Attaching data directory to host filesystem”). Now you can add a `-e FTB_SERVER_MOD=name_of_modpack.zip` to your command-line. - $ docker run -d -v /path/on/host:/data -e TYPE=FTB \ + docker run -d -v /path/on/host:/data -e TYPE=FTB \ -e FTB_SERVER_MOD=FTBPresentsSkyfactory3Server_3.0.6.zip \ -p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server -Instead of explicitly downloading a modpack from the Feed the Beast site, you -can you set `FTB_SERVER_MOD` to the **server** URL of a modpack, such as +Instead of pre-downloading a modpack from the FTB/CurseForge site, you +can you set `FTB_SERVER_MOD` (or `CF_SERVER_MOD`) to the **server** URL of a modpack, such as - $ docker run ... \ + docker run ... \ -e TYPE=FTB \ -e FTB_SERVER_MOD=https://www.feed-the-beast.com/projects/ftb-infinity-lite-1-10/files/2402889 +or for a CurseForce modpack: + + docker run ... \ + -e TYPE=CURSEFORGE \ + -e CF_SERVER_MOD=https://minecraft.curseforge.com/projects/enigmatica2expert/files/2663153/download + ### Using the /data volume You must use a persistent `/data` mount for this type of server. diff --git a/minecraft-server/start-deployFTB b/minecraft-server/start-deployFTB index 76295192..c8a0c4e6 100755 --- a/minecraft-server/start-deployFTB +++ b/minecraft-server/start-deployFTB @@ -6,7 +6,9 @@ export FTB_BASE_DIR=/data/FeedTheBeast legacyJavaFixerUrl=http://ftb.cursecdn.com/FTB2/maven/net/minecraftforge/lex/legacyjavafixer/1.0/legacyjavafixer-1.0.jar export TYPE=FEED-THE-BEAST -echo "Looking for Feed-The-Beast server modpack." +FTB_SERVER_MOD=${FTB_SERVER_MOD:-$CF_SERVER_MOD} + +echo "Looking for Feed-The-Beast / CurseForge server modpack." if [[ -z $FTB_SERVER_MOD ]]; then echo "Environment variable FTB_SERVER_MOD not set." echo "Set FTB_SERVER_MOD to the file name of the FTB server modpack." @@ -14,8 +16,10 @@ if [[ -z $FTB_SERVER_MOD ]]; then exit 2 fi +entryScriptExpr="-name ServerStart.sh -o -name ServerStartLinux.sh -o -name LaunchServer.sh" + if [[ -d ${FTB_BASE_DIR} ]]; then - startScriptCount=$(find ${FTB_BASE_DIR} -name ServerStart.sh |wc -l) + startScriptCount=$(find ${FTB_BASE_DIR} $entryScriptExpr |wc -l) if [[ $startScriptCount > 1 ]]; then echo "Conflicting FTB/CurseForge packages have been installed. Please cleanup ${FTB_BASE_DIR}" exit 2 @@ -68,12 +72,12 @@ if [[ $startScriptCount = 0 ]]; then unzip -o ${srv_modpack} -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}' fi -if [[ $(find ${FTB_BASE_DIR} -name ServerStart.sh -o -name LaunchServer.sh |wc -l) = 0 ]]; then +if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr |wc -l) = 0 ]]; then echo "Please make sure you are using the server version of the FTB modpack!" exit 2 fi -export FTB_SERVER_START=$(find ${FTB_BASE_DIR} -name ServerStart.sh -o -name LaunchServer.sh) +export FTB_SERVER_START=$(find ${FTB_BASE_DIR} $entryScriptExpr) if [[ $(echo ${FTB_SERVER_START} | wc -w) != 1 ]]; then echo "Please make sure you are using the server version of the FTB modpack!" exit 2