#!/bin/bash

# TiedUp! Build Helper Script
# Forces the use of Java 17 for Gradle builds (required for Forge 1.20.1)
#
# Usage:
#   ./build-with-java17.sh           # Run default build
#   ./build-with-java17.sh clean     # Clean build
#   ./build-with-java17.sh runClient # Run client

# Set Java 17 as JAVA_HOME for this script
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk

# Print Java version for confirmation
echo "Using Java version:"
$JAVA_HOME/bin/java -version

echo ""
echo "Running Gradle with Java 17..."
echo "Command: ./gradlew $@"
echo ""

# Run Gradle with all passed arguments
./gradlew "$@"
