From f5f20f3563119063dfc6de399c497582c09f07c7 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 7 Jan 2018 17:18:45 -0600 Subject: [PATCH] [mc] For FTB add legacy java fixer option --- .editorconfig | 5 +++++ minecraft-server/.editorconfig | 2 ++ minecraft-server/README.md | 10 ++++++++++ minecraft-server/start-deployFTB | 23 +++++++++++------------ minecraft-server/start-utils | 28 ++++++++++++++++++++++++++++ 5 files changed, 56 insertions(+), 12 deletions(-) create mode 100644 .editorconfig create mode 100644 minecraft-server/.editorconfig create mode 100644 minecraft-server/start-utils diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..bec00c2e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,5 @@ +root = true + +[*] +end_of_line = lf +indent_style = space diff --git a/minecraft-server/.editorconfig b/minecraft-server/.editorconfig new file mode 100644 index 00000000..6583457a --- /dev/null +++ b/minecraft-server/.editorconfig @@ -0,0 +1,2 @@ +[start-*] +indent_size = 2 \ No newline at end of file diff --git a/minecraft-server/README.md b/minecraft-server/README.md index 8a5032d9..bfcaafcf 100644 --- a/minecraft-server/README.md +++ b/minecraft-server/README.md @@ -398,6 +398,16 @@ example: Note: The FTB server start script will also override other options, like `MOTD`. +### Fixing "unable to launch forgemodloader" + +If your server's modpack fails to load with an error [like this](https://support.feed-the-beast.com/t/cant-start-crashlanding-server-unable-to-launch-forgemodloader/6028/2): + + unable to launch forgemodloader + +then you apply a workaround by adding this to the run invocation: + + -e FTB_LEGACYJAVAFIXER=true + ## Running a SpongeVanilla server Enable SpongeVanilla server mode by adding a `-e TYPE=SPONGEVANILLA` to your command-line. diff --git a/minecraft-server/start-deployFTB b/minecraft-server/start-deployFTB index 6fbd53c6..1ce4cbd6 100755 --- a/minecraft-server/start-deployFTB +++ b/minecraft-server/start-deployFTB @@ -1,17 +1,11 @@ #!/bin/bash +. /start-utils + +legacyJavaFixerUrl=http://ftb.cursecdn.com/FTB2/maven/net/minecraftforge/lex/legacyjavafixer/1.0/legacyjavafixer-1.0.jar +legacyJavaFixerPath=/data/FeedTheBeast/mods/legacyjavafixer.jar export TYPE=FEED-THE-BEAST -function isURL { - local value=$1 - - if [[ ${value:0:8} == "https://" || ${value:0:7} = "http://" ]]; then - return 0 - else - return 1 - fi -} - echo "Looking for Feed-The-Beast server modpack." if [[ -z $FTB_SERVER_MOD ]]; then echo "Environment variable FTB_SERVER_MOD not set." @@ -23,7 +17,7 @@ srv_modpack=${FTB_SERVER_MOD} if isURL ${srv_modpack}; then case $srv_modpack in https://www.feed-the-beast.com/*/download) - break;; + ;; https://www.feed-the-beast.com/*) srv_modpack=${srv_modpack}/download;; esac @@ -57,12 +51,17 @@ fi if [ ! -d ${FTB_DIR} ]; then echo "Unpacking FTB server modpack ${srv_modpack} ..." mkdir -p ${FTB_DIR} - unzip -o ${srv_modpack} -d ${FTB_DIR} + unzip -o ${srv_modpack} -d ${FTB_DIR} | awk '{printf "."} END {print ""}' cp -f /data/eula.txt ${FTB_DIR}/eula.txt fi export FTB_SERVER_START=${FTB_DIR}/ServerStart.sh chmod a+x ${FTB_SERVER_START} sed -i "s/-jar/-Dfml.queryResult=confirm -jar/" ${FTB_SERVER_START} +if isTrue ${FTB_LEGACYJAVAFIXER} && [ ! -e ${legacyJavaFixerPath} ]; then + echo "Installing legacy java fixer to ${legacyJavaFixerPath}" + curl -sSL -o ${legacyJavaFixerPath} ${legacyJavaFixerUrl} +fi + # Continue to Final Setup exec /start-finalSetup01World $@ diff --git a/minecraft-server/start-utils b/minecraft-server/start-utils new file mode 100644 index 00000000..78de1c76 --- /dev/null +++ b/minecraft-server/start-utils @@ -0,0 +1,28 @@ +#!/bin/bash + +function isURL { + local value=$1 + + if [[ ${value:0:8} == "https://" || ${value:0:7} = "http://" ]]; then + return 0 + else + return 1 + fi +} + +function isTrue { + local value=${1,,} + + result= + + case ${value} in + true|on) + result=0 + ;; + *) + result=1 + ;; + esac + + return ${result} +} \ No newline at end of file