Struct CustomSpawners
pub struct CustomSpawners(/* private fields */);Expand description
A level’s custom spawners, in the order they tick: what ModifyCustomSpawnersEvent edits.
It starts with vanilla’s, and a spawner a mod adds goes at the end.
Implementations§
§impl CustomSpawners
impl CustomSpawners
pub fn add(&mut self, key: SpawnerKey) -> bool
pub fn add(&mut self, key: SpawnerKey) -> bool
Adds a mod’s spawner at the end; false where the list already has it.
pub fn remove(&mut self, entry: &SpawnerEntry) -> bool
pub fn remove(&mut self, entry: &SpawnerEntry) -> bool
Takes entry out, so it never ticks; false where it was not in the list.
pub fn contains(&self, entry: &SpawnerEntry) -> bool
pub fn contains(&self, entry: &SpawnerEntry) -> bool
Whether entry is in the list.
pub fn entries(&self) -> &[SpawnerEntry]
pub fn entries(&self) -> &[SpawnerEntry]
The entries, in tick order.
Trait Implementations§
§impl Clone for CustomSpawners
impl Clone for CustomSpawners
§fn clone(&self) -> CustomSpawners
fn clone(&self) -> CustomSpawners
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for CustomSpawners
impl Debug for CustomSpawners
impl Eq for CustomSpawners
§impl From<&CustomSpawners> for Vec<SpawnerEntry>
impl From<&CustomSpawners> for Vec<SpawnerEntry>
§fn from(list: &CustomSpawners) -> Vec<SpawnerEntry>
fn from(list: &CustomSpawners) -> Vec<SpawnerEntry>
Converts to this type from the input type.
§impl PartialEq for CustomSpawners
impl PartialEq for CustomSpawners
impl StructuralPartialEq for CustomSpawners
§impl TryFrom<Vec<SpawnerEntry>> for CustomSpawners
impl TryFrom<Vec<SpawnerEntry>> for CustomSpawners
§type Error = SpawnerError
type Error = SpawnerError
The type returned in the event of a conversion error.
§fn try_from(entries: Vec<SpawnerEntry>) -> Result<CustomSpawners, SpawnerError>
fn try_from(entries: Vec<SpawnerEntry>) -> Result<CustomSpawners, SpawnerError>
Performs the conversion.
§impl Wire for CustomSpawners
impl Wire for CustomSpawners
Auto Trait Implementations§
impl Freeze for CustomSpawners
impl RefUnwindSafe for CustomSpawners
impl Send for CustomSpawners
impl Sync for CustomSpawners
impl Unpin for CustomSpawners
impl UnsafeUnpin for CustomSpawners
impl UnwindSafe for CustomSpawners
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