From 8dbbdd8cd25660feb2596e332ea8c1a3d674c57b Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 13 Apr 2020 18:29:44 -0500 Subject: [PATCH] Added logic to skip --noconsole on newer versions Fixes #452 --- start-minecraftFinalSetup | 2 +- start-utils | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index c092e1d5..76c03fa3 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -80,7 +80,7 @@ esac EXTRA_ARGS="" # Optional disable console -if [[ ${CONSOLE} = false || ${CONSOLE} = FALSE ]]; then +if versionLessThan 1.14 && [[ ${CONSOLE,,} = false ]]; then EXTRA_ARGS+="--noconsole" fi diff --git a/start-utils b/start-utils index 1bbccd71..670344ad 100644 --- a/start-utils +++ b/start-utils @@ -63,3 +63,18 @@ function normalizeMemSize { val=${1:0: -1} echo $(( val * scale )) } + +function versionLessThan { + local activeParts + IFS=. read -ra activeParts <<< "${VANILLA_VERSION}" + + local givenParts + IFS=. read -ra givenParts <<< "$1" + + if (( activeParts[0] < givenParts[0] )) || \ + (( activeParts[0] == givenParts[0] && activeParts[1] < givenParts[1] )); then + return 0 + else + return 1 + fi +} \ No newline at end of file