diff --git a/compile.bat b/compile.bat index 4a37e9f..a3e3dfe 100644 --- a/compile.bat +++ b/compile.bat @@ -18,30 +18,28 @@ set "GRADLE_HOME=%LOCAL_GRADLE_DIR%\gradle-%GRADLE_VERSION%" set "GRADLE_BIN=%GRADLE_HOME%\bin\gradle.bat" set "GIT_ONLY=0" -REM Values below are read from gradle.properties. Do not hardcode release versions here. set "MOD_VERSION=" set "MINECRAFT_VERSION=" -set "MAVEN_GROUP=" set "ARCHIVES_BASE_NAME=" if not exist "%GRADLE_PROPERTIES%" ( echo [ERROR] gradle.properties tidak ditemukan. - goto :failed + call :finish 1 + exit /b 1 ) for /f "usebackq tokens=1,* delims==" %%A in ("%GRADLE_PROPERTIES%") do ( if "%%A"=="mod_version" set "MOD_VERSION=%%B" if "%%A"=="minecraft_version" set "MINECRAFT_VERSION=%%B" - if "%%A"=="maven_group" set "MAVEN_GROUP=%%B" if "%%A"=="archives_base_name" set "ARCHIVES_BASE_NAME=%%B" ) if not defined MOD_VERSION ( echo [ERROR] mod_version tidak ditemukan atau kosong di gradle.properties. - goto :failed + call :finish 1 + exit /b 1 ) if not defined MINECRAFT_VERSION set "MINECRAFT_VERSION=26.2" -if not defined MAVEN_GROUP set "MAVEN_GROUP=me.xjqsh" if not defined ARCHIVES_BASE_NAME set "ARCHIVES_BASE_NAME=lrarmor" set "JAR_PATH=%CD%\build\libs\%ARCHIVES_BASE_NAME%-%MOD_VERSION%.jar" @@ -49,8 +47,8 @@ set "SOURCES_JAR_PATH=%CD%\build\libs\%ARCHIVES_BASE_NAME%-%MOD_VERSION%-sources call :banner -REM If the exact release JAR already exists, offer rebuild or Git-only. -REM --build-only always rebuilds and never enters Git integration. +REM Jika JAR versi persis sudah ada, user boleh compile ulang atau Git-only. +REM --build-only selalu melakukan build dan tidak menjalankan Git integration. if "%BUILD_ONLY%"=="0" if exist "%JAR_PATH%" ( echo. echo [INFO] JAR untuk v%MOD_VERSION% sudah tersedia: @@ -59,104 +57,100 @@ if "%BUILD_ONLY%"=="0" if exist "%JAR_PATH%" ( choice /C CG /N /M "[C] Compile ulang / [G] Git saja: " if errorlevel 2 ( set "GIT_ONLY=1" - goto :git_integration + goto git_integration ) ) -REM If JAR is absent, empty build/libs, or version differs from gradle.properties, -REM compilation proceeds automatically. where java.exe >nul 2>&1 if errorlevel 1 ( echo [ERROR] Java tidak ditemukan di PATH. - echo Install JDK 25, buka terminal baru, lalu jalankan script lagi. - goto :failed + echo [INFO] Install JDK 25, buka terminal baru, lalu jalankan script lagi. + call :finish 1 + exit /b 1 ) -for /f "delims=" %%J in ('where java.exe 2^>nul') do ( - set "JAVA_PATH=%%J" - goto :java_path_found -) - -:java_path_found +set "JAVA_PATH=" +for /f "delims=" %%J in ('where java.exe 2^>nul') do if not defined JAVA_PATH set "JAVA_PATH=%%J" echo [INFO] Java executable: %JAVA_PATH% set "JAVA_VERSION=" -for /f "tokens=2" %%V in ('java --version 2^>^&1 ^| findstr /R /C:"^openjdk " /C:"^java "') do ( - if not defined JAVA_VERSION set "JAVA_VERSION=%%V" -) - +for /f "tokens=2" %%V in ('java --version 2^>^&1 ^| findstr /R /C:"^openjdk " /C:"^java "') do if not defined JAVA_VERSION set "JAVA_VERSION=%%V" if not defined JAVA_VERSION ( echo [ERROR] Tidak dapat membaca versi Java. - goto :failed + call :finish 1 + exit /b 1 ) - for /f "tokens=1 delims=." %%M in ("%JAVA_VERSION%") do set "JAVA_MAJOR=%%M" - if not "%JAVA_MAJOR%"=="25" ( - echo [ERROR] Java 25 diperlukan. - echo [INFO] Java yang terdeteksi: %JAVA_VERSION% - goto :failed + echo [ERROR] Java 25 diperlukan. Terdeteksi: %JAVA_VERSION% + call :finish 1 + exit /b 1 ) - echo [OK] Java 25 terdeteksi. -if exist "%GRADLE_BIN%" goto :gradle_ready +if not exist "%GRADLE_BIN%" ( + echo [INFO] Gradle %GRADLE_VERSION% belum tersedia. + echo [INFO] Mengunduh distribusi resmi... + if not exist "%LOCAL_GRADLE_DIR%" mkdir "%LOCAL_GRADLE_DIR%" + set "GRADLE_ZIP=%LOCAL_GRADLE_DIR%\gradle-%GRADLE_VERSION%-bin.zip" + set "GRADLE_URL=https://services.gradle.org/distributions/gradle-%GRADLE_VERSION%-bin.zip" -echo [INFO] Gradle %GRADLE_VERSION% belum tersedia. -echo [INFO] Mengunduh distribusi resmi... + where curl.exe >nul 2>&1 + if errorlevel 1 ( + echo [ERROR] curl.exe tidak ditemukan. + call :finish 1 + exit /b 1 + ) -if not exist "%LOCAL_GRADLE_DIR%" mkdir "%LOCAL_GRADLE_DIR%" + curl.exe -L --fail --progress-bar "!GRADLE_URL!" -o "!GRADLE_ZIP!" + if errorlevel 1 ( + echo [ERROR] Gagal mengunduh Gradle %GRADLE_VERSION%. + call :finish 1 + exit /b 1 + ) -set "GRADLE_ZIP=%LOCAL_GRADLE_DIR%\gradle-%GRADLE_VERSION%-bin.zip" -set "GRADLE_URL=https://services.gradle.org/distributions/gradle-%GRADLE_VERSION%-bin.zip" - -where curl.exe >nul 2>&1 -if errorlevel 1 ( - echo [ERROR] curl.exe tidak ditemukan. - goto :failed + echo [INFO] Mengekstrak Gradle %GRADLE_VERSION%... + powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Expand-Archive -LiteralPath '!GRADLE_ZIP!' -DestinationPath '%LOCAL_GRADLE_DIR%' -Force" + if errorlevel 1 ( + echo [ERROR] Gagal mengekstrak Gradle. + call :finish 1 + exit /b 1 + ) + del /q "!GRADLE_ZIP!" >nul 2>&1 ) -curl.exe -L --fail --progress-bar "%GRADLE_URL%" -o "%GRADLE_ZIP%" -if errorlevel 1 ( - echo [ERROR] Gagal mengunduh Gradle %GRADLE_VERSION%. - goto :failed -) - -echo [INFO] Mengekstrak Gradle %GRADLE_VERSION%... -powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Expand-Archive -LiteralPath '%GRADLE_ZIP%' -DestinationPath '%LOCAL_GRADLE_DIR%' -Force" -if errorlevel 1 ( - echo [ERROR] Gagal mengekstrak Gradle. - goto :failed -) - -del /q "%GRADLE_ZIP%" >nul 2>&1 - if not exist "%GRADLE_BIN%" ( - echo [ERROR] Gradle berhasil diekstrak tetapi executable tidak ditemukan. - goto :failed + echo [ERROR] Gradle executable tidak ditemukan: %GRADLE_BIN% + call :finish 1 + exit /b 1 ) -:gradle_ready echo [OK] Gradle %GRADLE_VERSION% tersedia. echo [INFO] Menjalankan clean build LesRaisinsArmor v%MOD_VERSION%... echo. - call "%GRADLE_BIN%" clean build --no-daemon -if errorlevel 1 goto :build_failed +if errorlevel 1 ( + echo. + echo ============================================ + echo BUILD FAILED + echo ============================================ + echo [ERROR] Build gagal. Git Integration tidak dijalankan. + if "%BUILD_ONLY%"=="1" exit /b 1 + call :finish 1 + exit /b 1 +) echo. echo ============================================ echo BUILD SUCCESS echo ============================================ - if exist "%JAR_PATH%" ( echo JAR: echo %JAR_PATH% ) else ( - echo [WARN] Build berhasil, tetapi JAR utama tidak ditemukan pada: + echo [WARN] Build berhasil, tetapi JAR utama tidak ditemukan: echo %JAR_PATH% ) - if exist "%SOURCES_JAR_PATH%" ( echo SOURCES JAR: echo %SOURCES_JAR_PATH% @@ -166,8 +160,14 @@ if "%BUILD_ONLY%"=="1" exit /b 0 echo. choice /C YN /N /M "Commit dan push perubahan ke Git? [Y/N]: " -if errorlevel 2 goto :skip_git -if errorlevel 1 goto :git_integration +if errorlevel 2 ( + echo. + echo [INFO] Git commit/push dilewati. + call :finish 0 + exit /b 0 +) + +goto git_integration :git_integration echo. @@ -179,35 +179,37 @@ if "%GIT_ONLY%"=="1" echo [INFO] Mode Git-only: build dilewati karena JAR v%MOD_ where git.exe >nul 2>&1 if errorlevel 1 ( echo [ERROR] Git tidak ditemukan di PATH. - goto :git_failed + call :git_fail_message + call :finish 2 + exit /b 2 ) git rev-parse --is-inside-work-tree >nul 2>&1 if errorlevel 1 ( echo [ERROR] Folder ini belum menjadi Git repository. - echo. - echo Jalankan terlebih dahulu: - echo git init - echo git branch -M main - echo git remote add origin ^ - echo. - goto :git_failed + call :git_fail_message + call :finish 2 + exit /b 2 ) set "CURRENT_BRANCH=" for /f "delims=" %%B in ('git branch --show-current') do set "CURRENT_BRANCH=%%B" if not defined CURRENT_BRANCH ( echo [ERROR] Tidak dapat menentukan branch Git aktif. - goto :git_failed + call :git_fail_message + call :finish 2 + exit /b 2 ) git remote get-url origin >nul 2>&1 if errorlevel 1 ( echo [ERROR] Remote Git 'origin' belum dikonfigurasi. - echo [INFO] Commit lokal tetap aman. - goto :git_failed + call :git_fail_message + call :finish 2 + exit /b 2 ) +set "ORIGIN_URL=" for /f "delims=" %%R in ('git remote get-url origin') do set "ORIGIN_URL=%%R" echo [INFO] Branch : !CURRENT_BRANCH! echo [INFO] Origin : !ORIGIN_URL! @@ -221,7 +223,6 @@ if defined HAS_CHANGES ( echo Perubahan ditemukan: git status --short echo. - call :suggest_commit_message echo [SUGGEST] Commit message: !SUGGESTED_COMMIT! echo [INFO] Tekan Enter untuk memakai saran tersebut, atau ketik pesan sendiri. @@ -234,14 +235,18 @@ if defined HAS_CHANGES ( git add -A if errorlevel 1 ( echo [ERROR] git add gagal. - goto :git_failed + call :git_fail_message + call :finish 2 + exit /b 2 ) echo [INFO] Membuat commit... git commit -m "!COMMIT_MESSAGE!" if errorlevel 1 ( echo [ERROR] git commit gagal. - goto :git_failed + call :git_fail_message + call :finish 2 + exit /b 2 ) ) else ( echo [INFO] Tidak ada perubahan source yang perlu di-commit. @@ -249,11 +254,17 @@ if defined HAS_CHANGES ( ) call :push_branch_with_retry -if errorlevel 1 goto :git_failed +if errorlevel 1 ( + call :git_fail_message + call :finish 2 + exit /b 2 +) echo. echo [SUCCESS] Push ke Git berhasil. -goto :success +REM Jangan GOTO label akhir; selesai langsung agar tidak terkena masalah label parsing. +call :finish 0 +exit /b 0 :banner echo ============================================ @@ -271,10 +282,9 @@ set "HAS_DOC_CHANGE=" for /f "delims=" %%F in ('git status --porcelain') do ( set "LINE=%%F" echo !LINE! | findstr /I /C:"src/" >nul && set "HAS_SRC_CHANGE=1" - echo !LINE! | findstr /I /C:"compile.bat" /C:"compile.sh" /C:"run-client.bat" /C:"run-server.bat" >nul && set "HAS_SCRIPT_CHANGE=1" + echo !LINE! | findstr /I /C:"compile.bat" /C:"compile.sh" /C:"release.bat" /C:"run-client.bat" /C:"run-server.bat" >nul && set "HAS_SCRIPT_CHANGE=1" echo !LINE! | findstr /I /C:"README" /C:"LICENSE" /C:"PORT-CHANGELOG" >nul && set "HAS_DOC_CHANGE=1" ) - if defined HAS_SRC_CHANGE set "SUGGESTED_COMMIT=Port LesRaisinsArmor v%MOD_VERSION%" if not defined HAS_SRC_CHANGE if defined HAS_SCRIPT_CHANGE set "SUGGESTED_COMMIT=Update build scripts for v%MOD_VERSION%" if not defined HAS_SRC_CHANGE if not defined HAS_SCRIPT_CHANGE if defined HAS_DOC_CHANGE set "SUGGESTED_COMMIT=Update documentation for v%MOD_VERSION%" @@ -282,10 +292,8 @@ exit /b 0 :push_branch_with_retry set /a PUSH_ROUND=1 - :push_round_start set /a PUSH_ATTEMPT=1 - :push_attempt_start echo. echo [INFO] Push attempt !PUSH_ATTEMPT!/3 ^(round !PUSH_ROUND!^) ke origin/!CURRENT_BRANCH!... @@ -297,7 +305,7 @@ if !PUSH_ATTEMPT! LSS 3 ( set /a PUSH_ATTEMPT+=1 echo [INFO] Mencoba lagi dalam 2 detik... timeout /t 2 /nobreak >nul - goto :push_attempt_start + goto push_attempt_start ) echo. @@ -308,56 +316,32 @@ echo [INFO] Commit lokal tetap aman dan tidak perlu compile ulang. choice /C YN /N /M "Coba push 3x lagi? [Y/N]: " if errorlevel 2 exit /b 1 set /a PUSH_ROUND+=1 -goto :push_round_start +goto push_round_start -:skip_git -echo. -echo [INFO] Git commit/push dilewati. -goto :success - -:success -echo. -echo ============================================ -echo LesRaisinsArmor v%MOD_VERSION% selesai. -echo ============================================ -echo. -pause -exit /b 0 - -:build_failed -echo. -echo ============================================ -echo BUILD FAILED -echo ============================================ -echo. -echo [ERROR] Build gagal. -echo [INFO] Git Integration tidak dijalankan. -echo. -if "%BUILD_ONLY%"=="1" exit /b 1 -pause -exit /b 1 - -:git_failed +:git_fail_message echo. echo ============================================ echo GIT FAILED echo ============================================ -echo. if "%GIT_ONLY%"=="1" ( echo [INFO] Build tidak dijalankan; JAR v%MOD_VERSION% yang sudah ada tetap aman. ) else ( - echo [INFO] Build LesRaisinsArmor tetap berhasil jika tahap build sebelumnya sukses. + echo [INFO] Build tetap aman jika tahap build sebelumnya sukses. ) echo [INFO] Commit lokal tetap tersimpan. echo [INFO] Jalankan compile.bat lagi; jika JAR versi sama terdeteksi, pilih G untuk Git-only. -echo. -pause -exit /b 2 +exit /b 0 -:failed +:finish +set "FINISH_CODE=%~1" echo. -echo Proses gagal. +echo ============================================ +if "%FINISH_CODE%"=="0" ( + echo LesRaisinsArmor v%MOD_VERSION% selesai. +) else ( + echo LesRaisinsArmor v%MOD_VERSION% selesai dengan error %FINISH_CODE%. +) +echo ============================================ echo. -if "%BUILD_ONLY%"=="1" exit /b 1 -pause -exit /b 1 +if "%BUILD_ONLY%"=="0" pause +exit /b 0 diff --git a/compile.sh b/compile.sh index 951770a..99bd0ad 100644 --- a/compile.sh +++ b/compile.sh @@ -1,30 +1,123 @@ #!/usr/bin/env bash -set -euo pipefail +set -u cd "$(dirname "$0")" -GRADLE_VERSION=9.5.1 + +BUILD_ONLY=0 +[[ "${1:-}" == "--build-only" ]] && BUILD_ONLY=1 + +GRADLE_PROPERTIES="$PWD/gradle.properties" +GRADLE_VERSION="9.5.1" LOCAL_GRADLE_DIR="$PWD/.gradle-local" GRADLE_HOME="$LOCAL_GRADLE_DIR/gradle-$GRADLE_VERSION" GRADLE_BIN="$GRADLE_HOME/bin/gradle" -MOD_VERSION="$(sed -n 's/^mod_version=//p' gradle.properties | head -n1)" -MINECRAFT_VERSION="$(sed -n 's/^minecraft_version=//p' gradle.properties | head -n1)" -MOD_VERSION="${MOD_VERSION:-unknown}" + +[[ -f "$GRADLE_PROPERTIES" ]] || { echo "[ERROR] gradle.properties tidak ditemukan."; exit 1; } + +prop() { sed -n "s/^$1=//p" "$GRADLE_PROPERTIES" | head -n1; } +MOD_VERSION="$(prop mod_version)" +MINECRAFT_VERSION="$(prop minecraft_version)" +ARCHIVES_BASE_NAME="$(prop archives_base_name)" MINECRAFT_VERSION="${MINECRAFT_VERSION:-26.2}" +ARCHIVES_BASE_NAME="${ARCHIVES_BASE_NAME:-lrarmor}" + +[[ -n "$MOD_VERSION" ]] || { echo "[ERROR] mod_version tidak ditemukan atau kosong di gradle.properties."; exit 1; } + +JAR_PATH="$PWD/build/libs/${ARCHIVES_BASE_NAME}-${MOD_VERSION}.jar" +SOURCES_JAR_PATH="$PWD/build/libs/${ARCHIVES_BASE_NAME}-${MOD_VERSION}-sources.jar" + echo "============================================" echo " LesRaisinsArmor - Fabric $MINECRAFT_VERSION Build" echo " Mod Version: $MOD_VERSION" +echo " Archive: $ARCHIVES_BASE_NAME" echo "============================================" -command -v java >/dev/null || { echo "[ERROR] Java tidak ditemukan di PATH."; exit 1; } -JAVA_VERSION="$(java --version 2>&1 | head -n1 | awk '{print $2}')" -JAVA_MAJOR="${JAVA_VERSION%%.*}" -[[ "$JAVA_MAJOR" == "25" ]] || { echo "[ERROR] Java 25 diperlukan. Terdeteksi: $JAVA_VERSION"; exit 1; } -if [[ ! -x "$GRADLE_BIN" ]]; then - mkdir -p "$LOCAL_GRADLE_DIR" - ZIP="$LOCAL_GRADLE_DIR/gradle-$GRADLE_VERSION-bin.zip" - echo "[INFO] Mengunduh Gradle $GRADLE_VERSION..." - curl -L --fail --progress-bar "https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip" -o "$ZIP" - unzip -q -o "$ZIP" -d "$LOCAL_GRADLE_DIR" - rm -f "$ZIP" + +GIT_ONLY=0 +if [[ $BUILD_ONLY -eq 0 && -f "$JAR_PATH" ]]; then + echo + echo "[INFO] JAR untuk v$MOD_VERSION sudah tersedia:" + echo " $JAR_PATH" + echo + read -r -p "[C] Compile ulang / [G] Git saja: " ans + if [[ "${ans,,}" == "g" ]]; then GIT_ONLY=1; fi fi -"$GRADLE_BIN" clean build --no-daemon -echo "[OK] BUILD SUCCESS" -find build/libs -maxdepth 1 -type f -name 'lrarmor-*.jar' -print + +if [[ $GIT_ONLY -eq 0 ]]; then + command -v java >/dev/null 2>&1 || { echo "[ERROR] Java tidak ditemukan di PATH."; exit 1; } + JAVA_VERSION="$(java --version 2>&1 | head -n1 | awk '{print $2}')" + JAVA_MAJOR="${JAVA_VERSION%%.*}" + [[ "$JAVA_MAJOR" == "25" ]] || { echo "[ERROR] Java 25 diperlukan. Terdeteksi: $JAVA_VERSION"; exit 1; } + echo "[OK] Java 25 terdeteksi." + + if [[ ! -x "$GRADLE_BIN" ]]; then + mkdir -p "$LOCAL_GRADLE_DIR" + ZIP="$LOCAL_GRADLE_DIR/gradle-$GRADLE_VERSION-bin.zip" + echo "[INFO] Mengunduh Gradle $GRADLE_VERSION..." + command -v curl >/dev/null 2>&1 || { echo "[ERROR] curl tidak ditemukan."; exit 1; } + command -v unzip >/dev/null 2>&1 || { echo "[ERROR] unzip tidak ditemukan."; exit 1; } + curl -L --fail --progress-bar "https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip" -o "$ZIP" || exit 1 + unzip -q -o "$ZIP" -d "$LOCAL_GRADLE_DIR" || exit 1 + rm -f "$ZIP" + fi + + echo "[INFO] Menjalankan clean build LesRaisinsArmor v$MOD_VERSION..." + "$GRADLE_BIN" clean build --no-daemon || { echo "[ERROR] BUILD FAILED"; exit 1; } + echo + echo "============================================" + echo " BUILD SUCCESS" + echo "============================================" + [[ -f "$JAR_PATH" ]] && echo "JAR: $JAR_PATH" || echo "[WARN] JAR utama tidak ditemukan: $JAR_PATH" + [[ -f "$SOURCES_JAR_PATH" ]] && echo "SOURCES JAR: $SOURCES_JAR_PATH" + + [[ $BUILD_ONLY -eq 1 ]] && exit 0 + + echo + read -r -p "Commit dan push perubahan ke Git? [Y/N]: " ans + [[ "${ans,,}" == "y" ]] || { echo "[INFO] Git commit/push dilewati."; exit 0; } +fi + +command -v git >/dev/null 2>&1 || { echo "[ERROR] Git tidak ditemukan di PATH."; exit 2; } +git rev-parse --is-inside-work-tree >/dev/null 2>&1 || { echo "[ERROR] Folder ini bukan Git repository."; exit 2; } +CURRENT_BRANCH="$(git branch --show-current)" +[[ -n "$CURRENT_BRANCH" ]] || { echo "[ERROR] Tidak dapat menentukan branch Git aktif."; exit 2; } +ORIGIN_URL="$(git remote get-url origin 2>/dev/null)" || { echo "[ERROR] Remote origin belum dikonfigurasi."; exit 2; } + +echo +echo "============================================" +echo " Git Integration" +echo "============================================" +echo "[INFO] Branch : $CURRENT_BRANCH" +echo "[INFO] Origin : $ORIGIN_URL" + +if [[ -n "$(git status --porcelain)" ]]; then + git status --short + SUGGESTED="Update LesRaisinsArmor v$MOD_VERSION" + if git status --porcelain | grep -qi 'src/'; then + SUGGESTED="Port LesRaisinsArmor v$MOD_VERSION" + elif git status --porcelain | grep -Eqi 'compile\.(bat|sh)|release\.bat|run-(client|server)\.(bat|sh)'; then + SUGGESTED="Update build scripts for v$MOD_VERSION" + elif git status --porcelain | grep -Eqi 'README|LICENSE|PORT-CHANGELOG'; then + SUGGESTED="Update documentation for v$MOD_VERSION" + fi + read -r -p "Commit message [$SUGGESTED]: " COMMIT_MESSAGE + COMMIT_MESSAGE="${COMMIT_MESSAGE:-$SUGGESTED}" + git add -A || exit 2 + git commit -m "$COMMIT_MESSAGE" || exit 2 +else + echo "[INFO] Tidak ada perubahan source yang perlu di-commit." +fi + +round=1 +while true; do + for attempt in 1 2 3; do + echo "[INFO] Push attempt $attempt/3 (round $round) ke origin/$CURRENT_BRANCH..." + if git push -u origin "$CURRENT_BRANCH"; then + echo "[SUCCESS] Push ke Git berhasil." + exit 0 + fi + echo "[WARN] Push attempt $attempt/3 gagal." + [[ $attempt -lt 3 ]] && sleep 2 + done + read -r -p "Coba push 3x lagi? [Y/N]: " ans + [[ "${ans,,}" == "y" ]] || exit 2 + round=$((round + 1)) +done diff --git a/release.bat b/release.bat index 42aed44..fd73514 100644 --- a/release.bat +++ b/release.bat @@ -2,176 +2,288 @@ setlocal EnableExtensions EnableDelayedExpansion REM ============================================================ -REM LesRaisinsArmor - Fabric Release Helper (Windows) -REM Version is read exclusively from gradle.properties. +REM LesRaisinsArmor - Gitea Release Script +REM Windows REM ============================================================ cd /d "%~dp0" -set "GRADLE_PROPERTIES=%CD%\gradle.properties" +if not defined GITEA_BASE_URL set "GITEA_BASE_URL=https://git.darto.id" +if not defined GITEA_OWNER set "GITEA_OWNER=dartokloning" +if not defined GITEA_REPO set "GITEA_REPO=LesRaisinsArmor-Fabric" + set "MOD_VERSION=" set "MINECRAFT_VERSION=" set "ARCHIVES_BASE_NAME=" -if not exist "%GRADLE_PROPERTIES%" ( - echo [ERROR] gradle.properties tidak ditemukan. - goto :failed -) - -for /f "usebackq tokens=1,* delims==" %%A in ("%GRADLE_PROPERTIES%") do ( +for /f "usebackq tokens=1,* delims==" %%A in ("gradle.properties") do ( if "%%A"=="mod_version" set "MOD_VERSION=%%B" if "%%A"=="minecraft_version" set "MINECRAFT_VERSION=%%B" if "%%A"=="archives_base_name" set "ARCHIVES_BASE_NAME=%%B" ) if not defined MOD_VERSION ( - echo [ERROR] mod_version tidak ditemukan atau kosong di gradle.properties. - goto :failed + echo [ERROR] mod_version tidak ditemukan di gradle.properties. + exit /b 1 ) if not defined MINECRAFT_VERSION set "MINECRAFT_VERSION=26.2" if not defined ARCHIVES_BASE_NAME set "ARCHIVES_BASE_NAME=lrarmor" -set "JAR_PATH=%CD%\build\libs\%ARCHIVES_BASE_NAME%-%MOD_VERSION%.jar" -set "SOURCES_JAR_PATH=%CD%\build\libs\%ARCHIVES_BASE_NAME%-%MOD_VERSION%-sources.jar" -set "RELEASE_ROOT=%CD%\release" -set "RELEASE_DIR=%RELEASE_ROOT%\%MOD_VERSION%" -set "RELEASE_JAR=%RELEASE_DIR%\%ARCHIVES_BASE_NAME%-%MOD_VERSION%.jar" +set "TAG=v%MOD_VERSION%" +set "JAR_NAME=%ARCHIVES_BASE_NAME%-%MOD_VERSION%.jar" +set "JAR_PATH=%CD%\build\libs\%JAR_NAME%" + +set "PRERELEASE=false" +echo %MOD_VERSION% | findstr /I /C:"alpha" /C:"beta" /C:"rc" >nul && set "PRERELEASE=true" echo ============================================ echo LesRaisinsArmor - Release Helper echo Minecraft : %MINECRAFT_VERSION% echo Version : %MOD_VERSION% -echo Tag : v%MOD_VERSION% +echo Tag : %TAG% +echo Gitea : %GITEA_BASE_URL%/%GITEA_OWNER%/%GITEA_REPO% echo ============================================ echo. -if not exist "%JAR_PATH%" ( - echo [INFO] JAR v%MOD_VERSION% belum ditemukan. - choice /C YN /N /M "Compile sekarang? [Y/N]: " - if errorlevel 2 goto :cancelled - call "%CD%\compile.bat" --build-only - if errorlevel 1 ( - echo [ERROR] Compile gagal. Release dibatalkan. - goto :failed - ) -) - -if not exist "%JAR_PATH%" ( - echo [ERROR] JAR release tetap tidak ditemukan: - echo %JAR_PATH% - goto :failed -) - -if exist "%RELEASE_DIR%" ( - echo [INFO] Folder release v%MOD_VERSION% sudah ada: - echo %RELEASE_DIR% - choice /C YN /N /M "Timpa artifact release versi ini? [Y/N]: " - if errorlevel 2 goto :cancelled - rmdir /S /Q "%RELEASE_DIR%" -) - -mkdir "%RELEASE_DIR%" >nul 2>&1 -copy /Y "%JAR_PATH%" "%RELEASE_JAR%" >nul -if errorlevel 1 goto :failed - -if exist "%SOURCES_JAR_PATH%" copy /Y "%SOURCES_JAR_PATH%" "%RELEASE_DIR%\" >nul -if exist "%CD%\README.md" copy /Y "%CD%\README.md" "%RELEASE_DIR%\README.md" >nul -if exist "%CD%\PORT-CHANGELOG.md" copy /Y "%CD%\PORT-CHANGELOG.md" "%RELEASE_DIR%\PORT-CHANGELOG.md" >nul -if exist "%CD%\LICENSE" copy /Y "%CD%\LICENSE" "%RELEASE_DIR%\LICENSE" >nul - -where certutil.exe >nul 2>&1 -if not errorlevel 1 ( - certutil -hashfile "%RELEASE_JAR%" SHA256 | findstr /V /I "hash CertUtil" > "%RELEASE_DIR%\SHA256SUMS.txt" -) - -echo. -echo [SUCCESS] Artifact release siap: -echo %RELEASE_DIR% -echo. -dir /B "%RELEASE_DIR%" - -echo. -choice /C YN /N /M "Buat dan push Git tag v%MOD_VERSION%? [Y/N]: " -if errorlevel 2 goto :success - -where git.exe >nul 2>&1 +REM Build lebih dulu. compile.bat --build-only tidak masuk Git integration. +echo [INFO] Menjalankan build release... +call "%CD%\compile.bat" --build-only if errorlevel 1 ( - echo [ERROR] Git tidak ditemukan di PATH. Artifact tetap aman. - goto :git_failed + echo [ERROR] Release dibatalkan karena build gagal. + exit /b 1 +) + +if not exist "%JAR_PATH%" ( + echo [ERROR] JAR release tidak ditemukan: + echo %JAR_PATH% + exit /b 1 +) + +where git.exe >nul 2>&1 || ( + echo [ERROR] Git tidak ditemukan di PATH. + exit /b 1 +) +where curl.exe >nul 2>&1 || ( + echo [ERROR] curl.exe tidak ditemukan di PATH. + exit /b 1 ) git rev-parse --is-inside-work-tree >nul 2>&1 if errorlevel 1 ( - echo [ERROR] Folder ini bukan Git repository. Artifact tetap aman. - goto :git_failed + echo [ERROR] Folder ini bukan Git repository. + exit /b 1 ) -set "DIRTY=" -for /f "delims=" %%G in ('git status --porcelain') do set "DIRTY=1" -if defined DIRTY ( - echo [ERROR] Working tree masih memiliki perubahan yang belum di-commit. - echo [INFO] Commit/push dulu dengan compile.bat agar tag menunjuk source release yang benar. - git status --short - goto :git_failed +set "CURRENT_BRANCH=" +for /f "delims=" %%B in ('git branch --show-current') do set "CURRENT_BRANCH=%%B" +if not defined CURRENT_BRANCH ( + echo [ERROR] Tidak dapat menentukan branch Git aktif. + exit /b 1 ) -git rev-parse "v%MOD_VERSION%" >nul 2>&1 -if not errorlevel 1 ( - echo [INFO] Tag v%MOD_VERSION% sudah ada secara lokal; tidak membuat ulang. +git remote get-url origin >nul 2>&1 +if errorlevel 1 ( + echo [ERROR] Remote 'origin' belum dikonfigurasi. + exit /b 1 +) + +echo. +echo ============================================ +echo Git Release Preparation +echo ============================================ + +REM build/, release/, .gradle*, dan run/ semestinya ada di .gitignore. +REM Kalau release/ lama masih untracked, jangan anggap sebagai perubahan source. +set "HAS_SOURCE_CHANGES=" +for /f "delims=" %%G in ('git status --porcelain ^| findstr /V /B /C:"?? release/"') do set "HAS_SOURCE_CHANGES=1" + +if defined HAS_SOURCE_CHANGES ( + echo. + echo Perubahan source belum di-commit: + git status --short | findstr /V /B /C:"?? release/" + echo. + choice /C YN /N /M "Commit dan push perubahan sebelum membuat release? [Y/N]: " + if errorlevel 2 ( + echo [WARN] Release dibatalkan. Source harus bersih agar tag sesuai dengan build. + exit /b 0 + ) + + set "COMMIT_MESSAGE=" + set /p "COMMIT_MESSAGE=Commit message [Prepare LesRaisinsArmor %TAG% release]: " + if not defined COMMIT_MESSAGE set "COMMIT_MESSAGE=Prepare LesRaisinsArmor %TAG% release" + + git add -A -- . ":(exclude)release" + if errorlevel 1 exit /b 2 + + git commit -m "!COMMIT_MESSAGE!" + if errorlevel 1 exit /b 2 +) + +call :push_branch_with_retry +if errorlevel 1 ( + echo [ERROR] Push branch gagal. Release dibatalkan sebelum tagging. + exit /b 2 +) + +set "HEAD_COMMIT=" +for /f "delims=" %%H in ('git rev-parse HEAD') do set "HEAD_COMMIT=%%H" + +set "TAG_COMMIT=" +for /f "delims=" %%T in ('git rev-list -n 1 "%TAG%" 2^>nul') do set "TAG_COMMIT=%%T" + +if defined TAG_COMMIT ( + if /I not "!TAG_COMMIT!"=="!HEAD_COMMIT!" ( + echo [ERROR] Tag %TAG% sudah ada tetapi menunjuk commit lain. + echo Tag : !TAG_COMMIT! + echo HEAD: !HEAD_COMMIT! + echo [INFO] Naikkan mod_version sebelum membuat release baru. + exit /b 2 + ) + echo [INFO] Tag lokal %TAG% sudah ada pada commit saat ini. ) else ( - git tag -a "v%MOD_VERSION%" -m "LesRaisinsArmor v%MOD_VERSION%" - if errorlevel 1 goto :git_failed + echo [INFO] Membuat tag %TAG%... + git tag -a "%TAG%" -m "LesRaisinsArmor %TAG%" + if errorlevel 1 exit /b 2 ) +git ls-remote --exit-code --tags origin "refs/tags/%TAG%" >nul 2>&1 +if errorlevel 1 ( + call :push_tag_with_retry + if errorlevel 1 exit /b 2 +) else ( + echo [INFO] Tag %TAG% sudah ada di origin. +) + +echo. +echo ============================================ +echo Gitea Release +echo ============================================ +choice /C YN /N /M "Buat Release %TAG% dan upload %JAR_NAME%? [Y/N]: " +if errorlevel 2 ( + echo [INFO] Pembuatan Gitea Release dilewati. Tag %TAG% tetap sudah tersimpan. + exit /b 0 +) + +if not defined GITEA_TOKEN ( + echo. + set /p "GITEA_TOKEN=Gitea Personal Access Token: " +) +if not defined GITEA_TOKEN ( + echo [ERROR] Token Gitea kosong. + exit /b 2 +) + +set "API_BASE=%GITEA_BASE_URL%/api/v1/repos/%GITEA_OWNER%/%GITEA_REPO%" +set "RELEASE_JSON=%TEMP%\lrarmor-release-%RANDOM%.json" +set "CREATE_JSON=%TEMP%\lrarmor-create-%RANDOM%.json" +set "ASSET_JSON=%TEMP%\lrarmor-asset-%RANDOM%.json" + +set "HTTP_CODE=" +for /f "delims=" %%H in ('curl.exe -sS -o "!RELEASE_JSON!" -w "%%{http_code}" -H "Authorization: token !GITEA_TOKEN!" "!API_BASE!/releases/tags/%TAG%"') do set "HTTP_CODE=%%H" + +if "!HTTP_CODE!"=="200" ( + echo [INFO] Release %TAG% sudah ada. Akan menggunakan release tersebut. +) else if "!HTTP_CODE!"=="404" ( + >"!CREATE_JSON!" echo { + >>"!CREATE_JSON!" echo "tag_name": "%TAG%", + >>"!CREATE_JSON!" echo "target_commitish": "!CURRENT_BRANCH!", + >>"!CREATE_JSON!" echo "name": "LesRaisinsArmor %TAG%", + >>"!CREATE_JSON!" echo "body": "Unofficial private Fabric port for Minecraft %MINECRAFT_VERSION%.", + >>"!CREATE_JSON!" echo "draft": false, + >>"!CREATE_JSON!" echo "prerelease": %PRERELEASE% + >>"!CREATE_JSON!" echo } + + echo [INFO] Membuat Release %TAG% di Gitea... + set "HTTP_CODE=" + for /f "delims=" %%H in ('curl.exe -sS -o "!RELEASE_JSON!" -w "%%{http_code}" -X POST -H "Authorization: token !GITEA_TOKEN!" -H "Content-Type: application/json" --data-binary "@!CREATE_JSON!" "!API_BASE!/releases"') do set "HTTP_CODE=%%H" + + if not "!HTTP_CODE!"=="201" ( + echo [ERROR] Gitea gagal membuat release. HTTP !HTTP_CODE! + type "!RELEASE_JSON!" + call :cleanup_temp + exit /b 2 + ) +) else ( + echo [ERROR] Gagal memeriksa release. HTTP !HTTP_CODE! + type "!RELEASE_JSON!" + call :cleanup_temp + exit /b 2 +) + +set "RELEASE_ID=" +for /f "delims=" %%I in ('powershell.exe -NoProfile -Command "$r=Get-Content -Raw -LiteralPath '!RELEASE_JSON!' ^| ConvertFrom-Json; $r.id"') do set "RELEASE_ID=%%I" +if not defined RELEASE_ID ( + echo [ERROR] Tidak dapat membaca release ID dari response Gitea. + type "!RELEASE_JSON!" + call :cleanup_temp + exit /b 2 +) + +echo [INFO] Release ID: !RELEASE_ID! +echo [INFO] Mengupload %JAR_NAME%... + +set "ASSET_CODE=" +for /f "delims=" %%H in ('curl.exe -sS -o "!ASSET_JSON!" -w "%%{http_code}" -X POST -H "Authorization: token !GITEA_TOKEN!" -F "attachment=@%JAR_PATH%" "!API_BASE!/releases/!RELEASE_ID!/assets?name=%JAR_NAME%"') do set "ASSET_CODE=%%H" + +if "!ASSET_CODE!"=="201" ( + echo. + echo [SUCCESS] Release %TAG% berhasil dibuat dan JAR berhasil diupload. +) else if "!ASSET_CODE!"=="409" ( + echo. + echo [WARN] Release sudah ada dan asset %JAR_NAME% tampaknya sudah terupload. +) else ( + echo [ERROR] Upload JAR gagal. HTTP !ASSET_CODE! + type "!ASSET_JSON!" + call :cleanup_temp + exit /b 2 +) + +call :cleanup_temp + +echo. +echo ============================================ +echo RELEASE SUCCESS +echo Tag : %TAG% +echo Asset : %JAR_NAME% +echo ============================================ +exit /b 0 + +:push_branch_with_retry set /a PUSH_ROUND=1 -:push_round +:branch_round set /a PUSH_ATTEMPT=1 -:push_attempt -echo [INFO] Push tag attempt !PUSH_ATTEMPT!/3 ^(round !PUSH_ROUND!^)... -git push origin "v%MOD_VERSION%" -if not errorlevel 1 goto :success +:branch_attempt +echo [INFO] Push branch attempt !PUSH_ATTEMPT!/3 ^(round !PUSH_ROUND!^)... +git push -u origin "!CURRENT_BRANCH!" +if not errorlevel 1 exit /b 0 if !PUSH_ATTEMPT! LSS 3 ( set /a PUSH_ATTEMPT+=1 timeout /t 2 /nobreak >nul - goto :push_attempt + goto branch_attempt ) - -echo [WARN] Push tag gagal setelah 3 percobaan. -choice /C YN /N /M "Coba push tag 3x lagi? [Y/N]: " -if errorlevel 2 goto :git_failed +choice /C YN /N /M "Push branch gagal 3x. Coba 3x lagi? [Y/N]: " +if errorlevel 2 exit /b 1 set /a PUSH_ROUND+=1 -goto :push_round +goto branch_round -:git_failed -echo. -echo [WARN] Tahap Git/tag belum selesai, tetapi artifact release sudah dibuat. -goto :end_error +:push_tag_with_retry +set /a TAG_ROUND=1 +:tag_round +set /a TAG_ATTEMPT=1 +:tag_attempt +echo [INFO] Push tag attempt !TAG_ATTEMPT!/3 ^(round !TAG_ROUND!^)... +git push origin "%TAG%" +if not errorlevel 1 exit /b 0 +if !TAG_ATTEMPT! LSS 3 ( + set /a TAG_ATTEMPT+=1 + timeout /t 2 /nobreak >nul + goto tag_attempt +) +choice /C YN /N /M "Push tag gagal 3x. Coba 3x lagi? [Y/N]: " +if errorlevel 2 exit /b 1 +set /a TAG_ROUND+=1 +goto tag_round -:success -echo. -echo ============================================ -echo RELEASE v%MOD_VERSION% SIAP -echo ============================================ -echo Artifact: %RELEASE_DIR% -echo ============================================ -goto :end_ok - -:cancelled -echo. -echo [INFO] Release dibatalkan oleh pengguna. -goto :end_ok - -:failed -echo. -echo [ERROR] Release gagal. -goto :end_error - -:end_ok -echo. -pause +:cleanup_temp +del /q "!RELEASE_JSON!" "!CREATE_JSON!" "!ASSET_JSON!" >nul 2>&1 exit /b 0 - -:end_error -echo. -pause -exit /b 1 diff --git a/release/0.10.0-alpha/LICENSE b/release/0.10.0-alpha/LICENSE new file mode 100644 index 0000000..4df0fe3 --- /dev/null +++ b/release/0.10.0-alpha/LICENSE @@ -0,0 +1,2 @@ +Copyright (c) 2024 LesRaisins +All rights reserved. diff --git a/release/0.10.0-alpha/PORT-CHANGELOG.md b/release/0.10.0-alpha/PORT-CHANGELOG.md new file mode 100644 index 0000000..96d1e44 --- /dev/null +++ b/release/0.10.0-alpha/PORT-CHANGELOG.md @@ -0,0 +1,72 @@ +# 0.10.0-alpha - Legging visibility, branding, and release workflow + +- Fixed vanilla player legs/pants showing through LesRaisinsArmor leggings. Any LR leggings now hide both vanilla leg and pants layers, including suits whose upstream `armor_display` JSON omitted a leggings section. +- Added the supplied `icon.png` as the Fabric mod icon at `assets/lrarmor/icon.png`. +- Renamed the canonical project documentation from `README-PORT.md` to `README.md` for Gitea/Git hosting. +- Added `release.bat`, driven by `gradle.properties`, for preparing versioned release artifacts and optional Git tagging. +- Port remains alpha while full-set gameplay effects and dedicated-server parity continue to be validated. + +# Port iteration 7 + +## 0.7.0-alpha + +- Starts the Fabric port's own version line. The original Forge version remains documented as provenance, but releases no longer inherit the upstream `0.1.4.4-fabric.N` version string. +- Fixed stale vanilla player-part visibility after armor changes. `PlayerModel` now resets every LesRaisinsArmor-controlled part at the start of each animation setup, then applies the current frame's `armor_display` hide mask at the end. +- This specifically fixes cases such as removing a helmet while keeping a chestplate equipped and having the player's head remain invisible. +- No GeckoLib model scale or transform changes in this iteration; Port 7 isolates the visibility lifecycle fix. + +# Port iteration 6 + +## 0.1.4.4-fabric.6 + +- Ported the original Forge `assets/lrarmor/armor_display/*.json` body-part hiding behavior to Minecraft/Fabric 26.2. +- Added a client render-state bridge: `AvatarRenderer` extracts equipped LesRaisinsArmor pieces into an `AvatarRenderState` hide mask. +- Added a `PlayerModel` mixin that hides the vanilla head/hat/body/arms/sleeves/legs/pants named by the original armor display JSON. +- The JSON files remain the source of truth; suits without an `armor_display` file keep vanilla body rendering unchanged. +- Keeps GeckoLib 5 model rendering, the dedicated creative tab, and local client/server run scripts from Port 5. + +# Port iteration 2 + +## 0.1.4.4-fabric.5 + +- Migrated GeckoLib model assets from the legacy `assets/lrarmor/geo/...` layout to GeckoLib 5's canonical `assets/lrarmor/geckolib/models/...` layout. +- Migrated animation assets to `assets/lrarmor/geckolib/animations/...`. +- `BedrockArmorModel` now returns GeckoLib 5 logical resource IDs without location prefixes or `.geo.json` / `.animation.json` suffixes. +- Texture paths remain vanilla-style full texture paths (`textures/...png`), as required by GeckoLib 5. +- Keeps the custom LesRaisins Armor creative tab and local run scripts from Port 4. + +Changes from fabric.1: + +- Updated Fabric API to `0.158.0+26.2` for GeckoLib 5.5.4 compatibility. +- Updated `CreativeModeTabEvents` import to the Fabric 26.2 `creativetab.v1` package. +- Changed Fabric/GeckoLib dependencies to Loom `modImplementation`. +- Removed `splitEnvironmentSourceSets()` for now. GeckoLib 5.5.4 exposes client render types through `GeoRenderProvider`; compiling the renderer in the standard Loom source set allows javac to resolve `HumanoidRenderState`. +- `src/client/java` remains logically client-only through the `client` entrypoint in `fabric.mod.json`. +- Bumped private port version to `0.1.4.4-fabric.2`. + +Dedicated-server runtime verification remains a later test step; this iteration targets the current compile blockers first. + +## Port 4 +- Fixed GeckoLib model and animation resource identifiers to include the actual geo/animations directories and file extensions. +- Added dedicated LesRaisins Armor creative tab. +- Added run-client/run-server scripts for Windows and Linux. + +## 0.8.0-alpha - Build/Git workflow + +- Version line moved to `0.8.0-alpha`; release version continues to come exclusively from `gradle.properties`. +- Reworked `compile.bat` based on the Lobby Systems workflow supplied by DartoKloning. +- `compile.bat` now reads `mod_version`, `minecraft_version`, `maven_group`, and `archives_base_name` from `gradle.properties`. +- If the exact main JAR for the current `mod_version` already exists, the script asks whether to rebuild or skip directly to Git integration. +- If the current-version JAR is absent (including an empty `build/libs` or a JAR from a different version), the build runs automatically. +- After a successful build, the script can commit and push the repository. +- Git push retries automatically up to three times per round; after three failures the user can choose another three-attempt round or stop. +- Added `.gitignore` for Gradle caches, build output, Loom runtime files, IDE metadata, and logs so Git integration does not stage generated files. + +## 0.9.0-alpha - Full-set armor effects + +- Attacker full set: `Better Armor` effect icon, +15 armor toughness, +0.25 knockback resistance. +- Scout full set: `Lightweight` effect icon, +0.025 movement speed. +- Defender full set: `Heavy Armor` effect icon, -0.02 movement speed, and final health damage reduced to 85%. +- Medical full set: `Self-Healing Device` ready effect; below 30% health triggers Regeneration IV for 5 seconds and a 30-second self-healing cooldown. +- Reused the original mod's mob-effect icons (`tough`, `heavy_armor`, `light_leg`, `rescue`, `rescue_cooldown`). +- Full-set logic runs server-side so it can later be tested on a dedicated Fabric server as well as integrated singleplayer. diff --git a/release/0.10.0-alpha/README.md b/release/0.10.0-alpha/README.md new file mode 100644 index 0000000..c31164c --- /dev/null +++ b/release/0.10.0-alpha/README.md @@ -0,0 +1,70 @@ +

