26.2 - #490
Conversation
- 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
|
we need this man |
Noaaan
left a comment
There was a problem hiding this comment.
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.
| @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(); | ||
| } |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Is the GUI being hidden fully removed or just moved somewhere else?
There was a problem hiding this comment.
Needs verification from someone with blur expertise
There was a problem hiding this comment.
This being a workaround would be nice if it can be removed. Needs verification
- 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
- 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)); |
- 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 |
There was a problem hiding this comment.
The latest version of Gradle is 9.6.1.
| distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip | |
| distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip |
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-inmenuBackgroundBlurriness.BlurQuadElementRenderState— changed from aGuiElementRenderStaterecord to a static utility withblurBackground(GuiRenderState, float, float).blur.fsh,blur.vsh) — removed.net.minecraft.util.Tuple→ replaced by newio.wispforest.owo.util.Pair<A, B>.Changed
TextOps.color(ChatFormatting)andColor.ofFormatting()— use hardcoded switch instead of removedChatFormatting.getColor()/isColor()/getName().I18n.exists(key)→Language.getInstance().has(key)(MC 26.2 removedI18n.exists).Minecraft.setScreen()/.screen→Minecraft.gui.setScreen()/.gui.screen().withBindGroupLayout,withPrimitiveTopology,withVertexBinding).LevelRendererMixin→LevelRenderEvents.COLLECT_SUBMITSevent.TextureTargetrequiresGpuFormat.RGBA8_UNORMparameter.EntityComponentandEntityWidget— added reflection-basedassignClientEntityId()workaround (MC 26.2 requires non-zero entity IDs for rendering).Post-Review Fixes Applied
Based on Noaaan's review and subsequent testing:
guiWidth()/guiHeight()are called fromOwoUIGraphicssuper constructor via polymorphic dispatch beforethis.surfaceis assigned.itemgroup/MinecraftMixin— deleted (was never registered in mixins JSON).org.joml.Vector4fimports forBraidWindowandTextureSurface.braid.Color.formatting()andowo-ui.Color.ofFormatting()now delegate toTextOps.color().ComboBoxButtons— replaced hardcodedColor.rgb(0xFFFF55)withColor.formatting(ChatFormatting.YELLOW).Language.getInstance().has()— replaced!I18n.get(key).equals(key)pattern inConfigScreenandConfigEnumButton.Vector4fimport — removed fromCubeMapMixin.BraidWindow.open()— added try-catch error logging (secondary OS window creation was failing silently).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
BraidDisplay world-space UI — text rendering restored. MC 26.2's
GlyphRenderState.bounds()returnsnullfor some text elements, causingGuiRenderState.findAppropriateNode()to silently drop them. Fixed withallowNullBounds@WrapOperationinGuiRenderStateMixin: treatsnullbounds as acceptable acrossaddItem,addText,addPicturesInPictureState,addGuiElement.BraidDisplay world-space UI — scissor crash prevented. MC 26.2 passes
w=0 h=0scissor rects toenableScissor()during BraidDisplay rendering. Fixed withowo$skipZeroSizeScissor@WrapOperationinGuiRendererMixin: when width or height <= 0, callsdisableScissor()and returns instead of crashing.BraidDisplay — texture sync and null guard. Added
syncTexture()toTextureSurfaceand call it inBraidDisplay.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)
Per-widget scissored blur is no longer possible. MC 26.2's
blurBeforeThisStratum()is a full-screen stratum split. Removed that call; onlymenuBackgroundBlurrinessis now set. Blur remains functional for screen backgrounds but no longer scoped to individual widgets.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.
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.
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.