public final class BukkitVisitors
extends java.lang.Object
Accept individual functions using Lamp.Builder#accept(LampBuilderVisitor)
| Constructor and Description |
|---|
BukkitVisitors() |
| Modifier and Type | Method and Description |
|---|---|
static <A extends BukkitCommandActor> |
asyncTabCompletion(@NotNull org.bukkit.plugin.java.JavaPlugin plugin,
@NotNull ActorFactory<A> actorFactory)
Enables asynchronous tab completions (Paper only)
|
static @NotNull revxrsal.commands.LampBuilderVisitor<BukkitCommandActor> |
brigadier(@NotNull org.bukkit.plugin.java.JavaPlugin plugin)
Adds a registration hook that injects Lamp commands into Bukkit's Brigadier.
|
static <A extends BukkitCommandActor> |
brigadier(@NotNull org.bukkit.plugin.java.JavaPlugin plugin,
@NotNull revxrsal.commands.brigadier.types.ArgumentTypes<? super A> argumentTypes,
@NotNull ActorFactory<A> actorFactory)
Adds a registration hook that injects Lamp commands into Bukkit's Brigadier.
|
static @NotNull revxrsal.commands.LampBuilderVisitor<BukkitCommandActor> |
brigadier(@NotNull org.bukkit.plugin.java.JavaPlugin plugin,
@NotNull revxrsal.commands.brigadier.types.ArgumentTypes<? super BukkitCommandActor> argumentTypes)
Adds a registration hook that injects Lamp commands into Bukkit's Brigadier.
|
static <A extends BukkitCommandActor> |
bukkitExceptionHandler()
Handles the default Bukkit exceptions
|
static <A extends BukkitCommandActor> |
bukkitParameterTypes()
|
static <A extends BukkitCommandActor> |
bukkitParameterTypes(boolean brigadierEnabled)
|
static <A extends BukkitCommandActor> |
bukkitPermissions()
Adds support for the
CommandPermission annotation |
static <A extends BukkitCommandActor> |
bukkitSenderResolver()
Resolves the sender type
CommandSender, Player and ConsoleCommandSender
for parameters that come first in the command. |
static <A extends BukkitCommandActor> |
legacyColorCodes()
Makes the default format for
CommandActor.reply(String) and CommandActor.error(String)
take the legacy ampersand ChatColor-coded format |
static <A extends BukkitCommandActor> |
pluginContextParameters(org.bukkit.plugin.java.JavaPlugin plugin)
Adds
Plugin dependencies and type resolvers |
static @NotNull revxrsal.commands.LampBuilderVisitor<BukkitCommandActor> |
registrationHooks(@NotNull org.bukkit.plugin.java.JavaPlugin plugin)
Adds a registration hook that injects Lamp commands into Bukkit
|
static <A extends BukkitCommandActor> |
registrationHooks(@NotNull org.bukkit.plugin.java.JavaPlugin plugin,
@NotNull ActorFactory<A> actorFactory) |
static <A extends BukkitCommandActor> |
registrationHooks(@NotNull org.bukkit.plugin.java.JavaPlugin plugin,
@NotNull ActorFactory<A> actorFactory,
@NotNull java.lang.String defaultFallbackPrefix)
Adds a registration hook that injects Lamp commands into Bukkit.
|
@NotNull public static <A extends BukkitCommandActor> @NotNull revxrsal.commands.LampBuilderVisitor<A> legacyColorCodes()
CommandActor.reply(String) and CommandActor.error(String)
take the legacy ampersand ChatColor-coded formatA - The actor type@NotNull public static <A extends BukkitCommandActor> @NotNull revxrsal.commands.LampBuilderVisitor<A> bukkitExceptionHandler()
A - The actor type@NotNull public static <A extends BukkitCommandActor> @NotNull revxrsal.commands.LampBuilderVisitor<A> bukkitSenderResolver()
CommandSender, Player and ConsoleCommandSender
for parameters that come first in the command.A - The actor type@NotNull public static <A extends BukkitCommandActor> @NotNull revxrsal.commands.LampBuilderVisitor<A> bukkitParameterTypes()
PlayerOfflinePlayerWorldEntitySelectorA - The actor type@NotNull public static <A extends BukkitCommandActor> @NotNull revxrsal.commands.LampBuilderVisitor<A> bukkitParameterTypes(boolean brigadierEnabled)
PlayerOfflinePlayerWorldEntitySelectorA - The actor type@NotNull public static @NotNull revxrsal.commands.LampBuilderVisitor<BukkitCommandActor> registrationHooks(@NotNull @NotNull org.bukkit.plugin.java.JavaPlugin plugin)
plugin - The plugin instance to bind commands to@NotNull public static <A extends BukkitCommandActor> @NotNull revxrsal.commands.LampBuilderVisitor<A> registrationHooks(@NotNull @NotNull org.bukkit.plugin.java.JavaPlugin plugin, @NotNull @NotNull ActorFactory<A> actorFactory)
@NotNull public static <A extends BukkitCommandActor> @NotNull revxrsal.commands.LampBuilderVisitor<A> registrationHooks(@NotNull @NotNull org.bukkit.plugin.java.JavaPlugin plugin, @NotNull @NotNull ActorFactory<A> actorFactory, @NotNull @NotNull java.lang.String defaultFallbackPrefix)
This function allows to specify a custom ActorFactory to
use custom implementations of BukkitCommandActor
plugin - The plugin instance to bind commands toactorFactory - The actor factory. This allows for creating custom BukkitCommandActor
implementationsdefaultFallbackPrefix - The default fallback prefix to use (which Bukkit uses to
prevent conflicts). Note that this can be
overridden on a per-command basis using @FallbackPrefix@NotNull public static <A extends BukkitCommandActor> @NotNull revxrsal.commands.LampBuilderVisitor<A> pluginContextParameters(org.bukkit.plugin.java.JavaPlugin plugin)
Plugin dependencies and type resolversA - The actor typeplugin - Plugin to supply@NotNull public static <A extends BukkitCommandActor> @NotNull revxrsal.commands.LampBuilderVisitor<A> bukkitPermissions()
CommandPermission annotationA - The actor type@NotNull public static @NotNull revxrsal.commands.LampBuilderVisitor<BukkitCommandActor> brigadier(@NotNull @NotNull org.bukkit.plugin.java.JavaPlugin plugin)
This function allows to specify a custom ActorFactory to
use custom implementations of BukkitCommandActor
plugin - The plugin instance to bind commands to@NotNull public static @NotNull revxrsal.commands.LampBuilderVisitor<BukkitCommandActor> brigadier(@NotNull @NotNull org.bukkit.plugin.java.JavaPlugin plugin, @NotNull @NotNull revxrsal.commands.brigadier.types.ArgumentTypes<? super BukkitCommandActor> argumentTypes)
argumentTypes - The argument types registry. See BukkitArgumentTypes for
Bukkit typesplugin - The plugin instance to bind commands to@NotNull public static <A extends BukkitCommandActor> @NotNull revxrsal.commands.LampBuilderVisitor<A> brigadier(@NotNull @NotNull org.bukkit.plugin.java.JavaPlugin plugin, @NotNull @NotNull revxrsal.commands.brigadier.types.ArgumentTypes<? super A> argumentTypes, @NotNull @NotNull ActorFactory<A> actorFactory)
This function allows to specify a custom ActorFactory to
use custom implementations of BukkitCommandActor
plugin - The plugin instance to bind commands toargumentTypes - The argument types registry. See BukkitArgumentTypes for
Bukkit typesactorFactory - The actor factory. This allows for creating custom BukkitCommandActor
implementations@NotNull public static <A extends BukkitCommandActor> @NotNull revxrsal.commands.LampBuilderVisitor<A> asyncTabCompletion(@NotNull @NotNull org.bukkit.plugin.java.JavaPlugin plugin, @NotNull @NotNull ActorFactory<A> actorFactory)
A - The actor typeplugin - Plugin to register asynchronous tab completions foractorFactory - The actor factoryLampBuilderVisitor