Fix book stand nameplate rendering
Build / build (push) Canceled after 0s

This commit is contained in:
dnorberg committed 2026-09-21 07:56:23 -04:00
1 parent ec82296624
commit 7b3bc328f2
3 files changed
+8 -3

No files matched your search

+3
View File
@@ -100,6 +100,9 @@ color as the book name for consistent contrast against the parchment.
Version 0.1.9 synchronizes the Book Stand's stored stack to clients and renders Version 0.1.9 synchronizes the Book Stand's stored stack to clients and renders
its display name as a camera-facing label above the book. its display name as a camera-facing label above the book.
Version 0.1.10 corrects the nameplate transform and matches Minecraft's normal
plus see-through text passes so angled stand geometry cannot hide the label.
The preview code is separated behind a renderer interface and uses an isolated The preview code is separated behind a renderer interface and uses an isolated
Ponder level. The first iteration supplies the animated loading boundary; the Ponder level. The first iteration supplies the animated loading boundary; the
next iteration will add server-authoritative snapshot transport and populate next iteration will add server-authoritative snapshot transport and populate
+1 -1
View File
@@ -33,7 +33,7 @@ mod_name=Rivencraft
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=LGPL-3.0-or-later mod_license=LGPL-3.0-or-later
# The mod version. See https://semver.org/ # The mod version. See https://semver.org/
mod_version=0.1.9 mod_version=0.1.10
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources. # This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html # See https://maven.apache.org/guides/mini/guide-naming-conventions.html
@@ -69,13 +69,15 @@ public final class BookStandRenderer implements BlockEntityRenderer<BookStandBlo
poseStack.pushPose(); poseStack.pushPose();
poseStack.translate(0.5F, 1.6F, 0.5F); poseStack.translate(0.5F, 1.6F, 0.5F);
poseStack.mulPose(entityRenderer.cameraOrientation()); poseStack.mulPose(entityRenderer.cameraOrientation());
poseStack.scale(-0.025F, -0.025F, 0.025F); poseStack.scale(0.025F, -0.025F, 0.025F);
Matrix4f matrix = poseStack.last().pose(); Matrix4f matrix = poseStack.last().pose();
float x = -font.width(name) / 2.0F; float x = -font.width(name) / 2.0F;
int background = (int)(Minecraft.getInstance().options.getBackgroundOpacity(0.25F) * 255.0F) << 24; int background = (int)(Minecraft.getInstance().options.getBackgroundOpacity(0.25F) * 255.0F) << 24;
font.drawInBatch(name, x, 0.0F, 0x20FFFFFF, false, matrix, bufferSource,
Font.DisplayMode.SEE_THROUGH, background, packedLight);
font.drawInBatch(name, x, 0.0F, 0xFFFFFFFF, false, matrix, bufferSource, font.drawInBatch(name, x, 0.0F, 0xFFFFFFFF, false, matrix, bufferSource,
Font.DisplayMode.NORMAL, background, packedLight); Font.DisplayMode.NORMAL, 0, packedLight);
poseStack.popPose(); poseStack.popPose();
} }
} }