Skip to content

[6.0] Generated methods CSV doesn't support record method names #922

Description

@Su5eD

Currently, the generator for method and field CSV files, OfficialChannelProvider, distinguishes methods and fields by their prefix, which is func_ / m_ for methods and field_ / f_ for fields. However, in records, the names of accessor methods are the same as the field they're accessing. As an example, see NoiseGeneratorSettings.surfaceRule.

for (IMappingFile.IField fld : cls.getFields()) {
String name = obf.remapField(fld.getMapped());
if (name.startsWith("field_") || name.startsWith("f_"))
sfields.put(name, fld.getOriginal());
}
for (IMappingFile.IMethod mtd : cls.getMethods()) {
String name = obf.remapMethod(mtd.getMapped(), mtd.getMappedDescriptor());
if (name.startsWith("func_") || name.startsWith("m_"))
smethods.put(name, mtd.getOriginal());
}

This leads to all record method names being filtered out as fields by the generator.
When the mappings are later used at runtime by modlauncher for remapping class member names, record methods will never be remapped due to this issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FG6This request is for FG 6

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions