Skip to main content

CommandSource

Struct CommandSource 

Source
pub(crate) struct CommandSource {
Show 13 fields sender: CommandSender, player: Option<Arc<Player>>, entity: Option<SharedEntity>, world: Arc<World>, server: Arc<Server>, position: DVec3, rotation: (f32, f32), anchor: EntityAnchor, authorization: CommandAuthorizationContext, sender_residence: Option<DomainResidenceToken>, effective_player_residence: Option<DomainResidenceToken>, callback: CommandResultCallback, silent: bool,
}
Expand description

Immutable Minecraft command execution source.

Fields§

§sender: CommandSender§player: Option<Arc<Player>>§entity: Option<SharedEntity>§world: Arc<World>§server: Arc<Server>§position: DVec3§rotation: (f32, f32)§anchor: EntityAnchor§authorization: CommandAuthorizationContext§sender_residence: Option<DomainResidenceToken>§effective_player_residence: Option<DomainResidenceToken>§callback: CommandResultCallback§silent: bool

Implementations§

Source§

impl CommandSource

Source

pub(crate) fn new(sender: CommandSender, server: Arc<Server>) -> Self

Source

pub(crate) const fn sender(&self) -> &CommandSender

Source

pub(crate) const fn player(&self) -> Option<&Arc<Player>>

Source

pub(crate) const fn entity(&self) -> Option<&SharedEntity>

Source

pub(crate) const fn world(&self) -> &Arc<World>

Source

pub(crate) const fn server(&self) -> &Arc<Server>

Source

pub(crate) fn allows_execution_domain(&self, domain: &str) -> bool

Returns whether /execute may project this source into domain.

Player-originated command chains remain confined to their initial domain. Console and Rcon sources are unrestricted.

Source

pub(crate) const fn position(&self) -> DVec3

Source

pub(crate) const fn rotation(&self) -> (f32, f32)

Source

pub(crate) const fn anchor(&self) -> EntityAnchor

Source

pub(crate) fn with_entity(&self, entity: SharedEntity) -> Self

Source

pub(crate) fn with_world( &self, world: Arc<World>, ) -> Result<Self, CommandSyntaxError>

Source

pub(crate) fn with_position(&self, position: DVec3) -> Self

Source

pub(crate) fn with_rotation(&self, rotation: (f32, f32)) -> Self

Source

pub(crate) fn with_anchor(&self, anchor: EntityAnchor) -> Self

Source

pub(crate) fn facing_position(&self, target: DVec3) -> Self

Source

pub(crate) fn anchor_position(&self) -> DVec3

Source

pub(crate) fn with_suppressed_output(&self) -> Self

Source

pub(crate) const fn is_silent(&self) -> bool

Source

pub(crate) fn send_success( &self, message: &TextComponent, broadcast_to_admins: bool, )

Source

pub(crate) fn send_failure(&self, message: TextComponent)

Source

fn sequence_limit(&self) -> usize

Source

fn fork_limit(&self) -> usize

Source

fn broadcast_to_admins(&self, message: &TextComponent)

Trait Implementations§

Source§

impl Clone for CommandSource

Source§

fn clone(&self) -> CommandSource

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CommandArgumentSource for CommandSource

Source§

impl CommandPermissionSource for CommandSource

Source§

impl CommandTextResolutionSource for CommandSource

Source§

fn selector_display_names( &self, selector: &str, ) -> Result<Vec<TextComponent>, CommandSyntaxError>

Source§

fn score_selector_names( &self, selector: &str, ) -> Result<Option<Vec<String>>, CommandSyntaxError>

Source§

fn score( &self, holder: &str, objective: &str, ) -> Result<Option<i32>, CommandSyntaxError>

Source§

fn nbt_source( &self, source: &NbtSource, ) -> Result<Vec<NbtTag>, CommandSyntaxError>

Source§

impl CustomCommandExecutor<CommandSource> for ReturnValue

Source§

impl CustomCommandExecutor<CommandSource> for ReturnFail

Source§

fn run( &self, source: Arc<CommandSource>, _chain: &ContextChain<CommandSource, SteelCommandRuntime>, _modifiers: ChainModifiers, control: &mut ExecutionControl<'_, CommandSource>, )

Source§

impl CustomModifierExecutor<CommandSource> for ReturnRun

Source§

fn apply( &self, original_source: Arc<CommandSource>, sources: Vec<Arc<CommandSource>>, chain: &ContextChain<CommandSource, SteelCommandRuntime>, modifiers: ChainModifiers, control: &mut ExecutionControl<'_, CommandSource>, )

Source§

impl ExecutionCommandSource for CommandSource

Source§

fn execution_is_current(&self) -> bool

Returns whether delayed work may still execute for this exact source.
Source§

fn with_callback(&self, callback: CommandResultCallback) -> Self

Source§

fn callback(&self) -> CommandResultCallback

Source§

fn handle_error(&self, error: &CommandSyntaxError, forked: bool)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> IntoShared for T

Source§

fn into_shared(self) -> Arc<Mutex<RawMutex, Self>>

Wraps this value in an Arc<SyncMutex<>>
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more