From d406a6ffd8480b9be1c97ff515e79cf161545425 Mon Sep 17 00:00:00 2001 From: Darto KLoning Date: Tue, 8 Sep 2026 19:45:11 +0700 Subject: [PATCH] fix leggings --- PORT-CHANGELOG.md | 8 + README.md | 72 +++++-- gradle.properties | 2 +- release.bat | 177 ++++++++++++++++++ .../client/display/ArmorDisplayPolicy.java | 15 +- src/main/resources/fabric.mod.json | 4 +- 6 files changed, 258 insertions(+), 20 deletions(-) create mode 100644 release.bat diff --git a/PORT-CHANGELOG.md b/PORT-CHANGELOG.md index 3f5d22c..96d1e44 100644 --- a/PORT-CHANGELOG.md +++ b/PORT-CHANGELOG.md @@ -1,3 +1,11 @@ +# 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 diff --git a/README.md b/README.md index db61fe0..c31164c 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,70 @@

- LesRaisinsArmor Fabric + LesRaisinsArmor logo

# LesRaisinsArmor — Fabric 26.2 private port -Target: Minecraft 26.2, Fabric Loader 0.19.3, Fabric API 0.156.0+26.2, GeckoLib 5.5.4, Java 25. +Private Fabric port of **LesRaisinsArmor** for Minecraft 26.2. -This first port baseline keeps all original GeckoLib geo models, armor textures, inventory textures, translations, armor stat data (converted into registration-time ArmorMaterial values), and recipes. Epic Fight compatibility and Forge-only integrations were intentionally removed. +**Current port version:** `0.10.0-alpha` -## Build -Windows: `compile.bat` -Linux/macOS: `./compile.sh` - -The scripts verify Java 25, download Gradle 9.5.1 locally when needed, then run `clean build`. +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 -- All original armor items are registered, including the two-piece `joker_armed` set present in the Forge source. -- Defense, toughness, knockback resistance, enchantability, durability, equip sound, and repair ingredients are migrated from the original `armor_data` JSON. -- GeckoLib 5 armor rendering is wired to the original Bedrock/GeckoLib models and textures. -- Items are added to the vanilla Combat creative tab. -- Forge datasync/networking was removed because armor stats are now deterministic at registration time. -## Follow-up parity work -The Forge source's full-set effects (Attacker, Defender, Scout, Medical), player-body-part hiding used to reduce model clipping, and any remaining 26.2 recipe/tag schema adjustments should be validated in-game after the first successful compile. These are intentionally isolated from the baseline so compiler/API errors can be resolved first. +- 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 -Starting with Port 7, this private Fabric 26.2 port uses its own release line. `0.7.0-alpha` is the first version on that line. The upstream Forge version is retained only as source/provenance context. +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/gradle.properties b/gradle.properties index 2d07254..31dc18f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,6 +8,6 @@ loom_version=1.17-SNAPSHOT fabric_api_version=0.158.0+26.2 geckolib_version=5.5.4 -mod_version=0.9.0-alpha +mod_version=0.10.0-alpha maven_group=me.xjqsh archives_base_name=lrarmor diff --git a/release.bat b/release.bat new file mode 100644 index 0000000..42aed44 --- /dev/null +++ b/release.bat @@ -0,0 +1,177 @@ +@echo off +setlocal EnableExtensions EnableDelayedExpansion + +REM ============================================================ +REM LesRaisinsArmor - Fabric Release Helper (Windows) +REM Version is read exclusively from gradle.properties. +REM ============================================================ + +cd /d "%~dp0" + +set "GRADLE_PROPERTIES=%CD%\gradle.properties" +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 ( + 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 +) +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" + +echo ============================================ +echo LesRaisinsArmor - Release Helper +echo Minecraft : %MINECRAFT_VERSION% +echo Version : %MOD_VERSION% +echo Tag : v%MOD_VERSION% +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 +if errorlevel 1 ( + echo [ERROR] Git tidak ditemukan di PATH. Artifact tetap aman. + goto :git_failed +) + +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 +) + +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 +) + +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. +) else ( + git tag -a "v%MOD_VERSION%" -m "LesRaisinsArmor v%MOD_VERSION%" + if errorlevel 1 goto :git_failed +) + +set /a PUSH_ROUND=1 +:push_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 +if !PUSH_ATTEMPT! LSS 3 ( + set /a PUSH_ATTEMPT+=1 + timeout /t 2 /nobreak >nul + goto :push_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 +set /a PUSH_ROUND+=1 +goto :push_round + +:git_failed +echo. +echo [WARN] Tahap Git/tag belum selesai, tetapi artifact release sudah dibuat. +goto :end_error + +: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 +exit /b 0 + +:end_error +echo. +pause +exit /b 1 diff --git a/src/client/java/me/xjqsh/lesraisinsarmor/client/display/ArmorDisplayPolicy.java b/src/client/java/me/xjqsh/lesraisinsarmor/client/display/ArmorDisplayPolicy.java index a830548..874b782 100644 --- a/src/client/java/me/xjqsh/lesraisinsarmor/client/display/ArmorDisplayPolicy.java +++ b/src/client/java/me/xjqsh/lesraisinsarmor/client/display/ArmorDisplayPolicy.java @@ -43,7 +43,20 @@ public final class ArmorDisplayPolicy { } Map slots = CACHE.computeIfAbsent(armor.suitId(), ArmorDisplayPolicy::loadSuit); - return slots.getOrDefault(slotName(expectedType), 0); + int configuredMask = slots.getOrDefault(slotName(expectedType), 0); + + // Every LesRaisinsArmor leggings model replaces the vanilla player legs visually. + // Some upstream armor_display JSON files omitted a leggings section, which leaves + // the skin/pants visible through the GeckoLib model. Always hide both vanilla + // leg layers while LR leggings are equipped; suit JSON can still add other parts. + if (expectedType == ArmorType.LEGGINGS) { + configuredMask |= ArmorDisplayMask.LEFT_LEG + | ArmorDisplayMask.LEFT_PANTS + | ArmorDisplayMask.RIGHT_LEG + | ArmorDisplayMask.RIGHT_PANTS; + } + + return configuredMask; } private static String slotName(ArmorType type) { diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 347d855..5275374 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -24,12 +24,12 @@ "fabric-api": "*", "geckolib": ">=5.5.4" }, - "icon": "assets/lrarmor/icon.png", "mixins": [ "lrarmor.mixins.json", { "config": "lrarmor.client.mixins.json", "environment": "client" } - ] + ], + "icon": "assets/lrarmor/icon.png" }