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§sender_residence: Option<DomainResidenceToken>§effective_player_residence: Option<DomainResidenceToken>§callback: CommandResultCallback§silent: boolImplementations§
Source§impl CommandSource
impl CommandSource
pub(crate) fn new(sender: CommandSender, server: Arc<Server>) -> Self
pub(crate) const fn sender(&self) -> &CommandSender
pub(crate) const fn player(&self) -> Option<&Arc<Player>>
pub(crate) const fn entity(&self) -> Option<&SharedEntity>
pub(crate) const fn world(&self) -> &Arc<World> ⓘ
pub(crate) const fn server(&self) -> &Arc<Server> ⓘ
Sourcepub(crate) fn allows_execution_domain(&self, domain: &str) -> bool
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.
pub(crate) const fn position(&self) -> DVec3
pub(crate) const fn rotation(&self) -> (f32, f32)
pub(crate) const fn anchor(&self) -> EntityAnchor
pub(crate) fn with_entity(&self, entity: SharedEntity) -> Self
pub(crate) fn with_world( &self, world: Arc<World>, ) -> Result<Self, CommandSyntaxError>
pub(crate) fn with_position(&self, position: DVec3) -> Self
pub(crate) fn with_rotation(&self, rotation: (f32, f32)) -> Self
pub(crate) fn with_anchor(&self, anchor: EntityAnchor) -> Self
pub(crate) fn facing_position(&self, target: DVec3) -> Self
pub(crate) fn anchor_position(&self) -> DVec3
pub(crate) fn with_suppressed_output(&self) -> Self
pub(crate) const fn is_silent(&self) -> bool
Sourcepub(crate) fn send_system_message(&self, message: &TextComponent)
pub(crate) fn send_system_message(&self, message: &TextComponent)
Sends informational command output straight to the sender.
Unlike Self::send_success, this ignores the sendCommandFeedback
game rule and never broadcasts to admins - it’s for output the sender
explicitly asked for (e.g. /version), not command-result feedback.
pub(crate) fn send_success( &self, message: &TextComponent, broadcast_to_admins: bool, )
pub(crate) fn send_failure(&self, message: TextComponent)
fn sequence_limit(&self) -> usize
fn fork_limit(&self) -> usize
fn broadcast_to_admins(&self, message: &TextComponent)
Trait Implementations§
Source§impl Clone for CommandSource
impl Clone for CommandSource
Source§impl CommandArgumentSource for CommandSource
impl CommandArgumentSource for CommandSource
fn entity_tag_suggestions(&self, targets: &EntitySelector) -> Vec<String>
fn default_world_clock(&self) -> Option<WorldClockRef>
fn domain_exists(&self, domain: &str) -> bool
fn domain_names(&self) -> Vec<&str>
fn command_world_names(&self) -> Vec<String>
fn permission_context_world_names(&self) -> Vec<String>
fn command_storage_keys(&self) -> Vec<String>
fn permission_rule_suggestions(&self) -> Vec<String>
fn permission_metadata_suggestions(&self) -> Vec<String>
fn user_permission_rule_suggestions( &self, targets: &GameProfileArgument, ) -> Vec<String>
fn user_permission_metadata_suggestions( &self, targets: &GameProfileArgument, ) -> Vec<String>
fn group_permission_rule_suggestions(&self, group: &str) -> Vec<String>
fn group_permission_metadata_suggestions(&self, group: &str) -> Vec<String>
fn permission_group_names(&self) -> Vec<String>
fn non_operator_profile_names(&self) -> Vec<String>
fn all_profile_names(&self) -> Vec<String>
fn operator_profile_names(&self) -> Vec<String>
fn selector_player_names(&self) -> Vec<String>
fn selector_team_names(&self) -> Vec<String>
fn scoreboard_objective_names(&self) -> Vec<String>
fn allows_entity_selectors(&self) -> bool
fn allows_advanced_entity_selectors(&self) -> bool
Source§impl CommandPermissionSource for CommandSource
impl CommandPermissionSource for CommandSource
fn permission_state( &self, permission: &PermissionExpr, ) -> Option<PermissionState>
fn has_permission(&self, permission: &PermissionExpr) -> bool
Source§impl CommandTextResolutionSource for CommandSource
impl CommandTextResolutionSource for CommandSource
fn selector_display_names( &self, selector: &str, ) -> Result<Vec<TextComponent>, CommandSyntaxError>
fn score_selector_names( &self, selector: &str, ) -> Result<Option<Vec<String>>, CommandSyntaxError>
fn score( &self, holder: &str, objective: &str, ) -> Result<Option<i32>, CommandSyntaxError>
fn nbt_source( &self, source: &NbtSource, ) -> Result<Vec<NbtTag>, CommandSyntaxError>
Source§impl CustomCommandExecutor<CommandSource> for ReturnValue
impl CustomCommandExecutor<CommandSource> for ReturnValue
fn run( &self, source: Arc<CommandSource>, chain: &ContextChain<CommandSource, SteelCommandRuntime>, _modifiers: ChainModifiers, control: &mut ExecutionControl<'_, CommandSource>, )
Source§impl CustomCommandExecutor<CommandSource> for ReturnFail
impl CustomCommandExecutor<CommandSource> for ReturnFail
fn run( &self, source: Arc<CommandSource>, _chain: &ContextChain<CommandSource, SteelCommandRuntime>, _modifiers: ChainModifiers, control: &mut ExecutionControl<'_, CommandSource>, )
Source§impl CustomModifierExecutor<CommandSource> for ReturnRun
impl CustomModifierExecutor<CommandSource> for ReturnRun
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
impl ExecutionCommandSource for CommandSource
Source§fn execution_is_current(&self) -> bool
fn execution_is_current(&self) -> bool
Returns whether delayed work may still execute for this exact source.
fn with_callback(&self, callback: CommandResultCallback) -> Self
fn callback(&self) -> CommandResultCallback
fn handle_error(&self, error: &CommandSyntaxError, forked: bool)
Source§impl SuggestionProvider<CommandSource, SteelArgumentType> for SuggestionProviderWrapper
impl SuggestionProvider<CommandSource, SteelArgumentType> for SuggestionProviderWrapper
Source§fn list_suggestions(
&self,
context: &ArgumentSuggestionContext<'_, InternalCommandSource, <SteelArgumentType as InternalCommandArgumentParser<InternalCommandSource>>::Value>,
builder: &mut SuggestionsBuilder<'_>,
)
fn list_suggestions( &self, context: &ArgumentSuggestionContext<'_, InternalCommandSource, <SteelArgumentType as InternalCommandArgumentParser<InternalCommandSource>>::Value>, builder: &mut SuggestionsBuilder<'_>, )
Adds suggestions, according to this provider, to the given builder.
Auto Trait Implementations§
impl !RefUnwindSafe for CommandSource
impl !UnwindSafe for CommandSource
impl Freeze for CommandSource
impl Send for CommandSource
impl Sync for CommandSource
impl Unpin for CommandSource
impl UnsafeUnpin for CommandSource
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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<>>