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

Allow dynamic selectors to choose the class to perform member lookups in #2293

Merged
merged 2 commits into from May 9, 2024

Conversation

Bawnorton
Copy link
Contributor

@Bawnorton Bawnorton commented May 7, 2024

Motivation

MixinSquared's @TargetHandler is a dynamic selector which targets merged handlers, the accepted references are the name of the mixin and the original name of the handler. The method targeting is the same as @At.method but the members are declared in the mixin class specified by the mixin attribute, thus, when looking up members for a @TargetHandler selector, the class specified in mixin would be the one to lookup. Mcdev's member lookups work off the target class specified in the @Mixin annotation, thus, this change is needed to allow the lookup to occur in a different class.

This pr also fixes namespace lookup as you do not have to declare the namespace for a dynamic selector in the annotation and can instead declare it at registration.

See #2287

…t at registration

* allow dynamic selectors to change the target class that is used when looking up members
Copy link
Member

@Earthcomputer Earthcomputer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good other than one thing.

src/main/kotlin/platform/mixin/reference/MixinSelectors.kt Outdated Show resolved Hide resolved
@Earthcomputer Earthcomputer merged commit 8f2bb55 into minecraft-dev:dev May 9, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants