md-5 / SpecialSource

Automatic generator and renamer of jar obfuscation mappings.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RemappingClassAdapter remaps fields twice

LunNova opened this issue · comments

RemappingClassAdapter was partially broken in this commit: e9311dc

It now remaps fields twice.

visitField maps the field then calls super.visitField. super.visitField maps the field again.

Here's an example field which broke in real usage, getting mapped from a -> x -> guiResponder instead of just a->x.

net/minecraft/client/gui/GuiTextField.x
Name: a => field_146209_f => x
net/minecraft/client/gui/GuiTextField.guiResponder
Name: x => field_175210_x => guiResponder
commented

Can you please clarify your example in srg/csrg format, I don’t understand what you’re trying to convey

There's a quick/dirty/rubbish failing test in https://github.com/nallar/SpecialSource/tree/remapping-bug demonstrating it.

notch-mcp.srg:

FD: bje/a net/minecraft/client/gui/GuiTextField/x
FD: bje/x net/minecraft/client/gui/GuiTextField/guiResponder

fields.csv:

field_146209_f,x,0,
field_175210_x,guiResponder,0,

a gets remapped to x. The bug then tries to map it again and maps x to guiResponder. Without the bug it only gets mapped once and stays as x.