Skip to content

Commit 44ab21f

Browse files
committed
Fix missing record flag caused by PG stripping the attribute.
1 parent f6e3fee commit 44ab21f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/net/minecraftforge/fart/internal/RecordFixer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ public Fixer(ClassVisitor parent) {
3232
@Override
3333
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
3434
this.isRecord = "java/lang/Record".equals(superName);
35+
if (isRecord && ((access & Opcodes.ACC_RECORD) == 0)) {
36+
// ASM Uses this to determine if it should write the records components at all, which is necessary even if empty.
37+
access |= Opcodes.ACC_RECORD;
38+
this.madeChange = true;
39+
}
3540
super.visit(version, access, name, signature, superName, interfaces);
3641
}
3742

0 commit comments

Comments
 (0)