ref:734948af1d971ec97cee30e86225b0d05d74f9b3

Fix multi-block rendering: continuous screen across blocks

Bugs fixed: - Controller block rendered full UVs instead of its sub-region (now ALL blocks in a group use getSubRegion UVs) - Margins between blocks in a group (now m=0 for grouped blocks) - onPlace only rescanned the new block, not neighbors (now rescans all 6 adjacent blocks too) Visual test updated to rescan all blocks in the multi-block grid on the client side and verify terminal background + text pixels across both single-block and 3x2 multi-block configurations. 52 Rust + 35 GameTests + visual test (2/2 pass), all green. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SHA: 734948af1d971ec97cee30e86225b0d05d74f9b3
Author: Cole Christensen <cole.christensen@macmillan.com>
Date: 2026-03-20 08:25
Parents: 4bb0fdf
3 files changed +232 -198
Type
common/src/main/java/io/fangorn/alacrittymc/block/TerminalBlock.java +11 −2
@@ -97,10 +97,19 @@
@Override
public void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean movedByPiston) {
super.onPlace(state, level, pos, oldState, movedByPiston);
// Scan for multi-block groups when a terminal block is placed
// Scan for multi-block groups when a terminal block is placed.
// Rescan THIS block AND all adjacent terminal blocks so the entire
// group forms correctly regardless of placement order.
// Runs on both client (for rendering) and server (for group state tracking)
BlockEntity be = level.getBlockEntity(pos);
if (be instanceof TerminalBlockEntity terminalBE) {
terminalBE.rescanGroup();
}
// Also rescan all 4 horizontal neighbors + up/down
for (Direction dir : new Direction[]{Direction.NORTH, Direction.SOUTH, Direction.EAST, Direction.WEST, Direction.UP, Direction.DOWN}) {
BlockPos neighbor = pos.relative(dir);
BlockEntity neighborBE = level.getBlockEntity(neighbor);
if (neighborBE instanceof TerminalBlockEntity neighborTBE) {
neighborTBE.rescanGroup();
}
}
}