Compare commits

...
1 Commits
5 changed files with 22 additions and 14 deletions

No files matched your search

+3 -1
View File
@@ -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'
@@ -199,11 +199,15 @@ abstract class PatchSupport extends TargetedClassTransformer implements Opcodes
}
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 @@ abstract class PatchSupport extends TargetedClassTransformer implements Opcodes
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;
}
@@ -97,27 +97,27 @@ public final class RenderPatch extends PatchSupport {
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 @@ public final class RenderPatch extends PatchSupport {
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 @@ public final class RenderPatch extends PatchSupport {
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;
}
@@ -51,14 +51,14 @@ public class FakeHttpTexture {
}
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<NativeImage, CompletableFuture<?>> createTexture(Function<NativeImage, CompletableFuture<?>> 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);
+1 -1
View File
@@ -1,7 +1,7 @@
{
"mod_group": "customskinloader",
"mod_name": "CustomSkinLoader",
"mod_version": "15.0",
"mod_version": "15.0.1",
"edition": "Universal",
"loaders": [