steel_core/entity/mob_effect/
saturation.rs1use super::{InstantaneousMobEffect, MobEffectBehavior};
4use crate::entity::LivingEntity;
5use crate::world::World;
6
7pub struct SaturationBehavior;
11
12impl MobEffectBehavior for SaturationBehavior {
13 fn as_instantaneous(&self) -> Option<&dyn InstantaneousMobEffect> {
14 Some(self)
15 }
16
17 fn apply_effect_tick(&self, _world: &World, user: &dyn LivingEntity, amplifier: i32) -> bool {
18 if let Some(player) = user.as_player() {
19 player.food_data.lock().eat(amplifier + 1, 1.0);
20 }
21 true
22 }
23}
24
25impl InstantaneousMobEffect for SaturationBehavior {}