Skip to main content

BlockConfig

Struct BlockConfig 

Source
pub struct BlockConfig {
Show 19 fields pub has_collision: bool, pub can_occlude: bool, pub explosion_resistance: f32, pub is_randomly_ticking: bool, pub force_solid_off: bool, pub force_solid_on: bool, pub push_reaction: PushReaction, pub friction: f32, pub speed_factor: f32, pub jump_factor: f32, pub dynamic_shape: bool, pub destroy_time: f32, pub ignited_by_lava: bool, pub liquid: bool, pub is_air: bool, pub requires_correct_tool_for_drops: bool, pub instrument: NoteBlockInstrument, pub replaceable: bool, pub sound_type: SoundType,
}
Expand description

Static configuration for a block type.

This contains constant properties that don’t change based on game state. Dynamic behavior is handled by BlockBehavior in steel-core.

Fields§

§has_collision: bool§can_occlude: bool§explosion_resistance: f32§is_randomly_ticking: bool§force_solid_off: bool§force_solid_on: bool§push_reaction: PushReaction§friction: f32§speed_factor: f32§jump_factor: f32§dynamic_shape: bool§destroy_time: f32§ignited_by_lava: bool§liquid: bool§is_air: bool§requires_correct_tool_for_drops: bool§instrument: NoteBlockInstrument§replaceable: bool§sound_type: SoundType

Implementations§

Source§

impl BlockConfig

Source

pub const fn new() -> Self

Starts building a new set of block properties.

Source

pub const fn has_collision(self, has_collision: bool) -> Self

Source

pub const fn can_occlude(self, can_occlude: bool) -> Self

Source

pub const fn explosion_resistance(self, resistance: f32) -> Self

Source

pub const fn set_is_randomly_ticking(self, ticking: bool) -> Self

Source

pub const fn force_solid_off(self, force: bool) -> Self

Source

pub const fn force_solid_on(self, force: bool) -> Self

Source

pub const fn push_reaction(self, reaction: PushReaction) -> Self

Source

pub const fn friction(self, friction: f32) -> Self

Source

pub const fn speed_factor(self, factor: f32) -> Self

Source

pub const fn jump_factor(self, factor: f32) -> Self

Source

pub const fn dynamic_shape(self, dynamic: bool) -> Self

Source

pub const fn destroy_time(self, time: f32) -> Self

Source

pub const fn ignited_by_lava(self, ignited: bool) -> Self

Source

pub const fn liquid(self, liquid: bool) -> Self

Source

pub const fn set_is_air(self, is_air: bool) -> Self

Source

pub const fn requires_correct_tool_for_drops(self, requires: bool) -> Self

Source

pub const fn instrument(self, instrument: NoteBlockInstrument) -> Self

Source

pub const fn replaceable(self, replaceable: bool) -> Self

Source

pub const fn sound_type(self, sound_type: SoundType) -> Self

Trait Implementations§

Source§

impl Debug for BlockConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BlockConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more