Class ArgumentBuilder
Namespace: Void.Minecraft.Commands.Brigadier.Builder
Assembly: Void.Minecraft.dll
Provides executor, requirement, child, and redirect configuration shared by command-node builders.
public abstract record ArgumentBuilder : IEquatable<ArgumentBuilder>Inheritance
Derived
ArgumentBuilder<TBuilder, TNode>
Implements
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Fields
_arguments
Stores child nodes until a concrete builder creates its node.
protected readonly RootCommandNode _argumentsField Value
Properties
Arguments
Gets the configured child nodes.
public IEnumerable<CommandNode> Arguments { get; }Property Value
Executor
Gets or sets the asynchronous executor.
public CommandExecutor? Executor { get; set; }Property Value
IsForks
Gets or sets whether redirected execution forks.
public bool IsForks { get; set; }Property Value
RedirectModifier
Gets or sets the redirect source modifier.
public RedirectModifier? RedirectModifier { get; set; }Property Value
RedirectTarget
Gets or sets the redirect target.
public CommandNode? RedirectTarget { get; set; }Property Value
Requirement
Gets or sets the asynchronous access requirement; the default permits every source.
public CommandRequirement? Requirement { get; set; }Property Value
Methods
AddChild(CommandNode)
Adds a child node to this builder.
protected void AddChild(CommandNode node)Parameters
node CommandNode
The child node.
Exceptions
A redirect target is already configured.
Build()
Creates the configured command node.
public abstract CommandNode Build()Returns
The built node.
Executes(CommandExecutor?)
Sets the asynchronous command executor.
public virtual ArgumentBuilder Executes(CommandExecutor? command)Parameters
command CommandExecutor?
The executor, or null.
Returns
This builder.
Executes(CommandExecutorSync?)
Wraps and sets a synchronous command executor.
public virtual ArgumentBuilder Executes(CommandExecutorSync? command)Parameters
command CommandExecutorSync?
The executor; null leaves the current executor unchanged.
Returns
This builder.
Fork(CommandNode, RedirectModifier)
Configures a redirect that may produce multiple execution sources.
public virtual ArgumentBuilder Fork(CommandNode target, RedirectModifier modifier)Parameters
target CommandNode
The redirect target.
modifier RedirectModifier
The source-sequence modifier.
Returns
This builder.
Forward(CommandNode?, RedirectModifier?, bool)
Sets redirect metadata after verifying that the builder has no children.
public virtual ArgumentBuilder Forward(CommandNode? target, RedirectModifier? modifier, bool fork)Parameters
target CommandNode?
The redirect target, or null.
modifier RedirectModifier?
The source modifier, or null for a simple redirect.
fork bool
Whether execution forks.
Returns
This builder.
Exceptions
The builder already contains children.
Redirect(CommandNode)
Configures a simple redirect that retains the current source.
public virtual ArgumentBuilder Redirect(CommandNode target)Parameters
target CommandNode
The redirect target.
Returns
This builder.
Redirect(CommandNode, SingleRedirectModifier)
Configures a redirect that maps each context to one source.
public virtual ArgumentBuilder Redirect(CommandNode target, SingleRedirectModifier modifier)Parameters
target CommandNode
The redirect target.
modifier SingleRedirectModifier
The single-source modifier.
Returns
This builder.
Requires(CommandRequirement?)
Sets the command-source access requirement.
public virtual ArgumentBuilder Requires(CommandRequirement? requirement)Parameters
requirement CommandRequirement?
The requirement, or null to allow every source when the node is built.
Returns
This builder.
Suggests(SuggestionProvider?)
Sets a custom suggestion provider when supported by the concrete builder.
public virtual ArgumentBuilder Suggests(SuggestionProvider? provider)Parameters
provider SuggestionProvider?
The provider.
Returns
This builder.
Exceptions
The concrete builder does not support suggestions.