Skip to content

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