-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate some usages of ModifyMethodParams to TransformParameters
- Loading branch information
Showing
21 changed files
with
257 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
definition/src/main/java/org/sinytra/adapter/patch/transformer/BundledMethodTransform.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.sinytra.adapter.patch.transformer; | ||
|
||
import org.objectweb.asm.tree.ClassNode; | ||
import org.objectweb.asm.tree.MethodNode; | ||
import org.sinytra.adapter.patch.api.MethodContext; | ||
import org.sinytra.adapter.patch.api.MethodTransform; | ||
import org.sinytra.adapter.patch.api.Patch; | ||
import org.sinytra.adapter.patch.api.PatchContext; | ||
|
||
import java.util.List; | ||
|
||
public record BundledMethodTransform(List<MethodTransform> transforms) implements MethodTransform { | ||
@Override | ||
public Patch.Result apply(ClassNode classNode, MethodNode methodNode, MethodContext methodContext, PatchContext context) { | ||
Patch.Result result = Patch.Result.PASS; | ||
for (MethodTransform transform : this.transforms) { | ||
result = result.or(transform.apply(classNode, methodNode, methodContext, context)); | ||
} | ||
return result; | ||
} | ||
} |
Oops, something went wrong.