diff options
Diffstat (limited to 'azalea-block/src/behavior.rs')
| -rw-r--r-- | azalea-block/src/behavior.rs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/azalea-block/src/behavior.rs b/azalea-block/src/behavior.rs index db357632..18854fff 100644 --- a/azalea-block/src/behavior.rs +++ b/azalea-block/src/behavior.rs @@ -1,7 +1,17 @@ -#[derive(Default)] pub struct BlockBehavior { pub has_collision: bool, pub friction: f32, + pub jump_factor: f32, +} + +impl Default for BlockBehavior { + fn default() -> Self { + Self { + has_collision: true, + friction: 0.6, + jump_factor: 1.0, + } + } } impl BlockBehavior { @@ -16,4 +26,10 @@ impl BlockBehavior { self.friction = friction; self } + + #[inline] + pub fn jump_factor(mut self, jump_factor: f32) -> Self { + self.jump_factor = jump_factor; + self + } } |
