Skip to content

26.2 - #490

Draft
kouhe3 wants to merge 11 commits into
wisp-forest:26.1from
kouhe3:26.2
Draft

26.2#490
kouhe3 wants to merge 11 commits into
wisp-forest:26.1from
kouhe3:26.2

Conversation

@kouhe3

@kouhe3 kouhe3 commented Jul 15, 2026

Copy link
Copy Markdown

Summary

Port owo-lib from Minecraft 26.1 to 26.2.

API Changes

Removed

  • OwoUIPipelines.GUI_BLUR — removed. Blur now uses MC 26.2 built-in menuBackgroundBlurriness.
  • BlurQuadElementRenderState — changed from a GuiElementRenderState record to a static utility with blurBackground(GuiRenderState, float, float).
  • Custom blur shaders (blur.fsh, blur.vsh) — removed.
  • net.minecraft.util.Tuple → replaced by new io.wispforest.owo.util.Pair<A, B>.

Changed

  • TextOps.color(ChatFormatting) and Color.ofFormatting() — use hardcoded switch instead of removed ChatFormatting.getColor() / isColor() / getName().
  • I18n.exists(key)Language.getInstance().has(key) (MC 26.2 removed I18n.exists).
  • Minecraft.setScreen() / .screenMinecraft.gui.setScreen() / .gui.screen().
  • Render pipeline construction updated to MC 26.2 API (withBindGroupLayout, withPrimitiveTopology, withVertexBinding).
  • LevelRendererMixinLevelRenderEvents.COLLECT_SUBMITS event.
  • TextureTarget requires GpuFormat.RGBA8_UNORM parameter.
  • EntityComponent and EntityWidget — added reflection-based assignClientEntityId() workaround (MC 26.2 requires non-zero entity IDs for rendering).

Post-Review Fixes Applied

Based on Noaaan's review and subsequent testing:

  1. BraidGraphics null checks — kept. Initially removed in review feedback, then restored after testing revealed they ARE necessary: guiWidth()/guiHeight() are called from OwoUIGraphics super constructor via polymorphic dispatch before this.surface is assigned.
  2. ConfigScreen formatting — fixed excessive whitespace.
  3. Dead itemgroup/MinecraftMixin — deleted (was never registered in mixins JSON).
  4. Import fixes — added org.joml.Vector4f imports for BraidWindow and TextureSurface.
  5. Color switch dedupbraid.Color.formatting() and owo-ui.Color.ofFormatting() now delegate to TextOps.color().
  6. ComboBoxButtons — replaced hardcoded Color.rgb(0xFFFF55) with Color.formatting(ChatFormatting.YELLOW).
  7. Language.getInstance().has() — replaced !I18n.get(key).equals(key) pattern in ConfigScreen and ConfigEnumButton.
  8. Stale Vector4f import — removed from CubeMapMixin.
  9. BraidWindow.open() — added try-catch error logging (secondary OS window creation was failing silently).
  10. BraidDisplay "Texture view closed" crash — added try-catch guard to deactivate display on failure instead of crashing.
  11. BraidWindow GLFW window creation — fixed for OpenGL backend: added glfwDefaultWindowHints() to clear leftover MC hints, added GLFW error callback for diagnostics, and added explicit detection of Vulkan backend (throws clear error since context sharing is not supported with Vulkan).

Fixes Applied After In-Game Testing

  1. BraidDisplay world-space UI — text rendering restored. MC 26.2's GlyphRenderState.bounds() returns null for some text elements, causing GuiRenderState.findAppropriateNode() to silently drop them. Fixed with allowNullBounds @WrapOperation in GuiRenderStateMixin: treats null bounds as acceptable across addItem, addText, addPicturesInPictureState, addGuiElement.

  2. BraidDisplay world-space UI — scissor crash prevented. MC 26.2 passes w=0 h=0 scissor rects to enableScissor() during BraidDisplay rendering. Fixed with owo$skipZeroSizeScissor @WrapOperation in GuiRendererMixin: when width or height <= 0, calls disableScissor() and returns instead of crashing.

  3. BraidDisplay — texture sync and null guard. Added syncTexture() to TextureSurface and call it in BraidDisplay.render() before submitting. Added null/closed texture check to avoid crash when the underlying GL texture has been destroyed.

