Draft
Conversation
- Fixed checkstyle issue in RenderStateDataExtractionRegistryImpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Render State Data Extraction
Goal
After the addition of
RenderStateDataKey, there is not a way, through the Fabric API, to set that data automatically without the user using mixin to gain access to the extract method for the given subject. These classes allow the user to register extractors, which fulfill those keys automatically.How to use
RenderStateDataKeythat the extractor will be used with. The generic type associated with this key determines the type of data that the extractor will be extractingRenderStateDataExtractorby passing it: the class of the subject being rendered (ex.LocalPlayer), the key, and aRenderStateDataExtractorCallback. The callback is a functional interface that takes in an instance of the subject class and returns the extracted value.RenderStateDataExtractionRegistry#registermethod, which takes in the class of the renderer that the extractor will target and also the extractor itself.Current notes about the implementation
EntityRenderer, at the moment since I am looking for feedback before I do the remaining ones just in case I butchered this.