Class AudienceSenderResolver

java.lang.Object
revxrsal.commands.bukkit.adventure.AudienceSenderResolver
All Implemented Interfaces:
SenderResolver

public final class AudienceSenderResolver extends Object implements SenderResolver
Adds support for using Audience as a sender in command methods

Use BukkitCommandHandler.enableAdventure() to register.

  • Constructor Details

    • AudienceSenderResolver

      public AudienceSenderResolver(Function<org.bukkit.command.CommandSender,net.kyori.adventure.audience.Audience> audiences)
  • Method Details

    • isCustomType

      public boolean isCustomType(Class<?> type)
      Description copied from interface: SenderResolver
      Tests whether is the specified type a custom sender type or not
      Specified by:
      isCustomType in interface SenderResolver
      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 interface SenderResolver
      Parameters:
      customSenderType - The type of the custom sender. This matches the command parameter type.
      actor - The command actor
      command - The command being executed
      Returns:
      The custom sender value. This must not be null.