+ LesRaisinsArmor logo +

+ +# LesRaisinsArmor — Fabric 26.2 private port + +Private Fabric port of **LesRaisinsArmor** for Minecraft 26.2. + +**Current port version:** `0.10.0-alpha` + +Target stack: Minecraft 26.2, Fabric Loader 0.19.3, Fabric API 0.158.0+26.2, GeckoLib 5.5.4, Java 25. + +## Current port scope + +- Original tactical armor items, textures, GeckoLib models, recipes, repair ingredients, and armor stats are retained/ported. +- GeckoLib 5 armor rendering works on Fabric 26.2, including player body-part hiding to prevent vanilla skin layers clipping through the armor. +- LesRaisinsArmor leggings always hide the vanilla left/right legs and pants layers while equipped. +- Dedicated **LesRaisins Armor** creative tab is available. +- Epic Fight and Forge-only integration are intentionally not part of this Fabric port. +- Full-set gameplay effects are implemented server-side: + - **Attacker / Better Armor:** +15 armor toughness and +0.25 knockback resistance. + - **Scout / Lightweight:** +0.025 movement speed. + - **Defender / Heavy Armor:** -0.02 movement speed and health damage ×0.85. + - **Medical / Self-Healing Device:** below 30% health, Regeneration IV for 5 seconds followed by a 30-second cooldown. + +## Build + +Windows: + +```bat +compile.bat +``` + +Linux/macOS: + +```sh +./compile.sh +``` + +`compile.bat` reads the release version from `gradle.properties`. If the exact current-version JAR already exists, it can skip rebuilding and go directly to Git integration. Git push is retried up to three times per round. + +## Run development client/server + +Windows: + +```bat +run-client.bat +run-server.bat +``` + +Linux/macOS: + +```sh +./run-client.sh +./run-server.sh +``` + +## Release helper + +On Windows: + +```bat +release.bat +``` + +The release helper reads `mod_version` from `gradle.properties`, ensures the matching JAR exists (and can build it when missing), copies release artifacts to `release//`, and can create/push the Git tag `v`. + +## Versioning + +This Fabric port uses its own version line. It is still **alpha** while gameplay parity and dedicated-server behavior continue to be validated. The upstream Forge version is retained only as provenance/context. diff --git a/release/0.10.0-alpha/SHA256SUMS.txt b/release/0.10.0-alpha/SHA256SUMS.txt new file mode 100644 index 0000000..80bcc31 --- /dev/null +++ b/release/0.10.0-alpha/SHA256SUMS.txt @@ -0,0 +1 @@ +6fdf207e5930549ea5a7f8123a423b1197508648de078ba3b9176f7680fe0e8d diff --git a/release/0.10.0-alpha/lrarmor-0.10.0-alpha-sources.jar b/release/0.10.0-alpha/lrarmor-0.10.0-alpha-sources.jar new file mode 100644 index 0000000..789c6d9 Binary files /dev/null and b/release/0.10.0-alpha/lrarmor-0.10.0-alpha-sources.jar differ diff --git a/release/0.10.0-alpha/lrarmor-0.10.0-alpha.jar b/release/0.10.0-alpha/lrarmor-0.10.0-alpha.jar new file mode 100644 index 0000000..8036b20 Binary files /dev/null and b/release/0.10.0-alpha/lrarmor-0.10.0-alpha.jar differ