Don't assume a level render state exists during extraction - #812
Open
koolBEANS829 wants to merge 1 commit into
Open
Don't assume a level render state exists during extraction#812koolBEANS829 wants to merge 1 commit into
koolBEANS829 wants to merge 1 commit into
Conversation
Mods that render a secondary world reuse the level extraction pass for a different level. Immersive Portals does this from SecondaryWorldRenderCore.renderDestWorld when drawing a portal's destination, and that pass has no level render state, so LevelExtractionContext#levelState returns null and the END_EXTRACTION handler NPEs as soon as a portal is on screen. Skip the extraction when there is no level state. The shapes are simply not collected for the secondary pass and still render normally in the main view. The same guard is added to render() for symmetry, although LevelRenderContext#levelState was never observed to be null in practice. Fixes Earthcomputer#811 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016LE8JscQsjVStsxdM6WcJV
Owner
|
Please respond to my comment on the issue |
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.
Fixes #811.
RenderQueue'sEND_EXTRACTIONhandler assumesLevelExtractionContext#levelStateis non-null. Immersive Portals runs a second extraction pass for a portal's
destination world from
SecondaryWorldRenderCore.renderDestWorld, and that pass hasno level render state — so the handler NPEs and the game crashes the moment a portal
is on screen.
This skips the extraction when there is no level state. The shapes simply aren't
collected for the secondary pass and still render normally in the main view; the only
visible consequence is that clientcommands' overlays don't draw inside a portal view.
The same guard is added to
render()for symmetry, but I want to flag that I couldnot get it to trigger —
LevelRenderContext#levelStatestayed non-null through everyportal pass I observed. Happy to drop that half if you'd rather keep it minimal.
Testing
Built this against 26.2 and played with Seamless Portals (Immersive Portals engine)
for a while: no crash, portals still render see-through with stock Immersive Portals
config, and
/cenchantworks end to end (RNG cracked, enchantment manipulation,seed ready).
To be sure nothing else was in play, I diffed the resulting jar against the released
2.15.1 artifact — only
RenderQueue*.classandbuild_info.jsondiffer, the other1293 entries are byte-identical.
Reproduction, full stack trace, and a note about the same unguarded call in the
bundled
simplewaypointsare in #811.🤖 Generated with Claude Code
https://claude.ai/code/session_016LE8JscQsjVStsxdM6WcJV