Conversation
- Fixed checkstyle issue in RenderStateDataExtractionRegistryImpl
* 26.1-snapshot-11 * Fix client tests. * Bump version
Due to release failuire
Due to release failuire
modmuss50
left a comment
There was a problem hiding this comment.
I have just posted some rough thoughts on how I imagined doing this. Its quite possible I missed something funimental that prevents my solution from working though. Let me know what you think or if something doesnt make sense.
...ient/java/net/fabricmc/fabric/api/client/rendering/v1/RenderStateDataExtractionRegistry.java
Outdated
Show resolved
Hide resolved
...v1/src/client/java/net/fabricmc/fabric/api/client/rendering/v1/RenderStateDataExtractor.java
Outdated
Show resolved
Hide resolved
- Fixed some checkstyle issues - Removed unit test
|
I rewrote the system to focus on entity renderers in particular rather than trying to generalize to all renderers. The new system moves the extractor references to the renderers as soon as they are created during resource loading rather than having the renderers constantly look them up from the registry. I did not implement a factory for The system has separate methods for working with avatar entities, which may be a bit overkill, so any advice is welcome. |
- Removed RenderStateDataExtractionRegistry and impl - Repurposed callback interface into an event
...c/client/java/net/fabricmc/fabric/api/client/rendering/v1/RenderStateExtractionCallback.java
Outdated
Show resolved
Hide resolved
...ing-v1/src/client/java/net/fabricmc/fabric/api/client/rendering/v1/FabricEntityRenderer.java
Outdated
Show resolved
Hide resolved
...v1/src/client/java/net/fabricmc/fabric/api/client/rendering/v1/RenderStateDataExtractor.java
Outdated
Show resolved
Hide resolved
...c/client/java/net/fabricmc/fabric/api/client/rendering/v1/RenderStateExtractionCallback.java
Outdated
Show resolved
Hide resolved
...c/client/java/net/fabricmc/fabric/api/client/rendering/v1/RenderStateExtractionCallback.java
Outdated
Show resolved
Hide resolved
- Fixed checkstyle - Fixed questionable design choices - Removed game test (now covered by RenderLayerTest) - removed mixin AvatarRendererMixin used by RenderLayerTest
- Renamed FabricEntityRenderer to EntityRenderStateExtractorHolder - removed interface injection of EntityRenderStateExtractorHolder - Fixed old game test entrypoint still being present in the fabric.mod.json - Moved extraction movement from event invoker to context cleanup
- Fixed checkstyle issue in RenderStateDataExtractionRegistryImpl
- Fixed some checkstyle issues - Removed unit test
- Removed RenderStateDataExtractionRegistry and impl - Repurposed callback interface into an event
- Renamed FabricEntityRenderer to EntityRenderStateExtractorHolder - removed interface injection of EntityRenderStateExtractorHolder - Fixed old game test entrypoint still being present in the fabric.mod.json - Moved extraction movement from event invoker to context cleanup
…renderStateDataExtraction
* initial implementation * fix AttachmentTargetsMixin error * add some tests * fix tests * remove transitive interface injection for ClientPacketListener * use IdentityHashMap for player connections * woops readd ClientboundCustomPayloadPacketAccessor to mixins.json * add proper docs to new API * incremental sync global attachments using ServerConnectionListener
…renderStateDataExtraction
- renamed internal method for adding extractors to renderers
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 (for non-avatar entities)
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: theEntityTypeof the entity being rendered (ex.EntityType.CREEPER), the key, and aRenderStateDataExtractorCallback. The callback is a functional interface that takes in an instance of the entity, as well as the delta ticks, and returns the extracted value.RenderStateDataExtractionRegistry#registermethod, which only requires the extractor to be passed to it.How to use (for avatar entities)
RenderStateDataExtractorthrough thecreateAvatarmethod instead of thecreatemethod. This new method does not require anEntityTypeto be passed.registerAvatarinstead ofregister. Failing to call the correct method for registration will throw anIllegalArgumentException.Current notes about the implementation