Class AbstractStellarArgument
-
- All Implemented Interfaces:
public abstract class AbstractStellarArgument<T extends AbstractStellarArgument<T, ?>, R extends Object> extends AbstractStellarCommand<T>
Being an extension of AbstractStellarCommand, it represents an argument.
-
-
Field Summary
Fields Modifier and Type Field Description private AbstractStellarCommand<?>
parent
private final Set<ExecutableExecution<?>>
globalFailureExecutions
private final Set<ExecutableSuggestion<?>>
suggestions
private Integer
suggestionOffset
private final ArgumentType<R>
argumentType
private NMS
nms
private final Set<String>
aliases
private final List<ExecutableRequirement<?>>
requirements
private final Set<AbstractStellarArgument<?, ?>>
arguments
private final Set<ExecutableExecution<?>>
executions
private final Set<ExecutableRunnable<?>>
runnables
private final Set<ExecutableExecution<?>>
failureExecutions
private HideDefaultFailureMessages
hideDefaultFailureMessages
private final String
name
-
Constructor Summary
Constructors Constructor Description AbstractStellarArgument(String name, ArgumentType<R> argumentType)
-
Method Summary
Modifier and Type Method Description AbstractStellarCommand<?>
getParent()
Represents the parent command, whether it's a command or an argument. Unit
setParent(AbstractStellarCommand<?> parent)
Represents the parent command, whether it's a command or an argument. Set<ExecutableExecution<?>>
getGlobalFailureExecutions()
Set<ExecutableSuggestion<?>>
getSuggestions()
Integer
getSuggestionOffset()
Unit
setSuggestionOffset(Integer suggestionOffset)
final ArgumentType<R>
getArgumentType()
final T
addSuggestionOffset(Integer offset)
Adds a suggestion offset on top of the current offset. final T
setSuggestionOffset(Integer offset)
Sets the current suggestion offset amount to this offset. final T
addSuggestions(Suggestion suggestions)
Adds multiple Suggestion on top of the current suggestions. final T
addSuggestions(String suggestions)
Adds multiple Suggestion with the titles defined in suggestions on top of the current suggestions. final T
addSuggestion(Suggestion suggestion)
Adds a Suggestion on top of the current suggestions. final T
addSuggestion(String title, String tooltip)
Adds a Suggestion with the given title and tooltip on top of the current suggestions. final <C extends CommandSender> T
addSuggestion(Function2<CommandContext<C>, String, List<Suggestion>> suggestion)
Adds a function that returns a list of Suggestion on top of the current suggestions. final T
addSuggestion(SimpleStellarSuggestion<CommandSender> suggestion)
Adds a function that returns a list of Suggestion on top of the current suggestions. final <C extends CommandSender> T
addFutureSuggestion(Function2<CommandContext<C>, String, CompletableFuture<Iterable<Suggestion>>> suggestion)
Adds a function that returns a list of suggestions in a CompletableFuture on top of the current suggestions. final T
addFutureSuggestion(StellarSuggestion<CommandSender> suggestion)
Adds a function that returns a list of Suggestion on top of the current suggestions. final <C extends CommandSender> T
addAsyncSuggestion(Function2<CommandContext<C>, String, List<Suggestion>> suggestion)
Adds an async function that returns a list of Suggestion on top of the current suggestions. final T
addAsyncSuggestion(SimpleStellarSuggestion<CommandSender> suggestion)
Adds a function that returns a list of Suggestion on top of the current suggestions. Boolean
hasGlobalHiddenDefaultFailureMessages()
T
setInformation(String name, String text)
Adds or sets a piece of information with the given name and text. T
setDescription(String text)
Sets the description of this command with the given text. T
setUsageText(String text)
Sets the usage text of this command with the given text. T
clearInformation()
Clears all the information. T
register(JavaPlugin plugin)
Registeres the command with the given plugin. -
Methods inherited from class com.undefined.stellar.AbstractStellarCommand
addAdvancedListArgument, addAdvancedListArgument, addAdvancedListArgument, addAdvancedListArgument, addAdvancedListArgument, addAdvancedListArgument, addAdvancedListArgument, addAdvancedListArgument, addAdvancedListArgument, addAdvancedListArgument, addAdvancedListArgument, addAdvancedListArgument, addAlias, addAliases, addAngleArgument, addArgument, addArgument, addAsyncExecution, addAsyncExecution, addAsyncRunnable, addAsyncRunnable, addAxisArgument, addBlockDataArgument, addBlockPredicateArgument, addBooleanArgument, addColorArgument, addComponentArgument, addDisplaySlotArgument, addDoubleArgument, addDoubleArgument, addDoubleArgument, addDoubleRangeArgument, addEntityAnchorArgument, addEntityArgument, addEnumArgument, addEnumArgument, addEnumArgument, addEnumArgument, addEnumArgument, addEnvironmentArgument, addExecution, addExecution, addFailureExecution, addFailureExecution, addFailureMessage, addFailureMessage, addFloatArgument, addFloatArgument, addFloatArgument, addGameModeArgument, addGameProfileArgument, addGlobalFailureExecution, addGlobalFailureExecution, addGlobalFailureMessage, addGlobalFailureMessage, addHeightMapArgument, addIntRangeArgument, addIntegerArgument, addIntegerArgument, addIntegerArgument, addItemSlotArgument, addItemStackArgument, addItemStackPredicateArgument, addListArgument, addListArgument, addListArgument, addListArgument, addListArgument, addListArgument, addListArgument, addListArgument, addListArgument, addListArgument, addListArgument, addListArgument, addListArgument, addListArgument, addListArgument, addListArgument, addListArgument, addListArgument, addLiteralArgument, addLocationArgument, addLongArgument, addLongArgument, addLongArgument, addLootTableArgument, addMessageArgument, addMirrorArgument, addNamespacedKeyArgument, addObjectiveArgument, addObjectiveCriteriaArgument, addOnlinePlayersArgument, addOnlinePlayersArgument, addOnlinePlayersArgument, addOperationArgument, addParticleArgument, addPhraseArgument, addRequirement, addRequirement, addRequirement, addRequirement, addRequirements, addRequirements, addRotationArgument, addRunnable, addRunnable, addScoreHolderArgument, addStringArgument, addStringArgument, addStructureRotationArgument, addStyleArgument, addTeamArgument, addTimeArgument, addTimeArgument, addUUIDArgument, clearAliases, getAliases, getArguments, getExecutions, getFailureExecutions, getHideDefaultFailureMessages, getName, getNms, getRequirements, getRunnables, hideDefaultFailureMessages, hideDefaultFailureMessages, hideDefaultFailureMessages, setHideDefaultFailureMessages, setNms
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getParent
AbstractStellarCommand<?> getParent()
Represents the parent command, whether it's a command or an argument. This is automatically set internally.
-
setParent
Unit setParent(AbstractStellarCommand<?> parent)
Represents the parent command, whether it's a command or an argument. This is automatically set internally.
-
getGlobalFailureExecutions
Set<ExecutableExecution<?>> getGlobalFailureExecutions()
-
getSuggestions
Set<ExecutableSuggestion<?>> getSuggestions()
-
getSuggestionOffset
Integer getSuggestionOffset()
-
setSuggestionOffset
Unit setSuggestionOffset(Integer suggestionOffset)
-
getArgumentType
final ArgumentType<R> getArgumentType()
-
addSuggestionOffset
final T addSuggestionOffset(Integer offset)
Adds a suggestion offset on top of the current offset. The suggestion offset represents how many additional letters it will take for suggestions to appear.
-
setSuggestionOffset
final T setSuggestionOffset(Integer offset)
Sets the current suggestion offset amount to this offset. The suggestion offset represents how many additional letters it will take for suggestions to appear.
-
addSuggestions
final T addSuggestions(Suggestion suggestions)
Adds multiple Suggestion on top of the current suggestions.
-
addSuggestions
final T addSuggestions(String suggestions)
Adds multiple Suggestion with the titles defined in suggestions on top of the current suggestions.
-
addSuggestion
final T addSuggestion(Suggestion suggestion)
Adds a Suggestion on top of the current suggestions.
-
addSuggestion
final T addSuggestion(String title, String tooltip)
Adds a Suggestion with the given title and tooltip on top of the current suggestions.
-
addSuggestion
final <C extends CommandSender> T addSuggestion(Function2<CommandContext<C>, String, List<Suggestion>> suggestion)
Adds a function that returns a list of Suggestion on top of the current suggestions. Only works in Kotlin.
-
addSuggestion
final T addSuggestion(SimpleStellarSuggestion<CommandSender> suggestion)
Adds a function that returns a list of Suggestion on top of the current suggestions.
-
addFutureSuggestion
final <C extends CommandSender> T addFutureSuggestion(Function2<CommandContext<C>, String, CompletableFuture<Iterable<Suggestion>>> suggestion)
Adds a function that returns a list of suggestions in a CompletableFuture on top of the current suggestions. Only works in Kotlin.
-
addFutureSuggestion
final T addFutureSuggestion(StellarSuggestion<CommandSender> suggestion)
Adds a function that returns a list of Suggestion on top of the current suggestions.
-
addAsyncSuggestion
final <C extends CommandSender> T addAsyncSuggestion(Function2<CommandContext<C>, String, List<Suggestion>> suggestion)
Adds an async function that returns a list of Suggestion on top of the current suggestions. Only works in Kotlin.
-
addAsyncSuggestion
final T addAsyncSuggestion(SimpleStellarSuggestion<CommandSender> suggestion)
Adds a function that returns a list of Suggestion on top of the current suggestions.
-
hasGlobalHiddenDefaultFailureMessages
Boolean hasGlobalHiddenDefaultFailureMessages()
-
setInformation
T setInformation(String name, String text)
Adds or sets a piece of information with the given name and text. It will be stored as information, to be displayed as a help topic.
- Returns:
The modified command object.
-
setDescription
T setDescription(String text)
Sets the description of this command with the given text. It will be stored as information, to be displayed as a help topic.
- Returns:
The modified command object.
-
setUsageText
T setUsageText(String text)
Sets the usage text of this command with the given text. It will be stored as information, to be displayed as a help topic.
- Returns:
The modified command object.
-
clearInformation
T clearInformation()
Clears all the information.
- Returns:
The modified command object.
-
-
-
-