mirror of https://github.com/FabricMC/yarn.git
Fix record componenets (#2706)
This commit is contained in:
parent
c90f6ad44b
commit
477e4a0dee
20
build.gradle
20
build.gradle
|
@ -119,7 +119,8 @@ import net.fabricmc.tinyremapper.OutputConsumerPath
|
|||
import net.fabricmc.tinyremapper.TinyRemapper
|
||||
import net.fabricmc.tinyremapper.TinyUtils
|
||||
import org.apache.commons.io.FileUtils
|
||||
import org.objectweb.asm.ClassVisitor;
|
||||
import org.objectweb.asm.ClassVisitor
|
||||
import org.objectweb.asm.FieldVisitor
|
||||
import org.objectweb.asm.Opcodes;
|
||||
|
||||
import java.nio.charset.StandardCharsets
|
||||
|
@ -396,6 +397,23 @@ task mapIntermediaryJar(dependsOn: [downloadMcLibs, downloadIntermediary, mergeJ
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
remapperBuilder.extraPostApplyVisitor { cls, next ->
|
||||
if (!cls.record && cls.superName == "java/lang/Record") {
|
||||
return new ClassVisitor(Opcodes.ASM9, next) {
|
||||
@Override
|
||||
FieldVisitor visitField(int access, String name, String descriptor, String signature, Object value) {
|
||||
if (name.startsWith("comp_")) {
|
||||
super.visitRecordComponent(name, descriptor, signature);
|
||||
}
|
||||
|
||||
return super.visitField(access, name, descriptor, signature, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return next
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue