[−][src]Struct quill_prototype::State
The main server state.
This struct is passed to systems and event handlers. It provides access to entities, components, blocks, resources, etc.
Implementations
impl State
[src]
pub fn entity(&self, _id: EntityId) -> Result<EntityRef, EntityDead>
[src]
pub fn block(&self, _pos: BlockPosition) -> Result<BlockId, ChunkNotLoaded>
[src]
Gets the block at the given position.
Returns an error if the block's chunk is not loaded.
pub fn set_block(
&self,
_pos: BlockPosition,
_block: BlockId
) -> Result<(), ChunkNotLoaded>
[src]
&self,
_pos: BlockPosition,
_block: BlockId
) -> Result<(), ChunkNotLoaded>
Sets the block at the given position.
Returns an error if the block's chunk is not loaded.
pub fn resource<T: Resource>(&self) -> Result<&T, MissingResource>
[src]
Gets a reference to a resource.
Returns an error if the resource does not exist.
pub fn resource_mut<T: Resource>(&self) -> Result<&mut T, MissingResource>
[src]
Gets a mutable reference to a resource.
Returns an error if the resource does not exist.
impl State
[src]
pub fn player_by_name(&self, _name: &str) -> Option<EntityRef>
[src]
Gets an online player by their username.
pub fn entity_by_uuid(&self, _uuid: Uuid) -> Option<EntityRef>
[src]
Gets an online entity by their UUID.
This function works for all entities, not just players.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Component for T where
T: Send + Sync + 'static,
[src]
T: Send + Sync + 'static,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Resource for T where
T: Send + Sync + 'static,
[src]
T: Send + Sync + 'static,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,