Skip to content

Commit

Permalink
Use MixinClassWriter within post-mixin MixinTransformer
Browse files Browse the repository at this point in the history
Theoretically fixes circular dependency on runtime transformation
  • Loading branch information
Ampflower committed Mar 9, 2022
1 parent 77b3080 commit c549a09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ minecraft_version=1.16.2
yarn_mappings=1.16.2+build.46:v2
loader_version=0.9.2+build.206
# Mod Properties
mod_version=0.3.0
mod_version=0.3.1
maven_group=net.gudenau.minecraft
archives_base_name=gud_asm
# Dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.objectweb.asm.tree.ClassNode;
import org.spongepowered.asm.mixin.transformer.FabricMixinTransformerProxy;
import org.spongepowered.asm.mixin.transformer.IMixinTransformer;
import org.spongepowered.asm.transformers.MixinClassWriter;

import java.io.IOException;
import java.io.OutputStream;
Expand Down Expand Up @@ -162,11 +163,11 @@ private byte[] transform(String name, String transformedName, byte[] bytecode, L
if(!modified){
return bytecode;
}
ClassWriter writer = new ClassWriter(flags.getClassWriterFlags()){

ClassWriter writer = new MixinClassWriter(flags.getClassWriterFlags()) {
// Fixes an issue with stack calculations
@Override
protected ClassLoader getClassLoader(){
protected ClassLoader getClassLoader() {
return classLoader;
}
};
Expand Down

0 comments on commit c549a09

Please sign in to comment.