Structure pieces schedule the fluid ticks of the fluids they place

StructurePiece.placeBlock schedules a tick for the fluid of every block it
sets (the lava of a stronghold's portal room, a fortress's lava wells, water
in a monument or a mineshaft); in a WorldGenRegion it lands in the proto
chunk and runs once the chunk is live. The port treated it as a no-op, so
those fluids sat still until a neighbour changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-14 00:04:56 +02:00
parent 147ea6661f
commit 317da28481
@@ -53,6 +53,13 @@ pub trait PieceWorld {
/// `addFreshEntity`: an entity from its NBT (absolute `Pos`).
fn entity(&mut self, nbt: Compound) -> Result<()>;
fn post_process(&mut self, pos: [i32; 3]) -> Result<()>;
/// `scheduleTick(pos, fluid, delay)`: kept in the proto chunk until it is live.
fn fluid_tick(
&mut self,
pos: [i32; 3],
fluid: crate::fluid::FluidKind,
delay: i32,
) -> Result<()>;
/// WorldGenLevel.getSeed.
fn seed(&mut self) -> Result<i64>;
/// Draws from WorldGenLevel.getRandom (the region random).
@@ -107,6 +114,14 @@ impl<W: FeatureWorld + PlacementContext> PieceWorld for W {
fn post_process(&mut self, pos: [i32; 3]) -> Result<()> {
self.mark_postprocessing(pos)
}
fn fluid_tick(
&mut self,
pos: [i32; 3],
fluid: crate::fluid::FluidKind,
delay: i32,
) -> Result<()> {
self.schedule_fluid_tick(pos, fluid, delay)
}
fn seed(&mut self) -> Result<i64> {
self.world_seed()
}
@@ -381,7 +396,7 @@ impl PieceFrame {
c.world.set(pos, state, 2)?;
let fluid = c.world.fluid(pos)?;
if fluid.kind() != crate::fluid::FluidKind::Empty {
// scheduleTick(pos, fluid, 0) is a no-op for generation output.
c.world.fluid_tick(pos, fluid.kind(), 0)?;
}
if matches!(
c.name(state),