fix(UC-02): arch review — furniture x/z offsets + ceiling chain fidelity
- Add x_offset/z_offset to PositionedBlock for multi-block furniture clusters - Furniture items now spread across 2-3 positions (matching original Java code) - Offsets multiplied by inward direction for correct corner orientation - Fix has_ceiling_chain: only oubliette has ceiling chains (was true for all 6) - Fix firstCornerSpecial: oubliette cauldron uses x/z offset +1 (inward diagonal) - Update parser to read x_offset/z_offset (defaults to 0)
This commit is contained in:
@@ -660,24 +660,35 @@ public class HangingCagePiece extends StructurePiece {
|
||||
}
|
||||
|
||||
// First corner special (e.g. water cauldron, skull, TNT, sculk catalyst)
|
||||
// x/z offsets are multiplied by inward direction (toward room center)
|
||||
if (deco.firstCornerSpecial() != null && corners.length > 0) {
|
||||
int[] sc = corners[0];
|
||||
if (layout.isInShape(sc[0], sc[1]) && !layout.isWall(sc[0], sc[1])) {
|
||||
int dirX = sc[0] < 6 ? 1 : -1;
|
||||
int dirZ = sc[1] < 6 ? 1 : -1;
|
||||
int scx = sc[0] + deco.firstCornerSpecial().xOffset() * dirX;
|
||||
int scz = sc[1] + deco.firstCornerSpecial().zOffset() * dirZ;
|
||||
if (layout.isInShape(scx, scz) && !layout.isWall(scx, scz)) {
|
||||
safeSetBlock(level,
|
||||
new BlockPos(baseX + sc[0], floorY + deco.firstCornerSpecial().yOffset(), baseZ + sc[1]),
|
||||
new BlockPos(baseX + scx, floorY + deco.firstCornerSpecial().yOffset(), baseZ + scz),
|
||||
deco.firstCornerSpecial().state(), chunkBB);
|
||||
}
|
||||
}
|
||||
|
||||
// Furniture cluster at corners[1] (e.g. barrel+brewing_stand, soul_campfire+cauldron)
|
||||
// Furniture cluster at corners[1] — each item has x/z offsets relative to the
|
||||
// base furniture position. x_offset/z_offset values are multiplied by the
|
||||
// inward direction (toward room center) to handle all 4 corner orientations.
|
||||
if (corners.length > 1) {
|
||||
int[] fc = corners[1];
|
||||
int fcx = fc[0] + (fc[0] < 6 ? 1 : -1);
|
||||
int fcz = fc[1] + (fc[1] < 6 ? 1 : -1);
|
||||
if (layout.isInShape(fcx, fcz) && !layout.isWall(fcx, fcz)) {
|
||||
for (DecorationConfig.PositionedBlock pb : deco.furnitureCluster()) {
|
||||
int dirX = fc[0] < 6 ? 1 : -1;
|
||||
int dirZ = fc[1] < 6 ? 1 : -1;
|
||||
int fcx = fc[0] + dirX;
|
||||
int fcz = fc[1] + dirZ;
|
||||
for (DecorationConfig.PositionedBlock pb : deco.furnitureCluster()) {
|
||||
int px = fcx + pb.xOffset() * dirX;
|
||||
int pz = fcz + pb.zOffset() * dirZ;
|
||||
if (layout.isInShape(px, pz) && !layout.isWall(px, pz)) {
|
||||
safeSetBlock(level,
|
||||
new BlockPos(baseX + fcx, floorY + pb.yOffset(), baseZ + fcz),
|
||||
new BlockPos(baseX + px, floorY + pb.yOffset(), baseZ + pz),
|
||||
pb.state(), chunkBB);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user