Package revxrsal.commands.bukkit
Interface BukkitCommandHandler
- All Superinterfaces:
CommandHandler
- All Known Implementing Classes:
BukkitHandler
Represents Bukkit's command handler implementation
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull BukkitCommandHandler
create
(@NotNull org.bukkit.plugin.Plugin plugin) Creates a newBukkitCommandHandler
for the specified pluginvoid
Instantiates aBukkitAudiences
internally and allows accessing APIs such asBukkitCommandActor.audience()
void
enableAdventure
(@NotNull net.kyori.adventure.platform.bukkit.BukkitAudiences audiences) Uses the givenBukkitAudiences
for creating audiences forBukkitCommandActor
s.@NotNull Optional<BukkitBrigadier>
Returns an optionalBukkitBrigadier
of this command handler.@NotNull org.bukkit.plugin.Plugin
Returns the plugin this command handler was registered for.boolean
Checks to see if the Brigadier command system is supported by the server.Registers commands automatically on Minecraft's 1.13+ command system (so that you would get the colorful command completions!)Methods inherited from interface revxrsal.commands.CommandHandler
accept, disableStackTraceSanitizing, dispatch, dispatch, failOnTooManyArguments, getArgumentParser, getAutoCompleter, getCategories, getCategory, getCommand, getCommands, getDependency, getDependency, getExceptionHandler, getFlagPrefix, getHelpWriter, getLocale, getMessagePrefix, getMethodCallerFactory, getRootPaths, getSwitchPrefix, getTranslator, parseArguments, parseArgumentsForCompletion, register, registerAnnotationReplacer, registerCondition, registerContextResolver, registerContextResolver, registerContextResolverFactory, registerContextResolverFactory, registerContextValue, registerContextValue, registerDependency, registerDependency, registerExceptionHandler, registerParameterValidator, registerPermissionReader, registerResponseHandler, registerSenderResolver, registerValueResolver, registerValueResolver, registerValueResolverFactory, registerValueResolverFactory, setArgumentParser, setExceptionHandler, setFlagPrefix, setHelpWriter, setLocale, setMessagePrefix, setMethodCallerFactory, setSwitchPrefix, unregister, unregister, unregisterAllCommands
-
Method Details
-
getBrigadier
Returns an optionalBukkitBrigadier
of this command handler.On versions that do not support Brigadier (i.e. 1.12.2 or earlier), this optional will be empty.
- Returns:
- The Brigadier accessor
-
isBrigadierSupported
boolean isBrigadierSupported()Checks to see if the Brigadier command system is supported by the server.- Returns:
- true if Brigadier is supported.
-
registerBrigadier
BukkitCommandHandler registerBrigadier()Registers commands automatically on Minecraft's 1.13+ command system (so that you would get the colorful command completions!)Note that you should call this method after you've registered all your commands.
This is effectively the same as
getBrigadier().register()
, and will have no effect when invoked on older versions.- Returns:
- This command handler
-
enableAdventure
void enableAdventure()Instantiates aBukkitAudiences
internally and allows accessing APIs such asBukkitCommandActor.audience()
-
enableAdventure
void enableAdventure(@NotNull @NotNull net.kyori.adventure.platform.bukkit.BukkitAudiences audiences) Uses the givenBukkitAudiences
for creating audiences forBukkitCommandActor
s. This allows accessing APIs such asBukkitCommandActor.audience()
,- Parameters:
audiences
- Audiences to use for command actors
-
getPlugin
@NotNull @NotNull org.bukkit.plugin.Plugin getPlugin()Returns the plugin this command handler was registered for.- Returns:
- The owning plugin
-
create
@NotNull static @NotNull BukkitCommandHandler create(@NotNull @NotNull org.bukkit.plugin.Plugin plugin) Creates a newBukkitCommandHandler
for the specified plugin- Parameters:
plugin
- Plugin to create for- Returns:
- The newly created command handler
-