From 20540a59058f04e8c2bc8d28b4cf16385ca6578e Mon Sep 17 00:00:00 2001 From: ZekerZhayard Date: Sat, 20 Jun 2026 20:22:45 +0800 Subject: [PATCH 1/3] Fix: relax render patch failures and correct RenderType patching --- .../transformer/patch/PatchSupport.java | 8 ++++++-- .../transformer/patch/RenderPatch.java | 18 ++++++++++-------- build.info.json | 2 +- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Bootstrap/Core/src/main/java/customskinloader/bootstrap/transformer/patch/PatchSupport.java b/Bootstrap/Core/src/main/java/customskinloader/bootstrap/transformer/patch/PatchSupport.java index 1a50c808..bebc854b 100644 --- a/Bootstrap/Core/src/main/java/customskinloader/bootstrap/transformer/patch/PatchSupport.java +++ b/Bootstrap/Core/src/main/java/customskinloader/bootstrap/transformer/patch/PatchSupport.java @@ -199,11 +199,15 @@ protected boolean matches(String range) { } protected boolean applyIfMatches(String range, String label, BooleanSupplier operation) { + return applyIfMatches(range, label, operation, true); + } + + protected boolean applyIfMatches(String range, String label, BooleanSupplier operation, boolean required) { if (!this.matches(range)) { return false; } - return this.requireModified(label, operation.getAsBoolean()); + return this.requireModified(label, operation.getAsBoolean(), required); } protected boolean requireModified(String label, boolean modified) { @@ -222,7 +226,7 @@ protected boolean requireModified(String label, boolean modified, boolean requir throw new IllegalStateException(message); } - if (!required && Boolean.getBoolean(IGNORE_PATCH_FAILURE_PROPERTY)) { + if (!required || Boolean.getBoolean(IGNORE_PATCH_FAILURE_PROPERTY)) { LOGGER.warn(message); return false; } diff --git a/Bootstrap/Core/src/main/java/customskinloader/bootstrap/transformer/patch/RenderPatch.java b/Bootstrap/Core/src/main/java/customskinloader/bootstrap/transformer/patch/RenderPatch.java index 88cb42cd..ae370da6 100644 --- a/Bootstrap/Core/src/main/java/customskinloader/bootstrap/transformer/patch/RenderPatch.java +++ b/Bootstrap/Core/src/main/java/customskinloader/bootstrap/transformer/patch/RenderPatch.java @@ -97,27 +97,27 @@ private boolean patchCapeLayer(ClassTransformationContext context) { modified |= this.applyIfMatches("[556,560]", "cape-layer.render.v1", () -> replaceEntitySolidWithTranslucent( context, context.findMethod(CAPE_LAYER, "render", "(" + objectDesc(POSE_STACK) + objectDesc(MULTI_BUFFER_SOURCE) + "I" + objectDesc(ABSTRACT_CLIENT_PLAYER) + "FFFFFFF)V"), RENDER_TYPE - )); + ), false); // 19w45a ~ 1.21.1 (1.15 ~ 1.21.1) modified |= this.applyIfMatches("[561,767],[801,803],[0x40000001,0x400000CC]", "cape-layer.render.v2", () -> replaceEntitySolidWithTranslucent( context, context.findMethod(CAPE_LAYER, "render", "(" + objectDesc(POSE_STACK) + objectDesc(MULTI_BUFFER_SOURCE) + "I" + objectDesc(ABSTRACT_CLIENT_PLAYER) + "FFFFFF)V"), RENDER_TYPE - )); + ), false); // 24w33a ~ 1.21.8 (1.21.2 ~ 1.21.8) modified |= this.applyIfMatches("[768,772],[0x400000CD,0x40000103]", "cape-layer.render.v3", () -> replaceEntitySolidWithTranslucent( context, context.findMethod(CAPE_LAYER, "render", "(" + objectDesc(POSE_STACK) + objectDesc(MULTI_BUFFER_SOURCE) + "I" + objectDesc(PLAYER_RENDER_STATE) + "FF)V"), RENDER_TYPE - )); + ), false); // 25w31a ~ 25w42a (1.21.9 ~ 1.21.10) modified |= this.applyIfMatches("773,[0x40000104,0x40000112]", "cape-layer.submit.v1", () -> replaceEntitySolidWithTranslucent( context, context.findMethod(CAPE_LAYER, "submit", "(" + objectDesc(POSE_STACK) + objectDesc(SUBMIT_NODE_COLLECTOR) + "I" + objectDesc(AVATAR_RENDER_STATE) + "FF)V"), RENDER_TYPE - )); + ), false); // 25w43a+ (1.21.11+) modified |= this.applyIfMatches("[774,800],[804,0x40000000],[0x40000113,]", "cape-layer.submit.v2", () -> replaceEntitySolidWithTranslucent( context, context.findMethod(CAPE_LAYER, "submit", "(" + objectDesc(POSE_STACK) + objectDesc(SUBMIT_NODE_COLLECTOR) + "I" + objectDesc(AVATAR_RENDER_STATE) + "FF)V"), RENDER_TYPES - )); + ), false); return modified; } @@ -127,12 +127,12 @@ private boolean patchPlayerRenderer(ClassTransformationContext context) { modified |= this.applyIfMatches("[556,560]", "player-renderer.render-hand.v1", () -> replaceEntitySolidWithTranslucent( context, context.findMethod(PLAYER_RENDERER, "renderHand", "(" + objectDesc(POSE_STACK) + objectDesc(MULTI_BUFFER_SOURCE) + objectDesc(ABSTRACT_CLIENT_PLAYER) + objectDesc(MODEL_PART) + objectDesc(MODEL_PART) + ")V"), RENDER_TYPE - )); + ), false); // 19w45a ~ 1.21.1 (1.15 ~ 1.21.1) modified |= this.applyIfMatches("[561,767],[801,803],[0x40000001,0x400000CC]", "player-renderer.render-hand.v2", () -> replaceEntitySolidWithTranslucent( context, context.findMethod(PLAYER_RENDERER, "renderHand", "(" + objectDesc(POSE_STACK) + objectDesc(MULTI_BUFFER_SOURCE) + "I" + objectDesc(ABSTRACT_CLIENT_PLAYER) + objectDesc(MODEL_PART) + objectDesc(MODEL_PART) + ")V"), RENDER_TYPE - )); + ), false); return modified; } @@ -157,7 +157,9 @@ private boolean replaceEntitySolidWithTranslucent(ClassTransformationContext con continue; } - methodNode.instructions.set(instruction, new MethodInsnNode(INVOKESTATIC, remappedOwner, replacementName, remappedDesc, false)); + methodNode.instructions.insertBefore(instruction, new InsnNode(DUP)); + methodNode.instructions.insert(instruction, new MethodInsnNode(INVOKESTATIC, remappedOwner, replacementName, remappedDesc, false)); + methodNode.instructions.insert(instruction, new InsnNode(POP)); modified = true; } diff --git a/build.info.json b/build.info.json index 65853d85..7f731706 100644 --- a/build.info.json +++ b/build.info.json @@ -1,7 +1,7 @@ { "mod_group": "customskinloader", "mod_name": "CustomSkinLoader", - "mod_version": "15.0", + "mod_version": "15.0.1", "edition": "Universal", "loaders": [ From fabd9066da6d3e66aae0ec0ba3b51fec25a8dd4a Mon Sep 17 00:00:00 2001 From: ZekerZhayard Date: Sat, 20 Jun 2026 20:56:05 +0800 Subject: [PATCH 2/3] Fix Gradle cache not restoring in GitHub Actions --- .github/actions/build/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index d92c7df7..4cb8dcb6 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -38,7 +38,9 @@ runs: - name: Build with Gradle shell: pwsh - run: ./gradlew clean build --info --stacktrace -Pbuild_type=${{ github.event_name }} + run: | + ./gradlew clean build --info --stacktrace -Pbuild_type=${{ github.event_name }} + ./gradlew --stop - name: Generate metadata JSONs if: github.event_name != 'pull_request' From 40678a3a6b0ab9ca5445196df9dc76abffcb9580 Mon Sep 17 00:00:00 2001 From: ZekerZhayard Date: Sat, 20 Jun 2026 23:04:29 +0800 Subject: [PATCH 3/3] Fix ResourceLocation domain --- .../java/customskinloader/fake/texture/FakeHttpTexture.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/src/main/java/customskinloader/fake/texture/FakeHttpTexture.java b/Common/src/main/java/customskinloader/fake/texture/FakeHttpTexture.java index 602cca79..e886f97f 100644 --- a/Common/src/main/java/customskinloader/fake/texture/FakeHttpTexture.java +++ b/Common/src/main/java/customskinloader/fake/texture/FakeHttpTexture.java @@ -51,14 +51,14 @@ private static Runnable setProcessor(Runnable processor, MinecraftProfileTexture } public static class V2 extends SimpleTexture { - private static final String DOMAIN = "customskinloader:"; + private static final String DOMAIN = "customskinloader"; private FakeCapeBuffer buffer; private FakeNativeImage image; public static Function> createTexture(Function> function, Identifier location, boolean isSkin) { return isSkin ? _image -> { - if (location.toString().startsWith(DOMAIN)) { + if (location.toString().startsWith(DOMAIN + ":")) { return CompletableFuture.completedFuture(new AbstractMap.SimpleEntry<>(_image, function.apply(_image))); } return function.apply(_image);