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