Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ outputs:
runs:
using: composite
steps:
- uses: actions/setup-java@v5
- uses: actions/setup-java@v6
with:
distribution: temurin
java-version: '25'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Build
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- uses: ./.github/actions/build
with:
Expand All @@ -22,7 +22,7 @@ jobs:
needs: build
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- uses: actions/download-artifact@v8
with:
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
runs-on: windows-latest
environment: Build
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- uses: actions/download-artifact@v8
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
name: Build
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- uses: ./.github/actions/build
with:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
game_versions: ${{ steps.build.outputs.game_versions }}
java: ${{ steps.build.outputs.java }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- uses: ./.github/actions/build
id: build
Expand All @@ -30,7 +30,7 @@ jobs:
needs: build
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- uses: actions/download-artifact@v8
with:
Expand All @@ -51,7 +51,7 @@ jobs:
runs-on: windows-latest
environment: Build
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- uses: actions/download-artifact@v8
with:
Expand Down Expand Up @@ -85,14 +85,14 @@ jobs:
runs-on: windows-latest
environment: Build
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- uses: actions/download-artifact@v8
with:
name: CustomSkinLoader-Release-${{ github.run_number }}
path: artifact

- uses: Kir-Antipov/mc-publish@v3.3
- uses: Kir-Antipov/mc-publish@v3
with:
modrinth-id: idMHQ4n2
modrinth-featured: true
Expand All @@ -107,6 +107,7 @@ jobs:
${{ needs.build.outputs.loaders }}
game-versions: |
${{ needs.build.outputs.game_versions }}
environment: client
game-version-filter: releases
java: |
${{ needs.build.outputs.java }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ public String unmapMethodDescriptor(String targetDescriptor) {
return this.mappings.unmapMethodDescriptor(targetDescriptor);
}

public boolean isTarget(String canonicalName) {
return this.getInternalClassName().equals(this.remapClassName(canonicalName));
}

public MethodNode findMethod(String owner, String name, String desc) {
String mappedDesc = this.remapMethodDescriptor(desc);
String mappedName = "<init>".equals(name) ? name : this.remapMethodName(owner, name, desc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,41 @@
import org.objectweb.asm.tree.ClassNode;

public final class ClassTransformationReport {
private final ClassTransformationContext context;
private final List<String> appliedTransformerNames;
private final String internalClassName;
private final ClassNode transformedClassNode;
private final byte[] originalBytecode;
private final List<String> appliedRuleNames;
private volatile byte[] transformedBytecode;

public ClassTransformationReport(ClassTransformationContext context, List<String> appliedTransformerNames) {
this.context = context;
this.appliedTransformerNames = Collections.unmodifiableList(new ArrayList<>(appliedTransformerNames));
}

public ClassTransformationContext getContext() {
return this.context;
ClassTransformationReport(String internalClassName, ClassNode transformedClassNode, byte[] originalBytecode, List<String> appliedRuleNames) {
this.internalClassName = internalClassName;
this.transformedClassNode = transformedClassNode;
this.originalBytecode = originalBytecode;
this.appliedRuleNames = Collections.unmodifiableList(new ArrayList<>(appliedRuleNames));
}

public byte[] getTransformedBytecode() {
if (!this.isModified() && this.originalBytecode != null) {
return this.originalBytecode.clone();
}
if (this.transformedBytecode == null) {
if (this.getTransformedClassNode() == null) {
throw new IllegalStateException("Transformed bytecode is not available without a transformed ClassNode");
if (this.transformedClassNode == null) {
throw new IllegalStateException("Transformed bytecode is not available without a ClassNode");
}

this.transformedBytecode = TransformerBootstrapSupport.toByteArray(this.getTransformedClassNode());
this.transformedBytecode = TransformerBootstrapSupport.toByteArray(this.transformedClassNode);
}

return this.transformedBytecode.clone();
}

public ClassNode getTransformedClassNode() {
return this.context.getCurrentClassNode();
return this.transformedClassNode;
}

public List<String> getAppliedTransformerNames() {
return this.appliedTransformerNames;
public List<String> getAppliedRuleNames() {
return this.appliedRuleNames;
}

public boolean isModified() {
return !this.appliedTransformerNames.isEmpty();
return !this.appliedRuleNames.isEmpty();
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package customskinloader.bootstrap.transformer;

public final class RuntimeVersion {
private final int protocolVersion;
private final int worldVersion;

public RuntimeVersion(int protocolVersion, int worldVersion) {
this.protocolVersion = protocolVersion;
this.worldVersion = worldVersion;
}

public int getProtocolVersion() {
return this.protocolVersion;
}

public int getWorldVersion() {
return this.worldVersion;
}

@Override
public String toString() {
return "protocol=" + this.protocolVersion + ", world=" + this.worldVersion;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package customskinloader.bootstrap.transformer;

public interface TransformationObserver {
void ruleApplied(String ruleId, String internalClassName);

void optionalRuleSkipped(String message);

void classTransformed(String internalClassName, Iterable<String> ruleIds);
}
Loading