Known Issues (Introduced by MC 26.2 API)

  1. Per-widget scissored blur is no longer possible. MC 26.2's blurBeforeThisStratum() is a full-screen stratum split. Removed that call; only menuBackgroundBlurriness is now set. Blur remains functional for screen backgrounds but no longer scoped to individual widgets.

  2. BraidDisplay world-space UI — scissor is always disabled (0x0 rect). MC 26.2 consistently passes zero-size scissor when rendering into the BraidDisplay framebuffer, so scissor is always disabled for world-space UI. This means UI elements that rely on scissor clipping within the display will not be clipped. Acceptable trade-off to avoid crashes.

  3. BraidDisplay world-space UI — "Texture view closed" crash when entity rendering is involved (e.g. BurningChyz test). Mitigated with a try-catch guard that deactivates the display on failure instead of crashing.

  4. BraidWindow — not supported with Vulkan backend. OpenGL secondary window creation is now fixed. If MC uses the Vulkan renderer, BraidWindow explicitly throws a clear error message ("BraidWindow requires OpenGL backend...") instead of failing silently. This is a hard limitation: Vulkan windows have no OpenGL context to share.

kouhe3 added 6 commits July 14, 2026 18:31
- Gradle: Loom 1.17, FAPI 0.154.2+26.2, Loader 0.19.3, Gradle 9.5.1
- API migrations: gui.setScreen/gui.screen/gui.toastManager, GameRenderer
  getter prefix removal, PrimitiveTopology, TextureTarget+GpuFormat,
  WSTM+UUID, ChatFormatting color lookup table, I18n.exists→get fallback,
  UNIFORM_FONT→DEFAULT_FONT, Options.hideGui removed, EntityType→EntityTypes
- Rendering: MultiBufferSource→SubmitNodeCollector, PIP renderers rewritten,
  GuiRenderer constructor simplified, BraidGuiRenderer adapted
- New: io.wispforest.owo.util.Pair replacing net.minecraft.util.Tuple
- Disabled (needs 26.2-native rewrite): BlurQuad (inRenderPass),
  LevelRendererMixin (SubmitNodeStorage), ui/display GuiMixin crosshair,
  AbstractContainerScreenMixin doNoThrow, GlCommandEncoder blur accessor
- Braid Display: replace broken LevelRendererMixin with
  FAPI LevelRenderEvents.COLLECT_SUBMITS callback in OwoClient
- EntityComponent: assign non-zero entity ID via reflection
  to prevent Entity.getId() throw in 26.2 during extractEntity
- Replace custom BlurQuadElementRenderState/GUI_BLUR shader with GuiRenderState.blurBeforeThisStratum()
- Delete GlCommandEncoderAccessor (inRenderPass hack obsolete)
- Delete GuiRendererMixin (blur element check no longer needed)
- Add GuiRenderStateMixin: make blurBeforeThisStratum idempotent to prevent crash on duplicate calls
- Map owo blur quality to MC menuBackgroundBlurriness option
- display/GuiMixin: retarget from Gui to Hud (crosshair sprite moved in 26.2)
- AbstractContainerScreenMixin/doNoThrow: new @at STORE ordinal=2 replaces deleted OptionInstance.get() anchor
@noramibu

Copy link
Copy Markdown

we need this man

@Noaaan Noaaan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went over the codebase real quick to make sure there weren't any obvious errors. Most of these changes seem okay. There are some easy fixes, and some that I am currently not able to verify due to lack fo experience with the repo. That is something for the main developers (@Dragon-Seeker or @gliscowo) to look over.

Right now this PR is not ready to be used. Spending a minute in the test mod already crashes when trying to use the debug items.

Comment thread src/main/java/io/wispforest/owo/braid/core/Color.java Outdated
Comment thread src/main/java/io/wispforest/owo/braid/core/BraidWindow.java Outdated
Comment on lines 43 to 51
@Override
public int guiWidth() {
return this.surface.width();
return this.surface != null ? this.surface.width() : super.guiWidth();
}

