Detect when blocks are clickable #4705
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 inCalculationContext
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 perBlock
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.