Class HndSender
java.lang.Object
dev.efekos.arn.resolver.impl.handler.HndSender
- All Implemented Interfaces:
CommandHandlerMethodArgumentResolver
An implementation of
CommandHandlerMethodArgumentResolver
. Resolves CommandSender
s.- Since:
- 0.1
- Author:
- efekos
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isApplicable
(Parameter parameter) Returns whether thisCommandHandlerMethodArgumentResolver
can resolveparameter
.boolean
Should return true if there is aCommandArgumentResolver
assigned to this resolver.org.bukkit.command.CommandSender
resolve
(Parameter parameter, CommandHandlerMethod method, com.mojang.brigadier.context.CommandContext<net.minecraft.commands.CommandListenerWrapper> context)
-
Constructor Details
-
HndSender
public HndSender()
-
-
Method Details
-
isApplicable
Returns whether thisCommandHandlerMethodArgumentResolver
can resolveparameter
. Keep in mind, that there shouldn't be more than oneCommandHandlerMethodArgumentResolver
that can resolver the same parameter.- Specified by:
isApplicable
in interfaceCommandHandlerMethodArgumentResolver
- Parameters:
parameter
- A parameter of aCommandHandlerMethod
.- Returns:
true
if thisParameter
should be resolved using thisCommandHandlerMethodArgumentResolver
,false
otherwise.
-
requireCommandArgument
public boolean requireCommandArgument()Should return true if there is aCommandArgumentResolver
assigned to this resolver.- Specified by:
requireCommandArgument
in interfaceCommandHandlerMethodArgumentResolver
- Returns:
- Whether
Arn
should search for aCommandArgumentResolver
when aParameter
is resolvable by this resolver.
-
resolve
public org.bukkit.command.CommandSender resolve(Parameter parameter, CommandHandlerMethod method, com.mojang.brigadier.context.CommandContext<net.minecraft.commands.CommandListenerWrapper> context) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
resolve
in interfaceCommandHandlerMethodArgumentResolver
- Parameters:
parameter
- TheParameter
that was associated with this resolver in the first place.method
- MainCommandHandlerMethod
in case something from there is needed.context
- Command context to get arguments from the executed command.- Returns:
- An object to be passed in to
parameter
. - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
- if needed.
-