use of net.minecraftforge.fml.common.asm.transformers.deobf.FMLRemappingAdapter in project MinecraftForge by MinecraftForge.
the class DeobfuscationTransformer method transform.
// COMPUTE_FRAMES causes classes to be loaded, which could cause issues if the classes do not exist.
// However in testing this has not happened. {As we run post SideTransformer}
// If reported we need to add a custom implementation of ClassWriter.getCommonSuperClass
// that does not cause class loading.
@Override
public byte[] transform(String name, String transformedName, byte[] bytes) {
if (bytes == null) {
return null;
}
ClassReader classReader = new ClassReader(bytes);
ClassWriter classWriter = new ClassWriter(WRITER_FLAGS);
RemappingClassAdapter remapAdapter = new FMLRemappingAdapter(classWriter);
classReader.accept(remapAdapter, READER_FLAGS);
return classWriter.toByteArray();
}
Aggregations