Package dev.jorel.commandapi.arguments
Class EnvironmentArgument
java.lang.Object
dev.jorel.commandapi.ArgumentTree
dev.jorel.commandapi.arguments.Argument<T>
dev.jorel.commandapi.arguments.SafeOverrideableArgument<org.bukkit.World.Environment,org.bukkit.World.Environment>
dev.jorel.commandapi.arguments.EnvironmentArgument
public class EnvironmentArgument
extends SafeOverrideableArgument<org.bukkit.World.Environment,org.bukkit.World.Environment>
An argument that represents the Bukkit Environment object
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CustomCommandExecutor<?>The CustomCommandExecutor for this executable implementation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClear all executors from the current command builderexecutes(CommandExecutor executor, ExecutorType... types) Adds an executor to the current command builderexecutes(ResultingCommandExecutor executor, ExecutorType... types) Adds an executor to the current command builderAdds an executor to the current command builderAdds an executor to the current command builderexecutesConsole(ConsoleCommandExecutor executor) Adds an executor to the current command builderAdds an executor to the current command builderexecutesEntity(EntityCommandExecutor executor) Adds an executor to the current command builderexecutesEntity(EntityResultingCommandExecutor executor) Adds an executor to the current command builderexecutesNative(NativeCommandExecutor executor) Adds an executor to the current command builderexecutesNative(NativeResultingCommandExecutor executor) Adds an executor to the current command builderexecutesPlayer(PlayerCommandExecutor executor) Adds an executor to the current command builderexecutesPlayer(PlayerResultingCommandExecutor executor) Adds an executor to the current command builderexecutesProxy(ProxyCommandExecutor executor) Adds an executor to the current command builderexecutesProxy(ProxyResultingCommandExecutor executor) Adds an executor to the current command builderReturns the argument type for this argument.CustomCommandExecutor<? extends org.bukkit.command.CommandSender>Returns the executors that this command hasClass<org.bukkit.World.Environment>Returns the primitive type of the current Argument.<CommandListenerWrapper>
org.bukkit.World.EnvironmentparseArgument(NMS<CommandListenerWrapper> nms, com.mojang.brigadier.context.CommandContext<CommandListenerWrapper> cmdCtx, String key, Object[] previousArgs) Parses an argument, returning the specific Bukkit object that the argument represents.voidsetExecutor(CustomCommandExecutor<? extends org.bukkit.command.CommandSender> executor) Sets the executors for this commandMethods inherited from class dev.jorel.commandapi.arguments.SafeOverrideableArgument
includeSafeSuggestions, includeWithSafeSuggestions, includeWithSafeSuggestionsT, replaceSafeSuggestions, replaceWithSafeSuggestions, replaceWithSafeSuggestionsTMethods inherited from class dev.jorel.commandapi.arguments.Argument
getArgumentPermission, getEntityNames, getIncludedSuggestions, getNodeName, getOverriddenSuggestions, getRawType, getRequirements, includeSuggestions, includeSuggestions, includeSuggestionsT, isListed, replaceSuggestions, replaceSuggestions, replaceSuggestionsT, setListed, withPermission, withPermission, withRequirementMethods inherited from class dev.jorel.commandapi.ArgumentTree
then
-
Field Details
-
executor
The CustomCommandExecutor for this executable implementation
-
-
Constructor Details
-
EnvironmentArgument
An Environment argument. Represents Bukkit's Environment object- Parameters:
nodeName- the name of the node for this argument
-
-
Method Details
-
getPrimitiveType
Description copied from class:ArgumentReturns the primitive type of the current Argument. After executing a command, this argument should yield an object of this returned class.- Specified by:
getPrimitiveTypein classArgument<org.bukkit.World.Environment>- Returns:
- the type that this argument yields when the command is run
-
getArgumentType
Description copied from class:ArgumentReturns the argument type for this argument.- Specified by:
getArgumentTypein classArgument<org.bukkit.World.Environment>- Returns:
- the argument type for this argument
-
parseArgument
public <CommandListenerWrapper> org.bukkit.World.Environment parseArgument(NMS<CommandListenerWrapper> nms, com.mojang.brigadier.context.CommandContext<CommandListenerWrapper> cmdCtx, String key, Object[] previousArgs) throws com.mojang.brigadier.exceptions.CommandSyntaxException Description copied from class:ArgumentParses an argument, returning the specific Bukkit object that the argument represents. This is intended for use by the internals of the CommandAPI and isn't expected to be used outside the CommandAPI- Specified by:
parseArgumentin classArgument<org.bukkit.World.Environment>- Type Parameters:
CommandListenerWrapper- the command source type- Parameters:
nms- an instance of NMScmdCtx- the context which ran this commandkey- the name of the argument nodepreviousArgs- an array of previously declared arguments- Returns:
- the parsed object represented by this argument
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException- if parsing fails
-
executes
Adds an executor to the current command builder- Parameters:
executor- A lambda of type(CommandSender, Object[]) -> ()that will be executed when the command is runtypes- A list of executor types to use this executes method for.- Returns:
- this command builder
-
executes
Adds an executor to the current command builder- Parameters:
executor- A lambda of type(CommandSender, Object[]) -> intthat will be executed when the command is runtypes- A list of executor types to use this executes method for.- Returns:
- this command builder
-
executesPlayer
Adds an executor to the current command builder- Parameters:
executor- A lambda of type(Player, Object[]) -> ()that will be executed when the command is run- Returns:
- this command builder
-
executesPlayer
Adds an executor to the current command builder- Parameters:
executor- A lambda of type(Player, Object[]) -> intthat will be executed when the command is run- Returns:
- this command builder
-
executesEntity
Adds an executor to the current command builder- Parameters:
executor- A lambda of type(Entity, Object[]) -> ()that will be executed when the command is run- Returns:
- this command builder
-
executesEntity
Adds an executor to the current command builder- Parameters:
executor- A lambda of type(Entity, Object[]) -> intthat will be executed when the command is run- Returns:
- this command builder
-
executesProxy
Adds an executor to the current command builder- Parameters:
executor- A lambda of type(Entity, Object[]) -> ()that will be executed when the command is run- Returns:
- this command builder
-
executesProxy
Adds an executor to the current command builder- Parameters:
executor- A lambda of type(Entity, Object[]) -> intthat will be executed when the command is run- Returns:
- this command builder
-
executesCommandBlock
Adds an executor to the current command builder- Parameters:
executor- A lambda of type(BlockCommandSender, Object[]) -> ()that will be executed when the command is run- Returns:
- this command builder
-
executesCommandBlock
Adds an executor to the current command builder- Parameters:
executor- A lambda of type(BlockCommandSender, Object[]) -> intthat will be executed when the command is run- Returns:
- this command builder
-
executesConsole
Adds an executor to the current command builder- Parameters:
executor- A lambda of type(BlockCommandSender, Object[]) -> ()that will be executed when the command is run- Returns:
- this command builder
-
executesConsole
Adds an executor to the current command builder- Parameters:
executor- A lambda of type(BlockCommandSender, Object[]) -> intthat will be executed when the command is run- Returns:
- this command builder
-
executesNative
Adds an executor to the current command builder- Parameters:
executor- A lambda of type(NativeCommandExecutor, Object[]) -> ()that will be executed when the command is run- Returns:
- this command builder
-
executesNative
Adds an executor to the current command builder- Parameters:
executor- A lambda of type(NativeCommandExecutor, Object[]) -> intthat will be executed when the command is run- Returns:
- this command builder
-
getExecutor
Returns the executors that this command has- Returns:
- the executors that this command has
-
setExecutor
Sets the executors for this command- Parameters:
executor- the executors for this command
-
clearExecutors
Clear all executors from the current command builder- Returns:
- this command builder
-