Skip to content

Detect when blocks are clickable #4705

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

Draft
wants to merge 4 commits into
base: 1.19.4
Choose a base branch
from

Conversation

ZacSharp
Copy link
Collaborator

This currently uses uncached reflection on the pathing thread, and I'd like to hear some other opinions on possible solutions.

The obvious solution would be a Reference2BoolOpenHashMap<Class<?>>, but due to not wanting to synchronize things that cache would have to live in CalculationContext despite caching static data.
Instead we could use mixin to move the cache to a final field on Block instances, which has the only drawback of caching per Block instance, not subclass (and adding a public method to an mc class).
Caching per subclass should be possible by using a custom transformer to directly write the value into the bytecode of the getter method, but that's clearly overkill. Using mixin to do this is probably not possible.

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.

1 participant