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

@@ -1,8 +1,10 @@
package com.volmit.service;
import com.volmit.placement.PlacementRecord;
import com.volmit.resource.ResourceId;
import com.volmit.world.PackWorld;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
/** Which pack objects a module places, predicted without generating anything. The host's object search and its
@@ -26,6 +28,17 @@ public interface ObjectsAt {
*/
PlacedBy placedBy(PackWorld world, ResourceId object);
/**
* The placement this module plans to cover the block at {@code worldX}, {@code y}, {@code worldZ}, as
* {@link com.volmit.placement.PlacementTerrain#recordPlacement} would record it, predicted without generating
* anything. Y is the height above the dimension's bottom. The host's block inspection asks for it where generation
* recorded nothing at the block ({@link com.volmit.world.RunningWorld#placementAt}). Like {@link #objectsAt}, it is
* a prediction. Empty when the module plans nothing there.
*/
default Optional<PlacementRecord> placementAt(PackWorld world, int worldX, int y, int worldZ) {
return Optional.empty();
}
/** Layout entries that place an object, by their pack ids. */
record PlacedBy(Set<ResourceId> biomes, Set<ResourceId> regions) {
public static final PlacedBy NOTHING = new PlacedBy(Set.of(), Set.of());