Class AudienceSenderResolver
java.lang.Object
revxrsal.commands.bukkit.adventure.AudienceSenderResolver
- All Implemented Interfaces:
SenderResolver
Adds support for using
Audience
as a sender in command methods
Use BukkitCommandHandler.enableAdventure()
to register.
-
Constructor Summary
ConstructorDescriptionAudienceSenderResolver
(Function<org.bukkit.command.CommandSender, net.kyori.adventure.audience.Audience> audiences) -
Method Summary
Modifier and TypeMethodDescription@NotNull Object
getSender
(@NotNull Class<?> customSenderType, @NotNull CommandActor actor, @NotNull ExecutableCommand command) Returns the custom sender value from the given contextboolean
isCustomType
(Class<?> type) Tests whether is the specified type a custom sender type or not
-
Constructor Details
-
AudienceSenderResolver
public AudienceSenderResolver(Function<org.bukkit.command.CommandSender, net.kyori.adventure.audience.Audience> audiences)
-
-
Method Details
-
isCustomType
Description copied from interface:SenderResolver
Tests whether is the specified type a custom sender type or not- Specified by:
isCustomType
in interfaceSenderResolver
- Parameters:
type
- Type to test- Returns:
- True if it is a custom type, false if otherwise.
-
getSender
@NotNull public @NotNull Object getSender(@NotNull @NotNull Class<?> customSenderType, @NotNull @NotNull CommandActor actor, @NotNull @NotNull ExecutableCommand command) Description copied from interface:SenderResolver
Returns the custom sender value from the given context- Specified by:
getSender
in interfaceSenderResolver
- Parameters:
customSenderType
- The type of the custom sender. This matches the command parameter type.actor
- The command actorcommand
- The command being executed- Returns:
- The custom sender value. This must not be null.
-