Class ComponentResponseHandler
java.lang.Object
revxrsal.commands.bukkit.adventure.ComponentResponseHandler
- All Implemented Interfaces:
ResponseHandler<net.kyori.adventure.text.ComponentLike>
public final class ComponentResponseHandler
extends Object
implements ResponseHandler<net.kyori.adventure.text.ComponentLike>
Adds support for returning
ComponentLike
from methods to respond
directly to actors.
Use BukkitCommandHandler.enableAdventure()
to register.
-
Constructor Summary
ConstructorDescriptionComponentResponseHandler
(Function<org.bukkit.command.CommandSender, net.kyori.adventure.audience.Audience> audiences) -
Method Summary
Modifier and TypeMethodDescriptionvoid
handleResponse
(net.kyori.adventure.text.ComponentLike response, @NotNull CommandActor actor, @NotNull ExecutableCommand command) Handles the response returned from the method
-
Constructor Details
-
ComponentResponseHandler
public ComponentResponseHandler(Function<org.bukkit.command.CommandSender, net.kyori.adventure.audience.Audience> audiences)
-
-
Method Details
-
handleResponse
public void handleResponse(net.kyori.adventure.text.ComponentLike response, @NotNull @NotNull CommandActor actor, @NotNull @NotNull ExecutableCommand command) Description copied from interface:ResponseHandler
Handles the response returned from the method- Specified by:
handleResponse
in interfaceResponseHandler<net.kyori.adventure.text.ComponentLike>
- Parameters:
response
- The response returned from the method. May or may not be null.actor
- The actor of the commandcommand
- The command being executed
-