struct TreeWritePreflight<'a, L: LevelAccessor + ?Sized> {
level: &'a mut L,
writes: RefCell<FxHashMap<BlockPos, BlockStateId>>,
failed: Cell<bool>,
}Fields§
§level: &'a mut L§writes: RefCell<FxHashMap<BlockPos, BlockStateId>>§failed: Cell<bool>Implementations§
Trait Implementations§
Source§impl<L: LevelAccessor + ?Sized> LevelAccessor for TreeWritePreflight<'_, L>
impl<L: LevelAccessor + ?Sized> LevelAccessor for TreeWritePreflight<'_, L>
Source§fn can_write_to_chunk(&self, chunk_x: i32, chunk_z: i32) -> bool
fn can_write_to_chunk(&self, chunk_x: i32, chunk_z: i32) -> bool
Returns whether this surface accepts writes into the given chunk.
Source§fn set_block_state(
&self,
pos: BlockPos,
state: BlockStateId,
_flags: UpdateFlags,
) -> bool
fn set_block_state( &self, pos: BlockPos, state: BlockStateId, _flags: UpdateFlags, ) -> bool
Sets a block state with vanilla update flags.
Source§fn destroy_block(&self, pos: BlockPos, _drop_items: bool) -> bool
fn destroy_block(&self, pos: BlockPos, _drop_items: bool) -> bool
Destroys a block and optionally drops its resources.
Source§fn requires_live_write_preflight(&self) -> bool
fn requires_live_write_preflight(&self) -> bool
Returns whether multi-block placements must be dry-run before committing.
Source§fn play_block_sound(
&self,
sound: SoundEventRef,
pos: BlockPos,
volume: f32,
pitch: f32,
exclude: Option<i32>,
)
fn play_block_sound( &self, sound: SoundEventRef, pos: BlockPos, volume: f32, pitch: f32, exclude: Option<i32>, )
Plays a block sound when this level surface supports runtime side effects.
Source§fn game_event(
&self,
event: GameEventRef,
pos: BlockPos,
context: &GameEventContext<'_>,
)
fn game_event( &self, event: GameEventRef, pos: BlockPos, context: &GameEventContext<'_>, )
Dispatches a game event when this level surface supports runtime listeners.
Source§impl<L: LevelAccessor + ?Sized> LevelReader for TreeWritePreflight<'_, L>
impl<L: LevelAccessor + ?Sized> LevelReader for TreeWritePreflight<'_, L>
Source§fn height_at(&self, heightmap_type: HeightmapType, x: i32, z: i32) -> i32
fn height_at(&self, heightmap_type: HeightmapType, x: i32, z: i32) -> i32
Returns the vanilla heightmap value at a column.
Source§fn get_block_state(&self, pos: BlockPos) -> BlockStateId
fn get_block_state(&self, pos: BlockPos) -> BlockStateId
Gets the block state at a position.
Source§fn get_block_entity(&self, pos: BlockPos) -> Option<SharedBlockEntity>
fn get_block_entity(&self, pos: BlockPos) -> Option<SharedBlockEntity>
Gets the block entity at a position when this level surface supports it
Source§fn is_face_sturdy_for(
&self,
state: BlockStateId,
pos: BlockPos,
direction: Direction,
support_type: SupportType,
) -> bool
fn is_face_sturdy_for( &self, state: BlockStateId, pos: BlockPos, direction: Direction, support_type: SupportType, ) -> bool
Mirrors vanilla
BlockState.isFaceSturdy for a specific support type. Read moreSource§fn raw_brightness(&self, pos: BlockPos, sky_darkening: u8) -> u8
fn raw_brightness(&self, pos: BlockPos, sky_darkening: u8) -> u8
Returns vanilla raw brightness at a position after sky darkening.
Source§fn can_see_sky(&self, pos: BlockPos) -> bool
fn can_see_sky(&self, pos: BlockPos) -> bool
Returns vanilla
BlockAndLightGetter.canSeeSky.Source§fn ambient_light(&self) -> f32
fn ambient_light(&self) -> f32
Returns this dimension’s vanilla ambient light factor.
Source§fn is_face_sturdy(
&self,
state: BlockStateId,
pos: BlockPos,
direction: Direction,
) -> bool
fn is_face_sturdy( &self, state: BlockStateId, pos: BlockPos, direction: Direction, ) -> bool
Mirrors vanilla
BlockState.isFaceSturdy with full-face support.Source§fn max_y_exclusive(&self) -> i32
fn max_y_exclusive(&self) -> i32
Returns the exclusive maximum build height.
Source§fn is_outside_build_height(&self, y: i32) -> bool
fn is_outside_build_height(&self, y: i32) -> bool
Checks if a Y coordinate is outside build height.
Source§fn max_local_raw_brightness(&self, pos: BlockPos, sky_darkening: u8) -> u8
fn max_local_raw_brightness(&self, pos: BlockPos, sky_darkening: u8) -> u8
Returns vanilla
LevelReader.getMaxLocalRawBrightness.Source§fn light_level_dependent_magic_value(&self, pos: BlockPos) -> f32
fn light_level_dependent_magic_value(&self, pos: BlockPos) -> f32
Returns vanilla
LevelReader.getLightLevelDependentMagicValue.Source§fn pathfinding_cost_from_light_levels(&self, pos: BlockPos) -> f32
fn pathfinding_cost_from_light_levels(&self, pos: BlockPos) -> f32
Returns vanilla
LevelReader.getPathfindingCostFromLightLevels.Source§impl<L: LevelAccessor + ?Sized> ScheduledTickAccess for TreeWritePreflight<'_, L>
impl<L: LevelAccessor + ?Sized> ScheduledTickAccess for TreeWritePreflight<'_, L>
Source§fn fluid_tick_delay(&self, fluid: FluidRef) -> i32
fn fluid_tick_delay(&self, fluid: FluidRef) -> i32
Returns the fluid tick delay in this level.
Source§fn schedule_block_tick_default(
&self,
_pos: BlockPos,
_block: BlockRef,
_delay: i32,
) -> bool
fn schedule_block_tick_default( &self, _pos: BlockPos, _block: BlockRef, _delay: i32, ) -> bool
Schedules a block tick using vanilla’s default priority.
Source§fn schedule_fluid_tick_default(
&self,
_pos: BlockPos,
_fluid: FluidRef,
_delay: i32,
) -> bool
fn schedule_fluid_tick_default( &self, _pos: BlockPos, _fluid: FluidRef, _delay: i32, ) -> bool
Schedules a fluid tick using vanilla’s default priority.
Source§fn has_scheduled_block_tick(&self, pos: BlockPos, block: BlockRef) -> bool
fn has_scheduled_block_tick(&self, pos: BlockPos, block: BlockRef) -> bool
Returns whether a tick is already scheduled for the same
(pos, block).Auto Trait Implementations§
impl<'a, L> !Freeze for TreeWritePreflight<'a, L>
impl<'a, L> !RefUnwindSafe for TreeWritePreflight<'a, L>
impl<'a, L> !Sync for TreeWritePreflight<'a, L>
impl<'a, L> !UnwindSafe for TreeWritePreflight<'a, L>
impl<'a, L> Send for TreeWritePreflight<'a, L>
impl<'a, L> Unpin for TreeWritePreflight<'a, L>where
L: ?Sized,
impl<'a, L> UnsafeUnpin for TreeWritePreflight<'a, L>where
L: ?Sized,
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
Mutably borrows from an owned value. Read more
§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> ⓘ
Converts
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> ⓘ
Converts
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 moreWraps this value in an
Arc<SyncMutex<>>§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SignalGetter for Twhere
T: LevelReader,
impl<T> SignalGetter for Twhere
T: LevelReader,
Source§fn is_redstone_conductor(&self, state: BlockStateId, pos: BlockPos) -> bool
fn is_redstone_conductor(&self, state: BlockStateId, pos: BlockPos) -> bool
Returns whether
state conducts direct power at this level position.Source§fn get_direct_signal(&self, pos: BlockPos, direction: Direction) -> i32
fn get_direct_signal(&self, pos: BlockPos, direction: Direction) -> i32
Returns the direct signal emitted by the block at
pos toward direction.Source§fn get_direct_signal_to(&self, pos: BlockPos) -> i32
fn get_direct_signal_to(&self, pos: BlockPos) -> i32
Returns the strongest direct signal entering
pos from its six neighbors.Source§fn get_control_input_signal(
&self,
pos: BlockPos,
direction: Direction,
only_diodes: bool,
) -> i32
fn get_control_input_signal( &self, pos: BlockPos, direction: Direction, only_diodes: bool, ) -> i32
Returns the side input used by vanilla diode blocks.
Source§fn has_signal(&self, pos: BlockPos, direction: Direction) -> bool
fn has_signal(&self, pos: BlockPos, direction: Direction) -> bool
Returns whether the block at
pos supplies a signal toward direction.Source§fn get_signal(&self, pos: BlockPos, direction: Direction) -> i32
fn get_signal(&self, pos: BlockPos, direction: Direction) -> i32
Returns the signal supplied by the block at
pos toward direction.Source§fn get_best_own_or_neighbour_signal(&self, pos: BlockPos) -> i32
fn get_best_own_or_neighbour_signal(&self, pos: BlockPos) -> i32
Returns the strongest signal at
pos, including the block’s own source value.Source§fn has_neighbor_signal(&self, pos: BlockPos) -> bool
fn has_neighbor_signal(&self, pos: BlockPos) -> bool
Returns whether any of the six neighbors supplies signal to
pos.Source§fn get_best_neighbor_signal(&self, pos: BlockPos) -> i32
fn get_best_neighbor_signal(&self, pos: BlockPos) -> i32
Returns the strongest signal supplied to
pos by its six neighbors.