Skip to content

render text be, not baked#138

Open
reoseah wants to merge 1 commit intoModFest:26.1from
reoseah:26.1
Open

render text be, not baked#138
reoseah wants to merge 1 commit intoModFest:26.1from
reoseah:26.1

Conversation

@reoseah
Copy link
Copy Markdown

@reoseah reoseah commented Apr 5, 2026

Trying to render text with in the "baked" method gives this problem on Font#width(text) and I don't see how to center text:

Caused by: java.lang.IllegalStateException: Rendersystem called from wrong thread
    at knot//com.mojang.blaze3d.systems.RenderSystem.constructThreadException(RenderSystem.java:113)
    at knot//com.mojang.blaze3d.systems.RenderSystem.assertOnRenderThread(RenderSystem.java:108)
    at knot//com.mojang.blaze3d.opengl.GlStateManager._bindTexture(GlStateManager.java:406)
    at knot//com.mojang.blaze3d.opengl.GlCommandEncoder.writeToTexture(GlCommandEncoder.java:203)
    at knot//com.mojang.blaze3d.systems.CommandEncoder.writeToTexture(CommandEncoder.java:293)
    at knot//net.minecraft.client.gui.font.providers.BitmapProvider$Glyph$1.upload(BitmapProvider.java:221)
    at knot//net.minecraft.client.gui.font.FontTexture.add(FontTexture.java:45)
    at knot//net.minecraft.client.gui.font.GlyphStitcher.stitch(GlyphStitcher.java:39)
    at knot//net.minecraft.client.gui.font.FontSet$2.stitch(FontSet.java:51)
    at knot//net.minecraft.client.gui.font.providers.BitmapProvider$Glyph.bake(BitmapProvider.java:198)
    at knot//net.minecraft.client.gui.font.FontSet$DelayedBake.get(FontSet.java:205)
    at knot//net.minecraft.client.gui.font.FontSet$DelayedBake.get(FontSet.java:194)
    at knot//net.minecraft.client.gui.font.FontSet$Source.getGlyph(FontSet.java:230)
    at knot//net.minecraft.client.gui.Font.lambda$new$0(Font.java:49)
    at knot//net.minecraft.client.StringSplitter.lambda$stringWidth$2(StringSplitter.java:56)
    at knot//net.minecraft.util.StringDecomposer.feedChar(StringDecomposer.java:17)
    at knot//net.minecraft.util.StringDecomposer.iterate(StringDecomposer.java:43)
    at knot//net.minecraft.util.FormattedCharSequence.lambda$forward$0(FormattedCharSequence.java:23)
    at knot//net.minecraft.client.StringSplitter.stringWidth(StringSplitter.java:55)
    at knot//net.minecraft.client.gui.Font.width(Font.java:362)
    at knot//dev.hephaestus.glowcase.client.render.block.entity.TextBlockEntityRenderer.submitForBaking(TextBlockEntityRenderer.java:100)

Old commented out code in the same file lower can probably be removed now, just move non-baked code to baked one if you can fix the thread error

@reoseah
Copy link
Copy Markdown
Author

reoseah commented Apr 5, 2026

Oh, I moved shouldBake method to the top of the class, I think that's more logical then having it at the bottom

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