Skip to content

feat: add Minecraft 26.2 (Fabric) support - #92

Open
Shirakawa-Kotone wants to merge 2 commits into
Octol1ttle:devfrom
Shirakawa-Kotone:mc-26.2-support
Open

feat: add Minecraft 26.2 (Fabric) support#92
Shirakawa-Kotone wants to merge 2 commits into
Octol1ttle:devfrom
Shirakawa-Kotone:mc-26.2-support

Conversation

@Shirakawa-Kotone

@Shirakawa-Kotone Shirakawa-Kotone commented Aug 6, 2026

Copy link
Copy Markdown

Summary

Adds support for Minecraft 26.2 (Fabric), which replaced the immediate-mode GuiGraphics rendering with a CPU-side render-state (extraction) model.

All changes are guarded with stonecutter version conditionals (//? if >=26), so the existing 1.20.1–1.21.11 versions are preserved and 26.2 is added as an additional supported version.

What changed

  • Toolchain: Kotlin 2.4.10, modstitch 0.8.5, fabric-loom 1.15.5
  • Java targeting: per-version (25 for 26.x, 21 for 1.20.6+, 17 for older)
  • Wire modstitch-generated (preprocessed) sources into the compile source set
  • New versions/26.2-fabric version directory
  • HUD port to the render-state model: GuiGraphicsExtractor shims in GuiGraphicsCompat26.kt, new GuiMixinHud26 hook on Hud.extractRenderState, extractContents/extractContent/extractRenderState adaptations for screens, buttons and widgets
  • Mixin updates: LevelRenderer.render (renamed from renderLevel) with CameraRenderState, Camera accessor via gameRenderer.mainCamera()
  • Projection fix: 26.x uses a reversed-Z depth buffer, which broke the world→screen visibility check (pos.z range) — points behind the camera were mirrored back into view. ScreenSpace.fromWorldSpace now rejects points at/behind the camera plane (clip.w <= 0)

Validation

  • :26.2-fabric:build succeeds; the mod runs in-game on 26.2 (HUD, arrows, projection all verified).
  • :1.21.11-fabric:build verified — the 26.x-only compat imports are version-gated and GuiMixinHud26 is a @Pseudo mixin so older versions still compile.
  • Other older versions (1.20.1–1.21.9) were not re-built locally; their code paths are unchanged and version-gated, but CI should re-run their builds.

Port FlightAssistant to Minecraft 26.2, which replaced the immediate-mode
GuiGraphics rendering with a CPU-side render-state (extraction) model.

- Update the toolchain: Kotlin 2.4.10, modstitch 0.8.5, fabric-loom 1.15.5
- Target the correct Java version per MC version (25 for 26.x, 21 for
  1.20.6+, 17 for older versions)
- Wire modstitch-generated (preprocessed) sources into the compile source set
- Add a 26.2-fabric version directory
- Port the HUD to GuiGraphicsExtractor / extractRenderState on 26.x
  (GuiGraphicsCompat26 shims, GuiMixinHud26, Screen/Gui/Hud extraction hooks)
- Adapt the LevelRenderer / Camera mixins for the new render() signature and
  CameraRenderState
- Fix ScreenSpace world-to-screen projection under the 26.x reversed-Z depth
  buffer by rejecting points at or behind the camera plane (clip.w <= 0)
The 26.x port added unconditional imports of compatibility extensions
(setScreen, screen, overlay, color, render) that only exist on 26+ (defined
in GuiGraphicsCompat26.kt). On older versions these resolve to vanilla
members, so the imports must only be present on 26+.

Also make GuiMixinHud26 (which targets net.minecraft.client.gui.Hud,
renamed from Gui in 26.x) a @pseudo mixin with a string target so it
compiles and is safely skipped on older versions where Hud does not exist.
JoshSald added a commit to JoshSald/FlightAssistant that referenced this pull request Sep 11, 2026
Three separate issues in the world-space -> screen-space pipeline
that fed the attitude ladder, heading tape, and flight path vector,
found by comparing against Octol1ttle#92:

- LevelRenderer.renderLevel's three matrices (frustum/projection/
  culling-projection) collapsed into a single Matrix4fc parameter on
  26.1. It's the frustum/view matrix, not the projection matrix as
  first assumed - the real projection matrix now lives on
  CameraRenderState.projectionMatrix. Using the wrong matrix in the
  wrong role corrupted every downstream world-space HUD calculation.
- ScreenSpace read the GL viewport via glGetIntegerv, which is stale
  during 26.1's new CPU-side render-state extraction phase. Now reads
  mc.window's dimensions directly instead.
- 26.1 uses a reversed-Z depth range, which broke the existing
  on-screen check: points behind the camera were mirrored back into
  the visible depth window instead of being rejected, so e.g. both
  ends of the pitch-limit indicator would render regardless of actual
  camera orientation. fromWorldSpace now explicitly rejects points at
  or behind the camera plane (clip.w <= 0) before projecting.

Also stopped reading RenderSystem.getModelViewMatrix() on 26.1+, which
is equally stale during extraction - it's now taken as identity, matching
the reference fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant