Package dev.jorel.commandapi.arguments
Class Location2DArgument
java.lang.Object
dev.jorel.commandapi.AbstractArgumentTree<Argument<Location2D>,Argument<?>,org.bukkit.command.CommandSender>
dev.jorel.commandapi.arguments.AbstractArgument<Location2D,Argument<Location2D>,Argument<?>,org.bukkit.command.CommandSender>
dev.jorel.commandapi.arguments.Argument<Location2D>
dev.jorel.commandapi.arguments.SafeOverrideableArgument<Location2D,Location2D>
dev.jorel.commandapi.arguments.Location2DArgument
- All Implemented Interfaces:
SafeOverrideable<Location2D,,Location2D, Argument<Location2D>, Argument<?>, org.bukkit.command.CommandSender> BukkitExecutable<Argument<Location2D>>,ChainableBuilder<Argument<Location2D>>,PlatformExecutable<Argument<Location2D>,org.bukkit.command.CommandSender>
An argument that represents the Bukkit
Location object in x and z directions- Since:
- 3.0
- API Note:
- Returns a
Location2Dobject
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CommandAPIExecutor<org.bukkit.command.CommandSender, AbstractCommandSender<? extends org.bukkit.command.CommandSender>> -
Constructor Summary
ConstructorsConstructorDescriptionLocation2DArgument(String nodeName) A Location argument.Location2DArgument(String nodeName, LocationType type) A Location argument.Location2DArgument(String nodeName, LocationType type, boolean centerPosition) A Location argument. -
Method Summary
Modifier and TypeMethodDescriptionCommandAPIExecutor<org.bukkit.command.CommandSender, AbstractCommandSender<? extends org.bukkit.command.CommandSender>> Returns whether this argument isLocationType.BLOCK_POSITIONorLocationType.PRECISE_POSITION<CommandSourceStack>
Location2DparseArgument(com.mojang.brigadier.context.CommandContext<CommandSourceStack> cmdCtx, String key, CommandArguments previousArgs) voidsetExecutor(CommandAPIExecutor<org.bukkit.command.CommandSender, AbstractCommandSender<? extends org.bukkit.command.CommandSender>> arg0) Methods inherited from class dev.jorel.commandapi.arguments.SafeOverrideableArgument
fromKey, getMapperMethods inherited from class dev.jorel.commandapi.arguments.AbstractArgument
combineWith, copyPermissionsAndRequirements, getArgumentPermission, getCombinedArguments, getEntityNames, getHelpString, getIncludedSuggestions, getNodeName, getOverriddenSuggestions, getRawType, getRequirements, hasCombinedArguments, includeSuggestions, isListed, isOptional, replaceSuggestions, setListed, setOptional, toString, withPermission, withPermission, withRequirementMethods inherited from class dev.jorel.commandapi.AbstractArgumentTree
thenMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.jorel.commandapi.BukkitExecutable
executes, executes, executes, executes, executesCommandBlock, executesCommandBlock, executesCommandBlock, executesCommandBlock, executesConsole, executesConsole, executesConsole, executesConsole, executesEntity, executesEntity, executesEntity, executesEntity, executesFeedbackForwarding, executesFeedbackForwarding, executesFeedbackForwarding, executesFeedbackForwarding, executesNative, executesNative, executesNative, executesNative, executesPlayer, executesPlayer, executesPlayer, executesPlayer, executesProxy, executesProxy, executesProxy, executesProxy, executesRemoteConsole, executesRemoteConsole, executesRemoteConsole, executesRemoteConsoleMethods inherited from interface dev.jorel.commandapi.ChainableBuilder
instanceMethods inherited from interface dev.jorel.commandapi.PlatformExecutable
getExecutorMethods inherited from interface dev.jorel.commandapi.arguments.SafeOverrideable
includeSafeSuggestions, includeSuggestions, replaceSafeSuggestions, replaceSuggestions
-
Field Details
-
executor
protected CommandAPIExecutor<org.bukkit.command.CommandSender,AbstractCommandSender<? extends org.bukkit.command.CommandSender>> executor
-
-
Constructor Details
-
Location2DArgument
A Location argument. Represents Minecraft locations in 2D space. Defaults toLocationType.PRECISE_POSITION- Parameters:
nodeName- the name of the node for this argument
-
Location2DArgument
A Location argument. Represents Minecraft locations in 2D space- Parameters:
nodeName- the name of the node for this argumenttype- the location type of this location, eitherLocationType.BLOCK_POSITIONorLocationType.PRECISE_POSITION
-
Location2DArgument
A Location argument. Represents Minecraft locations in 2D space- Parameters:
nodeName- the name of the node for this argumenttype- the location type of this location, eitherLocationType.BLOCK_POSITIONorLocationType.PRECISE_POSITIONcenterPosition- whether LocationType.PRECISE_POSITION should center the position of the location within a block
-
-
Method Details
-
getLocationType
Returns whether this argument isLocationType.BLOCK_POSITIONorLocationType.PRECISE_POSITION- Returns:
- the location type of this argument
-
getPrimitiveType
- Specified by:
getPrimitiveTypein classAbstractArgument<Location2D,Argument<Location2D>, Argument<?>, org.bukkit.command.CommandSender>
-
getArgumentType
- Specified by:
getArgumentTypein classAbstractArgument<Location2D,Argument<Location2D>, Argument<?>, org.bukkit.command.CommandSender>
-
parseArgument
public <CommandSourceStack> Location2D parseArgument(com.mojang.brigadier.context.CommandContext<CommandSourceStack> cmdCtx, String key, CommandArguments previousArgs) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
parseArgumentin classAbstractArgument<Location2D,Argument<Location2D>, Argument<?>, org.bukkit.command.CommandSender> - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getExecutor
public CommandAPIExecutor<org.bukkit.command.CommandSender,AbstractCommandSender<? extends org.bukkit.command.CommandSender>> getExecutor() -
setExecutor
public void setExecutor(CommandAPIExecutor<org.bukkit.command.CommandSender, AbstractCommandSender<? extends org.bukkit.command.CommandSender>> arg0) -
clearExecutors
-