fix(worldgen): give the stronghold room chest a block entity (#2543)

The chest in the stronghold square room was placed as a bare block state,
so no chest block entity was ever created for it. Opening a chest and
resolving a double chest both go through `get_block_entity`, so the chest
could neither be opened nor paired with a chest placed next to it.

Use the existing `add_chest` helper, which writes the block state and the
matching block entity with a loot table, as the nether fortress corridors
already do. Vanilla `StrongholdPieces$RoomCrossing` uses
`chests/stronghold_crossing` at the same position.
This commit is contained in:
Maxime Chaffraix
2026-07-26 11:39:46 +02:00
committed by GitHub
parent ce4f3cc1f1
commit 8a2075779b

View File

@@ -24,6 +24,10 @@ use crate::{
use crate::world::WorldPortalExt;
/// Loot table of the chest in the room variant that has one, matching vanilla
/// `StrongholdPieces$RoomCrossing`.
const CROSSING_LOOT_TABLE: &str = "minecraft:chests/stronghold_crossing";
pub struct SquareRoomPiece {
piece: StrongholdPiece,
room_type: u32,
@@ -272,8 +276,7 @@ impl StructurePieceBase for SquareRoomPiece {
inner.add_block(chunk, ladder, 9, 3, 3, &box_limit);
// Chest
// p.add_chest(chunk, &box_limit, random, 3, 4, 8, LootTables::StrongholdCrossingChest);
inner.add_block(chunk, Block::CHEST.default_state, 3, 4, 8, &box_limit);
inner.add_chest(chunk, &box_limit, random, 3, 4, 8, CROSSING_LOOT_TABLE);
}
_ => {}
}