pub struct BeaconState {
pub(crate) levels: i32,
pub(crate) primary_power: Option<MobEffectRef>,
pub(crate) secondary_power: Option<MobEffectRef>,
last_check_y: i32,
checking_beam_sections: Vec<BeamSection>,
pub(crate) beam_sections: Vec<BeamSection>,
}Expand description
Mutable beacon state shared with the menu’s data slots.
Fields§
§levels: i32§primary_power: Option<MobEffectRef>§secondary_power: Option<MobEffectRef>§last_check_y: i32Y level reached by the in-progress beam scan; below pos.y() restarts the scan.
checking_beam_sections: Vec<BeamSection>§beam_sections: Vec<BeamSection>Sections from the last completed scan. Emptiness is the beacon’s activity gate.
Implementations§
Source§impl BeaconState
impl BeaconState
const fn new() -> Self
pub(crate) fn filter_effect( effect: Option<MobEffectRef>, ) -> Option<MobEffectRef>
Sourcepub(crate) fn validate_effects(
primary: Option<MobEffectRef>,
secondary: Option<MobEffectRef>,
levels: i32,
) -> bool
pub(crate) fn validate_effects( primary: Option<MobEffectRef>, secondary: Option<MobEffectRef>, levels: i32, ) -> bool
Rejects effect combinations the vanilla client UI cannot produce for levels: tiers
gate both slots, and a secondary additionally needs a full pyramid or the same effect.
Sourcefn required_levels_for(effect: Option<MobEffectRef>) -> i32
fn required_levels_for(effect: Option<MobEffectRef>) -> i32
Returns the 1-indexed tier that unlocks effect, 0 for None, or i32::MAX for
effects not in BEACON_EFFECTS.
Auto Trait Implementations§
impl Freeze for BeaconState
impl RefUnwindSafe for BeaconState
impl Send for BeaconState
impl Sync for BeaconState
impl Unpin for BeaconState
impl UnsafeUnpin for BeaconState
impl UnwindSafe for BeaconState
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<>>