Expand destination preview snapshots
Build / build (push) Canceled after 0s

This commit is contained in:
dnorberg committed 2026-09-21 09:53:10 -04:00
1 parent 0de817b28a
commit 3760b0dea3
5 files changed
+9 -6

No files matched your search

+1 -1
View File
@@ -25,7 +25,7 @@ right-clicking with an empty hand. Sneak-right-click with an empty hand to take
the book back and restore the vanilla lectern. Breaking a Book Stand drops both the book back and restore the vanilla lectern. Breaking a Book Stand drops both
the stored book and a vanilla lectern. the stored book and a vanilla lectern.
Bound Linking Books request a server-validated 18-by-18-by-18 snapshot around Bound Linking Books request a server-validated 32-by-32-by-32 snapshot around
their destination. The book keeps its target-centered close-up framing as a their destination. The book keeps its target-centered close-up framing as a
rotating Ponder scene on the left page, backed by the rotating Ponder scene on the left page, backed by the
destination biome's sky color. The snapshot is visual only; the server destination biome's sky color. The snapshot is visual only; the server
+3
View File
@@ -165,6 +165,9 @@ terrain-aware search for an alternate grounded location near an unsafe target.
Version 0.2.5 uses dimension-appropriate preview skies for vanilla Nether and Version 0.2.5 uses dimension-appropriate preview skies for vanilla Nether and
End destinations instead of their inherited Overworld biome sky tint. End destinations instead of their inherited Overworld biome sky tint.
Version 0.2.6 expands destination snapshots to a 32-by-32-by-32 cube while
keeping the existing target-centered Ponder camera position.
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 populated from server-authoritative destination snapshots. Ponder level populated from server-authoritative destination snapshots.
+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.2.5 mod_version=0.2.6
# 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
@@ -118,9 +118,9 @@ public final class PonderDestinationPreviewRenderer implements DestinationPrevie
poseStack.mulPose(Axis.YP.rotationDegrees((ticks + partialTick) * 0.6F)); poseStack.mulPose(Axis.YP.rotationDegrees((ticks + partialTick) * 0.6F));
UIRenderHelper.flipForGuiRender(poseStack); UIRenderHelper.flipForGuiRender(poseStack);
poseStack.scale(7.0F, 7.0F, 7.0F); poseStack.scale(7.0F, 7.0F, 7.0F);
// The target moves from (4, 32, 4) to (9, 9, 9) in the cubic // The target sits at (16, 16, 16) in the 32-cube. Offset it exactly
// snapshot, so retain its existing camera position relative to it. // as before so expanding the snapshot does not move the camera.
poseStack.translate(-9.5F, -8.5F, -9.5F); poseStack.translate(-16.5F, -15.5F, -16.5F);
SuperRenderTypeBuffer buffer = DefaultSuperRenderTypeBuffer.getInstance(); SuperRenderTypeBuffer buffer = DefaultSuperRenderTypeBuffer.getInstance();
section.renderFirst(previewLevel, buffer, graphics, partialTick); section.renderFirst(previewLevel, buffer, graphics, partialTick);
@@ -13,7 +13,7 @@ import net.minecraft.world.level.block.state.BlockState;
public record LinkPreviewPayload(int skyColor, List<SnapshotBlock> blocks) implements CustomPacketPayload { public record LinkPreviewPayload(int skyColor, List<SnapshotBlock> blocks) implements CustomPacketPayload {
/** Each axis of the destination volume captured for the book preview. */ /** Each axis of the destination volume captured for the book preview. */
public static final int SNAPSHOT_SIZE = 18; public static final int SNAPSHOT_SIZE = 32;
/** A square footprint keeps every side visible during an orbit. */ /** A square footprint keeps every side visible during an orbit. */
private static final int MAX_BLOCKS = SNAPSHOT_SIZE * SNAPSHOT_SIZE * SNAPSHOT_SIZE; private static final int MAX_BLOCKS = SNAPSHOT_SIZE * SNAPSHOT_SIZE * SNAPSHOT_SIZE;
public static final Type<LinkPreviewPayload> TYPE = new Type<>( public static final Type<LinkPreviewPayload> TYPE = new Type<>(