Show which structure piece a dust-inspected block belongs to

Jigsaw pieces record a placement marker only on storage blocks, so the
dust called every other piece block "decoration/object/stilt". Where no
marker exists, the dust now asks the modules: ObjectsAt.placementAt is
a new default API method, and the structure module answers it by
assembling the starts within structure reach again and returning the
piece whose box holds the block. A lone surface piece takes its height
from the terrain when placed, so only its column has to match.

The Bukkit and modded dust both print "Placed by: structure '<key>'
piece '<object>'", translated in every bundled locale.
This commit is contained in:
piexel committed 2026-11-11 18:05:49 +01:00
1 parent e9b80420de
commit f4821f7b0d
29 files changed
+354 -28

No files matched your search

@@ -21,6 +21,7 @@ package art.arcane.iris.modded.command;
import art.arcane.iris.modded.ModdedIrisLog;
import art.arcane.iris.core.localization.IrisLanguage;
import art.arcane.iris.core.localization.RuntimeUiMessages;
import art.arcane.iris.core.modules.ModuleServices;
import art.arcane.iris.engine.framework.Engine;
import art.arcane.iris.engine.framework.GenerationSessionException;
import art.arcane.iris.engine.framework.GenerationSessionLease;
@@ -253,6 +254,8 @@ public final class ModdedDustRevealer {
String objectKey = safe(
"object lookup at " + coordinates(pos),
() -> engine.getObjectPlacementKey(x, relativeY, z));
ModuleServices.PlannedPlacement structurePiece = objectKey == null
? plannedStructurePiece(engine, pos, x, relativeY, z) : null;
IrisBiome surfaceBiome = safe(
"surface biome lookup at " + x + ", " + z,
() -> engine.getSurfaceBiome(x, z));
@@ -279,8 +282,9 @@ public final class ModdedDustRevealer {
), false));
if (offset != null && surfaceY != null) {
lines.add(new DustLine(positionLine(offset, surfaceY), true));
lines.add(new DustLine(
placementLine(offset, surfaceRelative, relativeY, objectKey), true));
lines.add(new DustLine(structurePiece != null
? structurePieceLine(structurePiece)
: placementLine(offset, surfaceRelative, relativeY, objectKey), true));
}
lines.add(new DustLine(IrisLanguage.plain(
RuntimeUiMessages.DUST_OBJECT_AT_BLOCK,
@@ -290,7 +294,7 @@ public final class ModdedDustRevealer {
? IrisLanguage.plain(RuntimeUiMessages.DUST_NONE)
: objectKey)
), false));
if (objectKey == null) {
if (objectKey == null && structurePiece == null) {
String columnObject = findColumnObject(engine, x, relativeY, z, minHeight);
lines.add(new DustLine(IrisLanguage.plain(
columnObject == null
@@ -388,6 +392,21 @@ public final class ModdedDustRevealer {
MessageArgument.trusted("depth", Math.max(0, surfaceRelative - relativeY)));
}
static String structurePieceLine(ModuleServices.PlannedPlacement structurePiece) {
return IrisLanguage.plain(
RuntimeUiMessages.DUST_PLACED_BY_STRUCTURE_PIECE,
MessageArgument.untrusted("structure", structurePiece.structure().orElseThrow()),
MessageArgument.untrusted("object", structurePiece.object()));
}
/** The structure piece a module plans at the block, where generation recorded none; null when no piece covers it. */
private static ModuleServices.PlannedPlacement plannedStructurePiece(Engine engine, BlockPos pos, int x, int relativeY, int z) {
ModuleServices.PlannedPlacement planned = safe(
"structure piece lookup at " + coordinates(pos),
() -> ModuleServices.plannedPlacementAt(engine, x, relativeY, z).orElse(null));
return planned != null && planned.structure().isPresent() ? planned : null;
}
private static String findColumnObject(Engine engine, int x, int relativeY,
int z, int minHeight) {
int maxRelativeY = engine.getMaxHeight() - minHeight - 1;