@Override
public int guiHeight() {
return this.surface.height();
return this.surface != null ? this.surface.height() : super.guiHeight();
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these null checks actually needed?

this.framebufferWidth = framebufferWidthOut[0];
this.framebufferHeight = framebufferHeightOut[0];
this.remoteTarget = new TextureTarget("braid window", this.framebufferWidth, this.framebufferHeight, true);
this.remoteTarget = new TextureTarget("braid window", this.framebufferWidth, this.framebufferHeight, true, GpuFormat.RGBA8_UNORM);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine, although this should be reviewed as there are a lot of different GpuFormats to choose from.
There are several instances of this used throughout this PR.

Comment thread src/main/java/io/wispforest/owo/braid/core/TextureSurface.java Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs review from someone else with better shader experience than me


HudElementRegistry.addLast(Identifier.fromNamespaceAndPath("owo", "owo_ui_hud"), (context, tickCounter) -> {
if (adapter == null || suppress || Minecraft.getInstance().options.hideGui) return;
if (adapter == null || suppress) return;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the GUI being hidden fully removed or just moved somewhere else?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs verification from someone with blur expertise

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This being a workaround would be nice if it can be removed. Needs verification

Comment thread CHANGELOG.md Outdated
kouhe3 added a commit to kouhe3/owo-lib that referenced this pull request Jul 16, 2026
- Remove unnecessary null checks in BraidGraphics (surface is always non-null)
- Fix ConfigScreen formatting (excessive whitespace)
- Delete dead itemgroup/MinecraftMixin (unregistered, targets wrong class)
- Add imports for Vector4f in BraidWindow and TextureSurface
- Remove stale Vector4f import from CubeMapMixin
- Deduplicate ChatFormatting→RGB switch: braid.Color and owo-ui.Color now delegate to TextOps.color()
- Use Color.formatting() instead of hardcoded RGB in ComboBoxButtons
- Replace I18n.get().equals() pattern with Language.getInstance().has()
- Remove CHANGELOG.md per reviewer request
kouhe3 added a commit to kouhe3/owo-lib that referenced this pull request Jul 16, 2026
- Remove unnecessary null checks in BraidGraphics (surface is always non-null)
- Fix ConfigScreen formatting (excessive whitespace)
- Delete dead itemgroup/MinecraftMixin (unregistered, targets wrong class)
- Add imports for Vector4f in BraidWindow and TextureSurface
- Remove stale Vector4f import from CubeMapMixin
- Deduplicate ChatFormatting→RGB switch: braid.Color and owo-ui.Color now delegate to TextOps.color()
- Use Color.formatting() instead of hardcoded RGB in ComboBoxButtons
- Replace I18n.get().equals() pattern with Language.getInstance().has()
- Remove CHANGELOG.md per reviewer request
- Remove unnecessary null checks in BraidGraphics (surface is always non-null)
- Fix ConfigScreen formatting (excessive whitespace)
- Delete dead itemgroup/MinecraftMixin (unregistered, targets wrong class)
- Add imports for Vector4f in BraidWindow and TextureSurface
- Remove stale Vector4f import from CubeMapMixin
- Deduplicate ChatFormatting→RGB switch: braid.Color and owo-ui.Color now delegate to TextOps.color()
- Use Color.formatting() instead of hardcoded RGB in ComboBoxButtons
- Replace I18n.get().equals() pattern with Language.getInstance().has()
- Remove CHANGELOG.md per reviewer request
case WHITE -> 0xFFFFFF;
default -> null;
};
return ofRgb(io.wispforest.owo.ops.TextOps.color(formatting));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

importing this would be better

kouhe3 added 4 commits July 16, 2026 15:43
- Restore null checks in BraidGraphics.guiWidth/Height (called from super constructor before surface assignment)
- Remove blurBeforeThisStratum() call (MC 26.2 API causes full-screen blur instead of widget-local blur)
- Add assignClientEntityId() to EntityWidget (MC 26.2 requires non-zero entity IDs)
- Catch BraidDisplay rendering failures — deactivate display instead of crashing game
BraidWindow (separate OS window) button no longer works in 26.2.
Likely GLFW context sharing issue with MC 26.2 GPU backend.
Added try-catch and error logging to prevent silent failure.
- Add glfwDefaultWindowHints() to clear leftover hints from MC window creation
- Add GLFW error callback for diagnostic logging on glfwCreateWindow failure
- Add Vulkan backend detection with clear error message (context sharing not supported)
- Fix text not rendering: allowNullBounds mixin in GuiRenderStateMixin — GlyphRenderState.bounds() may return null in MC 26.2, which caused findAppropriateNode() to drop text elements

- Fix scissor crash: skipZeroSizeScissor wrap in GuiRendererMixin — MC 26.2 passes w=0 h=0 scissor rects; disable scissor instead of crashing

- Add TextureSurface.syncTexture() and call it in BraidDisplay.render() to sync texture before submit

- Add null/closed texture guard in BraidDisplay.render() to avoid crash when GL texture is destroyed
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest version of Gradle is 9.6.1.

Suggested change
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip

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.

5 participants