pub struct LavaFluid;Expand description
Lava fluid implementation.
Implements FluidBehavior with lava-specific parameters and
behaviors (world-dependent spread, uphill delay, lava/water chemistry,
fizz sounds).
Implementations§
Trait Implementations§
Source§impl FlowingFluid for LavaFluid
impl FlowingFluid for LavaFluid
Source§fn spread_to(
&self,
world: &Arc<World>,
pos: BlockPos,
fluid_state: FluidState,
direction: Direction,
)
fn spread_to( &self, world: &Arc<World>, pos: BlockPos, fluid_state: FluidState, direction: Direction, )
Source§fn base_tick(
&self,
world: &Arc<World>,
pos: BlockPos,
block_state: BlockStateId,
current_fluid: FluidState,
)
fn base_tick( &self, world: &Arc<World>, pos: BlockPos, block_state: BlockStateId, current_fluid: FluidState, )
Source§fn base_spread(
&self,
world: &Arc<World>,
pos: BlockPos,
block_state: BlockStateId,
fluid_state: FluidState,
)
fn base_spread( &self, world: &Arc<World>, pos: BlockPos, block_state: BlockStateId, fluid_state: FluidState, )
Source§fn base_spread_to(
&self,
world: &Arc<World>,
pos: BlockPos,
fluid_state: FluidState,
)
fn base_spread_to( &self, world: &Arc<World>, pos: BlockPos, fluid_state: FluidState, )
Source§fn source_neighbor_count(&self, world: &Arc<World>, pos: BlockPos) -> u8
fn source_neighbor_count(&self, world: &Arc<World>, pos: BlockPos) -> u8
Source§fn spread_to_sides(
&self,
world: &Arc<World>,
pos: BlockPos,
block_state: BlockStateId,
fluid_state: FluidState,
)
fn spread_to_sides( &self, world: &Arc<World>, pos: BlockPos, block_state: BlockStateId, fluid_state: FluidState, )
Source§impl FluidBehavior for LavaFluid
impl FluidBehavior for LavaFluid
Source§fn can_be_replaced_with(
&self,
fluid_state: FluidState,
world: &Arc<World>,
pos: BlockPos,
other_fluid: FluidRef,
_direction: Direction,
) -> bool
fn can_be_replaced_with( &self, fluid_state: FluidState, world: &Arc<World>, pos: BlockPos, other_fluid: FluidRef, _direction: Direction, ) -> bool
Vanilla parity: LavaFluid.canBeReplacedWith().
Lava can be replaced if its effective height >= 0.444 and the replacer is water.
Uses get_height() (not raw amount / 9.0) so that falling lava
(same fluid directly above → height = 1.0) is also correctly handled.
Source§fn get_spread_delay(
&self,
world: &Arc<World>,
pos: BlockPos,
old_state: FluidState,
new_state: FluidState,
) -> i32
fn get_spread_delay( &self, world: &Arc<World>, pos: BlockPos, old_state: FluidState, new_state: FluidState, ) -> i32
Vanilla parity: LavaFluid.getSpreadDelay.
Uphill lava spreads 4× slower with 3/4 probability.
“Uphill” means the target position (new_state) has a greater effective
height than the source (old_state). Uses get_height() so that a
falling lava source (height = 1.0) is correctly treated as “tall”.
Source§fn before_destroying_block(
&self,
world: &Arc<World>,
pos: BlockPos,
_state: BlockStateId,
)
fn before_destroying_block( &self, world: &Arc<World>, pos: BlockPos, _state: BlockStateId, )
Vanilla parity: LavaFluid.beforeDestroyingBlock() → fizz sound.
Lava does NOT drop block items (unlike water).
Source§fn entity_inside(
&self,
_world: &Arc<World>,
_pos: BlockPos,
_entity: &dyn Entity,
effect_collector: &mut InsideBlockEffectCollector,
)
fn entity_inside( &self, _world: &Arc<World>, _pos: BlockPos, _entity: &dyn Entity, effect_collector: &mut InsideBlockEffectCollector, )
Vanilla parity: LavaFluid.entityInside() clears freezing, ignites, then applies lava damage.
Source§fn fluid_type(&self) -> FluidRef
fn fluid_type(&self) -> FluidRef
Source§fn is_same(&self, fluid: FluidRef) -> bool
fn is_same(&self, fluid: FluidRef) -> bool
Source§fn tick_delay(&self, world: &Arc<World>) -> i32
fn tick_delay(&self, world: &Arc<World>) -> i32
Source§fn drop_off(&self, world: &Arc<World>) -> u8
fn drop_off(&self, world: &Arc<World>) -> u8
world because some fluids (lava) differ by dimension.Source§fn slope_find_distance(&self, world: &Arc<World>) -> u8
fn slope_find_distance(&self, world: &Arc<World>) -> u8
world because some fluids (lava) differ by dimension.Source§fn explosion_resistance(&self) -> f32
fn explosion_resistance(&self) -> f32
Source§fn can_convert_to_source(&self, world: &Arc<World>) -> bool
fn can_convert_to_source(&self, world: &Arc<World>) -> bool
Source§fn get_flow(
&self,
world: &Arc<World>,
pos: BlockPos,
fluid_state: FluidState,
) -> DVec3
fn get_flow( &self, world: &Arc<World>, pos: BlockPos, fluid_state: FluidState, ) -> DVec3
Source§fn tick(
&self,
world: &Arc<World>,
pos: BlockPos,
block_state: BlockStateId,
fluid_state: FluidState,
)
fn tick( &self, world: &Arc<World>, pos: BlockPos, block_state: BlockStateId, fluid_state: FluidState, )
Source§fn spread(
&self,
world: &Arc<World>,
pos: BlockPos,
block_state: BlockStateId,
fluid_state: FluidState,
)
fn spread( &self, world: &Arc<World>, pos: BlockPos, block_state: BlockStateId, fluid_state: FluidState, )
Auto Trait Implementations§
impl Freeze for LavaFluid
impl RefUnwindSafe for LavaFluid
impl Send for LavaFluid
impl Sync for LavaFluid
impl Unpin for LavaFluid
impl UnsafeUnpin for LavaFluid
impl UnwindSafe for LavaFluid
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreArc<SyncMutex<>>