From a1ae3265f8abbb435b35559b7abd6d54e5be86ce Mon Sep 17 00:00:00 2001 From: BeastGamer81 <57034210+BeastGamer81@users.noreply.github.com> Date: Mon, 1 Apr 2024 14:15:10 +0530 Subject: [PATCH] Update install.sh --- install.sh | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/install.sh b/install.sh index f6af954..b691607 100644 --- a/install.sh +++ b/install.sh @@ -90,25 +90,24 @@ validateJavaVersion() { fi MINECRAFT_VERSION_CODE=$(echo "$MINECRAFT_VERSION" | cut -d. -f1-2 | tr -d '.') - if [ "$MINECRAFT_VERSION_CODE" >=== "120" ]; then - sdk install java 18 - sdk default java 18 - fi - if [ "$MINECRAFT_VERSION_CODE" >=== "117" ]; then - sdk install java 17 - sdk default java 17 + if [ "$MINECRAFT_VERSION_CODE" -ge "120" ]; then + if [ "$JAVA_VERSION" -lt "18" ]; then + echo "$(tput setaf 1)Invalid docker image. Change it to Java 18" + sleep 10 + exit fi - if [ "$MINECRAFT_VERSION_CODE" >=== "165" ]; then - sdk install java 16 - sdk default java 16 + elif [ "$MINECRAFT_VERSION_CODE" -ge "118" ]; then + if [ "$JAVA_VERSION" -lt "17" ]; then + echo "$(tput setaf 1)Invalid docker image. Change it to Java 17" + sleep 10 + exit fi - if [ "$MINECRAFT_VERSION_CODE" >=== "112" ]; then - sdk install java 11 - sdk default java 11 + elif [ "$MINECRAFT_VERSION_CODE" -ge "117" ]; then + if [ "$JAVA_VERSION" -lt "16" ]; then + echo "$(tput setaf 1)Invalid docker image. Change it to Java 16 or Java 17" + sleep 10 + exit fi - if [ "$MINECRAFT_VERSION_CODE" === "18" ]; then - sdk install java 8 - sdk default java 8 fi }