#!/usr/bin/env bash # Mechanix + Fabric Setup for Mac / Linux # Usage: bash mechanix-setup.sh BASE="https://citrohub.com" VID="fabric-loader-0.15.11-1.20.4" # Detect OS and set .minecraft path if [[ "$OSTYPE" == "darwin"* ]]; then MCDIR="$HOME/Library/Application Support/minecraft" else MCDIR="$HOME/.minecraft" fi echo "" echo "=== Mechanix Installer for Mac / Linux ===" echo "Minecraft dir: $MCDIR" echo "" # 1 — Create version profile directory VERDIR="$MCDIR/versions/$VID" mkdir -p "$VERDIR" # 2 — Download Fabric loader profile JSON echo "[1/4] Downloading Fabric loader profile..." curl -fsSL "$BASE/fabric-loader-profile.json" -o "$VERDIR/$VID.json" # 3 — Create mods folder and download mods echo "[2/4] Creating mods folder..." mkdir -p "$MCDIR/mods" echo "[3/4] Downloading Fabric API + Mechanix..." curl -fsSL "$BASE/fabric-api.jar" -o "$MCDIR/mods/fabric-api-0.96.0+1.20.4.jar" curl -fsSL "$BASE/mechanix.jar" -o "$MCDIR/mods/mechanix-1.0.0.jar" # 4 — Add Fabric profile to launcher_profiles.json echo "[4/4] Registering Fabric profile in Minecraft Launcher..." PROFILES="$MCDIR/launcher_profiles.json" if [ -f "$PROFILES" ]; then NOW=$(date -u +"%Y-%m-%dT%H:%M:%S.000Z") python3 - <