fix: hide ysm head in first person on 26.1 without breaking mod captures - #659
fix: hide ysm head in first person on 26.1 without breaking mod captures#659brokestar233 wants to merge 1 commit into
Conversation
Ysm builds its render data from render states and checks FirstPersonAPI#isRenderingPlayer while evaluating its animation, which on 26.1 happens lazily during the submit of the state instead of during the synchronous render. The flag was only raised around firstperson's own extraction, so the evaluation always ran with it down and the ysm head stayed visible. - widen the flag while the camera entity render state is extracted (without marking those states), so ysm attaches its first person context on every extraction, including its own re-extractions - keep a submit window only for the state firstperson extracted itself; that evaluation runs with the flag up and bakes the model headless for the frame render, while evaluations triggered by other mods run with it down, explicitly resetting the head state and keeping their captures intact (realcamera bindings, model view screen, guis) - drive the render state marker and helmet removal via the un-widened flag so only states extracted by firstperson are affected Signed-off-by: brokestar233 <3765589194@qq.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. WalkthroughThe change adds separate camera-extraction and raw-rendering state checks. Minecraft 26.1 render hooks track camera entities during extraction and submission. Related mixins use the raw state for camera marking and item hiding. ChangesCamera entity render-state handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This change restores first-person YSM head rendering on Minecraft 26.1.x while limiting head and item hiding to FirstPerson-controlled states, preserving mod and GUI captures. No actionable merge-blocking risk is identified. Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant RenderDispatcherMixin
participant FirstPersonModelCore
participant CameraRenderState
RenderDispatcherMixin->>FirstPersonModelCore: Enable cameraEntityExtract during extraction
RenderDispatcherMixin->>CameraRenderState: Detect camera-entity render state
RenderDispatcherMixin->>FirstPersonModelCore: Enable player rendering during submission
RenderDispatcherMixin->>FirstPersonModelCore: Reset extraction and rendering state
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



Problem
When playing with Yes Steve Model on 1.21.9+ (26.1.x), the
YSM player model keeps its head rendered in first person, so the camera sits inside the head.
On 1.20.1 the head hiding worked fine.
Root cause
YSM is compatible through
FirstPersonAPI#isRenderingPlayer(). On 1.20.1 the flag is raisedaround FirstPerson's synchronous player render, which is exactly when YSM evaluates its
animation, so the head gets hidden.
On 1.21.9+ the render pipeline is split into state extraction and submission, and YSM 2.6.5
now builds its render data at extraction time and defers the animation evaluation (including
the head visibility write) to the submit of that state. FirstPerson only raised the flag
around its own extraction, so:
animation with the flag down and memoized that result, since evaluation results are cached
per render data
Fix
Two narrow windows around
EntityRenderDispatcher, enabled for>= 26.1:active, widen
isRenderingPlayer()via a separate flag (cameraEntityExtract) instead ofthe regular one. YSM then attaches its first person context on every extraction of the
local player (including its own re-extractions) and re-evaluates head visibility on each
submit.
existing
isCameraEntitystate flag) raises the regular flag during its submit. That isthe one evaluation that must hide the head for the actual frame render.
Because evaluations triggered by other mods run with the flag down, YSM's hide block
explicitly resets the head state — so RealCamera bindings, its model view screen and GUI
captures keep rendering the full model. Accordingly:
LivingEntityRendererMixinand the helmet removal inPlayerMixinnow use the un-widenedflag (
isRenderingPlayerRaw()), so only states extracted by FirstPerson are markedrequire = 0/expect = 0and are preprocessor-gated to>= 26.1, leaving 1.20.1 and every other version untouchedTesting
full model, body render unaffected
26.2-fabric compile with the new code fully preprocessed out / behavior unchanged
PS:This PR was generated with the help of AI and requires careful review.