Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inverse field and method mapper #226

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Earthcomputer
Copy link
Contributor

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.

@modmuss50
Copy link
Member

Whats the usecase?

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

@Earthcomputer
Copy link
Contributor Author

Earthcomputer commented Apr 13, 2020

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.

@sfPlayer1
Copy link
Contributor

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*.

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

Successfully merging this pull request may close these issues.

4 participants