CommandAPI 12.1.0
An API for the command UI introduced in Minecraft 1.13
Loading...
Searching...
No Matches
dev.jorel.commandapi.CommandAPIBukkit< Source > Class Template Referenceabstract
Inheritance diagram for dev.jorel.commandapi.CommandAPIBukkit< Source >:

Public Member Functions

JavaPlugin getPlugin ()
NMS< Source > getNMS ()
CommandRegistrationStrategy< Source > getCommandRegistrationStrategy ()
void onLoad ()
void onDisable ()
abstract BukkitCommandSender<? extends CommandSender > wrapCommandSender (CommandSender sender)
abstract void registerPermission (String string)
void preCommandRegistration (String commandName)
void postCommandRegistration (RegisteredCommand registeredCommand, LiteralCommandNode< Source > resultantNode, List< LiteralCommandNode< Source > > aliasNodes)
LiteralCommandNode< Source > registerCommandNode (LiteralArgumentBuilder< Source > node, String namespace)
void unregister (String commandName, boolean unregisterNamespaces)
BukkitCommandAPIMessenger setupMessenger ()
BukkitCommandAPIMessenger getMessenger ()
final CommandDispatcher< Source > getBrigadierDispatcher ()
CommandAPILogger getLogger ()
void updateRequirements (AbstractPlayer<?> player)
Argument< String > newConcreteMultiLiteralArgument (String nodeName, String[] literals)
Argument< String > newConcreteLiteralArgument (String nodeName, String literal)
CommandAPICommand newConcreteCommandAPICommand (CommandMetaData< CommandSender > meta)
void registerBukkitRecipesSafely (Iterator< Recipe > recipes)
BukkitCommandSender<? extends CommandSender > getSenderForCommand (CommandContext< Source > cmdCtx, boolean forceNative)
Source getBrigadierSourceFromCommandSender (AbstractCommandSender<? extends CommandSender > sender)
SuggestionProvider< Source > getSuggestionProvider (SuggestionProviders suggestionProvider)
BukkitCommandSender<? extends CommandSender > getCommandSenderFromCommandSource (Source css)
void createDispatcherFile (File file, CommandDispatcher< Source > dispatcher) throws IOException
CommandMap getCommandMap ()
Platform activePlatform ()
CommandRegistrationStrategy< Source > createCommandRegistrationStrategy ()
void onEnable ()
 Platform-specific stuff that should happen when the CommandAPI is enabled.
< Impl extends AbstractCommandAPICommand< Impl, Argument, CommandSender > boolean checkRegistrationStatus (AbstractCommandAPICommand< Impl, Argument, CommandSender > command)
 A pre-registration hook to prevent registration if not possible, for example on Paper before the bootstrapper runs but the CommandAPI already expects commands to be registered.

Static Public Member Functions

static< Source > CommandAPIBukkit< Source > get ()
static InternalBukkitConfig getConfiguration ()
static void unregister (String commandName, boolean unregisterNamespaces, boolean unregisterBukkit)
 Unregisters a command from the CommandGraph, so it can't be run anymore.
static< T > void initializeNBTAPI (Class< T > nbtContainerClass, Function< Object, T > nbtContainerConstructor)
 Initializes the CommandAPI's implementation of an NBT API.

Protected Member Functions

void stopCommandRegistrations ()
void checkDependencies ()

Protected Attributes

JavaPlugin plugin
NMS< Source > nms

Static Protected Attributes

static InternalBukkitConfig config

Member Function Documentation

◆ checkRegistrationStatus()

< Impl extends AbstractCommandAPICommand< Impl, Argument, CommandSender > boolean dev.jorel.commandapi.CommandAPIPlatform< Argument, CommandSender, Source >.checkRegistrationStatus ( AbstractCommandAPICommand< Impl, Argument, CommandSender > command)
inherited

A pre-registration hook to prevent registration if not possible, for example on Paper before the bootstrapper runs but the CommandAPI already expects commands to be registered.

Returns
true if the command can be registered and false if that is going to be handled by the implementing platform later

◆ getMessenger()

◆ initializeNBTAPI()

static< T > void dev.jorel.commandapi.CommandAPIBukkit< Source >.initializeNBTAPI ( Class< T > nbtContainerClass,
Function< Object, T > nbtContainerConstructor )
static

Initializes the CommandAPI's implementation of an NBT API.

If you are shading the CommandAPI, you should be using CommandAPIBukkitConfig#initializeNBTAPI(Class, Function) in your onLoad method instead of calling this method.

Parameters
<T>the type that the NBT compound container class is
nbtContainerClassthe NBT compound container class. For example, NBTContainer.class
nbtContainerConstructora function that takes an Object (NMS NBTTagCompound) and returns an instance of the provided NBT compound container. For example, NBTContainer::new.

◆ onLoad()

◆ unregister()

void dev.jorel.commandapi.CommandAPIBukkit< Source >.unregister ( String commandName,
boolean unregisterNamespaces,
boolean unregisterBukkit )
static

Unregisters a command from the CommandGraph, so it can't be run anymore.

This Bukkit-specific unregister has an additional parameter, unregisterBukkit, compared to CommandAPI#unregister(String, boolean).

Parameters
commandNamethe name of the command to unregister
unregisterNamespaceswhether the unregistration system should attempt to remove versions of the command that start with a namespace. E.g. minecraft:command, bukkit:command, or plugin:command. If true, these namespaced versions of a command are also unregistered.
unregisterBukkitwhether the unregistration system should unregister Vanilla or Bukkit commands. If true, only Bukkit commands are unregistered, otherwise only Vanilla commands are unregistered. For the purposes of this parameter, commands registered using the CommandAPI are Vanilla commands, and commands registered by other plugin using Bukkit API are Bukkit commands.

◆ wrapCommandSender()

abstract BukkitCommandSender<? extends CommandSender > dev.jorel.commandapi.CommandAPIBukkit< Source >.wrapCommandSender ( CommandSender sender)
abstract