fabric-loader icon indicating copy to clipboard operation
fabric-loader copied to clipboard

Inverse field and method mapper

Open Earthcomputer opened this issue 5 years ago • 3 comments
trafficstars

Quite a rare usecase, but without this PR it's annoying when you do need it. Because it's so rare, the mappings are lazily computed to save memory.

Earthcomputer avatar Apr 13 '20 11:04 Earthcomputer

Whats the usecase?

Would it be easier to read in the mappings from mappings/mappings.tiny ?

modmuss50 avatar Apr 13 '20 13:04 modmuss50

Whats the usecase?

I need a field name which is consistent both across Minecraft versions and across mapping environments (both dev and prod), where I am reflectively listing a set of fields. Concretely, I need some form of identifier for the vanilla Materials, and they don't come with one, but their intermediary field names in the Material class would do nicely.

Would it be easier to read in the mappings from mappings/mappings.tiny ?

Not if this gets merged in, it wouldn't :P

Also, we already had unmapClassName, so we may as well have unmapFieldName and unmapMethodName too.

Earthcomputer avatar Apr 13 '20 19:04 Earthcomputer

Longer term I was considering to change the API such that the resolver object gets created with a src,dst namespace pair and drops the 1st arg in map*.

Player3324 avatar Apr 13 '20 19:04 Player3324