From a7b8c3f85e9edb12183f5a7553737244ccbe379a Mon Sep 17 00:00:00 2001 From: koolBEANS829 Date: Tue, 8 Sep 2026 14:21:05 -0400 Subject: [PATCH] Don't assume a level render state exists during extraction 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 extractWaypointBoxes NPEs as soon as a portal is on screen. This only shows up once the world has a waypoint, since the empty waypoint map returns early before reaching levelState(). Skip the extraction when there is no level state. Waypoints are simply not collected for the secondary pass and still render normally in the main view. Fixes #11 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_016LE8JscQsjVStsxdM6WcJV --- .../xpple/simplewaypoints/impl/WaypointRenderingHelper.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/dev/xpple/simplewaypoints/impl/WaypointRenderingHelper.java b/src/main/java/dev/xpple/simplewaypoints/impl/WaypointRenderingHelper.java index d63cdf9..bb62baa 100644 --- a/src/main/java/dev/xpple/simplewaypoints/impl/WaypointRenderingHelper.java +++ b/src/main/java/dev/xpple/simplewaypoints/impl/WaypointRenderingHelper.java @@ -165,6 +165,12 @@ private static void renderWaypointMarkers(GuiGraphicsExtractor guiGraphicsExtrac } private static void extractWaypointBoxes(LevelExtractionContext context) { + // Mods that render a secondary world (e.g. Immersive Portals' portal + // destination pass) run extraction with no level render state. + if (context.levelState() == null) { + return; + } + String worldIdentifier = SimpleWaypointsImpl.INSTANCE.getWorldIdentifier(Minecraft.getInstance()); if (worldIdentifier == null) { return;