Package co.aikar.commands
Class BukkitCommandManager
- java.lang.Object
-
- co.aikar.commands.CommandManager<org.bukkit.command.CommandSender,BukkitCommandIssuer,org.bukkit.ChatColor,BukkitMessageFormatter,BukkitCommandExecutionContext,BukkitConditionContext>
-
- co.aikar.commands.BukkitCommandManager
-
public class BukkitCommandManager extends co.aikar.commands.CommandManager<org.bukkit.command.CommandSender,BukkitCommandIssuer,org.bukkit.ChatColor,BukkitMessageFormatter,BukkitCommandExecutionContext,BukkitConditionContext>
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanautoDetectFromClientprotected BukkitCommandCompletionscompletionsprotected BukkitCommandContextscontextsprotected Map<String,org.bukkit.command.Command>knownCommandsprotected BukkitLocaleslocalesIntegermcMinorVersionIntegermcPatchVersionprotected org.bukkit.plugin.Pluginpluginprotected Map<String,BukkitRootCommand>registeredCommands
-
Constructor Summary
Constructors Constructor Description BukkitCommandManager(org.bukkit.plugin.Plugin plugin)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BukkitCommandExecutionContextcreateCommandContext(co.aikar.commands.RegisteredCommand command, co.aikar.commands.CommandParameter parameter, co.aikar.commands.CommandIssuer sender, List<String> args, int i, Map<String,Object> passedArgs)BukkitCommandCompletionContextcreateCompletionContext(co.aikar.commands.RegisteredCommand command, co.aikar.commands.CommandIssuer sender, String input, String config, String[] args)BukkitConditionContextcreateConditionContext(co.aikar.commands.CommandIssuer issuer, String config)co.aikar.commands.RegisteredCommandcreateRegisteredCommand(co.aikar.commands.BaseCommand command, String cmdName, Method method, String prefSubCommand)co.aikar.commands.RootCommandcreateRootCommand(String cmd)co.aikar.commands.CommandCompletions<BukkitCommandCompletionContext>getCommandCompletions()co.aikar.commands.CommandContexts<BukkitCommandExecutionContext>getCommandContexts()BukkitCommandIssuergetCommandIssuer(Object issuer)StringgetCommandPrefix(co.aikar.commands.CommandIssuer issuer)BukkitLocalesgetLocales()org.bukkit.plugin.PlugingetPlugin()Collection<co.aikar.commands.RootCommand>getRegisteredRootCommands()co.aikar.timings.lib.TimingManagergetTimings()protected booleanhandleUncaughtException(co.aikar.commands.BaseCommand scope, co.aikar.commands.RegisteredCommand registeredCommand, co.aikar.commands.CommandIssuer sender, List<String> args, Throwable t)booleanhasRegisteredCommands()booleanisCommandIssuer(Class<?> type)voidlog(co.aikar.commands.LogLevel level, String message, Throwable throwable)voidregisterCommand(co.aikar.commands.BaseCommand command)voidregisterCommand(co.aikar.commands.BaseCommand command, boolean force)LocalesetPlayerLocale(org.bukkit.entity.Player player, Locale locale)voidunregisterCommand(co.aikar.commands.BaseCommand command)voidunregisterCommand(BukkitRootCommand command)Deprecated.Use unregisterCommand(BaseCommand) - this will be visibility reduced later.voidunregisterCommands()booleanusePerIssuerLocale(boolean usePerIssuerLocale, boolean autoDetectFromClient)-
Methods inherited from class co.aikar.commands.CommandManager
addSupportedLanguage, enableUnstableAPI, formatMessage, generateCommandHelp, generateCommandHelp, generateCommandHelp, generateCommandHelp, getCommandConditions, getCommandReplacements, getCurrentCommandIssuer, getCurrentCommandManager, getCurrentCommandOperationContext, getDefaultExceptionHandler, getDefaultFormatter, getDefaultHelpPerPage, getFormat, getHelpFormatter, getIssuerLocale, getRootCommand, getSupportedLanguages, hasPermission, hasPermission, isLoggingUnhandledExceptions, log, notifyLocaleChange, obtainRootCommand, onLocaleChange, registerDependency, registerDependency, sendMessage, sendMessage, setDefaultExceptionHandler, setDefaultExceptionHandler, setDefaultFormatter, setDefaultHelpPerPage, setFormat, setFormat, setFormat, setHelpFormatter, setIssuerLocale, usePerIssuerLocale, usingPerIssuerLocale
-
-
-
-
Field Detail
-
plugin
protected final org.bukkit.plugin.Plugin plugin
-
mcMinorVersion
public final Integer mcMinorVersion
-
mcPatchVersion
public final Integer mcPatchVersion
-
knownCommands
protected Map<String,org.bukkit.command.Command> knownCommands
-
registeredCommands
protected Map<String,BukkitRootCommand> registeredCommands
-
contexts
protected BukkitCommandContexts contexts
-
completions
protected BukkitCommandCompletions completions
-
locales
protected BukkitLocales locales
-
autoDetectFromClient
protected boolean autoDetectFromClient
-
-
Constructor Detail
-
BukkitCommandManager
public BukkitCommandManager(org.bukkit.plugin.Plugin plugin)
-
-
Method Detail
-
getPlugin
public org.bukkit.plugin.Plugin getPlugin()
-
isCommandIssuer
public boolean isCommandIssuer(Class<?> type)
- Specified by:
isCommandIssuerin classco.aikar.commands.CommandManager<org.bukkit.command.CommandSender,BukkitCommandIssuer,org.bukkit.ChatColor,BukkitMessageFormatter,BukkitCommandExecutionContext,BukkitConditionContext>
-
getCommandContexts
public co.aikar.commands.CommandContexts<BukkitCommandExecutionContext> getCommandContexts()
- Specified by:
getCommandContextsin classco.aikar.commands.CommandManager<org.bukkit.command.CommandSender,BukkitCommandIssuer,org.bukkit.ChatColor,BukkitMessageFormatter,BukkitCommandExecutionContext,BukkitConditionContext>
-
getCommandCompletions
public co.aikar.commands.CommandCompletions<BukkitCommandCompletionContext> getCommandCompletions()
- Specified by:
getCommandCompletionsin classco.aikar.commands.CommandManager<org.bukkit.command.CommandSender,BukkitCommandIssuer,org.bukkit.ChatColor,BukkitMessageFormatter,BukkitCommandExecutionContext,BukkitConditionContext>
-
getLocales
public BukkitLocales getLocales()
- Specified by:
getLocalesin classco.aikar.commands.CommandManager<org.bukkit.command.CommandSender,BukkitCommandIssuer,org.bukkit.ChatColor,BukkitMessageFormatter,BukkitCommandExecutionContext,BukkitConditionContext>
-
hasRegisteredCommands
public boolean hasRegisteredCommands()
- Specified by:
hasRegisteredCommandsin classco.aikar.commands.CommandManager<org.bukkit.command.CommandSender,BukkitCommandIssuer,org.bukkit.ChatColor,BukkitMessageFormatter,BukkitCommandExecutionContext,BukkitConditionContext>
-
registerCommand
public void registerCommand(co.aikar.commands.BaseCommand command, boolean force)
-
registerCommand
public void registerCommand(co.aikar.commands.BaseCommand command)
- Specified by:
registerCommandin classco.aikar.commands.CommandManager<org.bukkit.command.CommandSender,BukkitCommandIssuer,org.bukkit.ChatColor,BukkitMessageFormatter,BukkitCommandExecutionContext,BukkitConditionContext>
-
unregisterCommand
public void unregisterCommand(co.aikar.commands.BaseCommand command)
-
unregisterCommand
@Deprecated public void unregisterCommand(BukkitRootCommand command)
Deprecated.Use unregisterCommand(BaseCommand) - this will be visibility reduced later.- Parameters:
command-
-
unregisterCommands
public void unregisterCommands()
-
setPlayerLocale
public Locale setPlayerLocale(org.bukkit.entity.Player player, Locale locale)
-
getTimings
public co.aikar.timings.lib.TimingManager getTimings()
-
createRootCommand
public co.aikar.commands.RootCommand createRootCommand(String cmd)
- Specified by:
createRootCommandin classco.aikar.commands.CommandManager<org.bukkit.command.CommandSender,BukkitCommandIssuer,org.bukkit.ChatColor,BukkitMessageFormatter,BukkitCommandExecutionContext,BukkitConditionContext>
-
getRegisteredRootCommands
public Collection<co.aikar.commands.RootCommand> getRegisteredRootCommands()
- Specified by:
getRegisteredRootCommandsin classco.aikar.commands.CommandManager<org.bukkit.command.CommandSender,BukkitCommandIssuer,org.bukkit.ChatColor,BukkitMessageFormatter,BukkitCommandExecutionContext,BukkitConditionContext>
-
getCommandIssuer
public BukkitCommandIssuer getCommandIssuer(Object issuer)
- Specified by:
getCommandIssuerin classco.aikar.commands.CommandManager<org.bukkit.command.CommandSender,BukkitCommandIssuer,org.bukkit.ChatColor,BukkitMessageFormatter,BukkitCommandExecutionContext,BukkitConditionContext>
-
createCommandContext
public BukkitCommandExecutionContext createCommandContext(co.aikar.commands.RegisteredCommand command, co.aikar.commands.CommandParameter parameter, co.aikar.commands.CommandIssuer sender, List<String> args, int i, Map<String,Object> passedArgs)
- Specified by:
createCommandContextin classco.aikar.commands.CommandManager<org.bukkit.command.CommandSender,BukkitCommandIssuer,org.bukkit.ChatColor,BukkitMessageFormatter,BukkitCommandExecutionContext,BukkitConditionContext>
-
createCompletionContext
public BukkitCommandCompletionContext createCompletionContext(co.aikar.commands.RegisteredCommand command, co.aikar.commands.CommandIssuer sender, String input, String config, String[] args)
- Specified by:
createCompletionContextin classco.aikar.commands.CommandManager<org.bukkit.command.CommandSender,BukkitCommandIssuer,org.bukkit.ChatColor,BukkitMessageFormatter,BukkitCommandExecutionContext,BukkitConditionContext>
-
createRegisteredCommand
public co.aikar.commands.RegisteredCommand createRegisteredCommand(co.aikar.commands.BaseCommand command, String cmdName, Method method, String prefSubCommand)
- Overrides:
createRegisteredCommandin classco.aikar.commands.CommandManager<org.bukkit.command.CommandSender,BukkitCommandIssuer,org.bukkit.ChatColor,BukkitMessageFormatter,BukkitCommandExecutionContext,BukkitConditionContext>
-
createConditionContext
public BukkitConditionContext createConditionContext(co.aikar.commands.CommandIssuer issuer, String config)
- Overrides:
createConditionContextin classco.aikar.commands.CommandManager<org.bukkit.command.CommandSender,BukkitCommandIssuer,org.bukkit.ChatColor,BukkitMessageFormatter,BukkitCommandExecutionContext,BukkitConditionContext>
-
log
public void log(co.aikar.commands.LogLevel level, String message, Throwable throwable)
- Specified by:
login classco.aikar.commands.CommandManager<org.bukkit.command.CommandSender,BukkitCommandIssuer,org.bukkit.ChatColor,BukkitMessageFormatter,BukkitCommandExecutionContext,BukkitConditionContext>
-
usePerIssuerLocale
public boolean usePerIssuerLocale(boolean usePerIssuerLocale, boolean autoDetectFromClient)
-
getCommandPrefix
public String getCommandPrefix(co.aikar.commands.CommandIssuer issuer)
- Overrides:
getCommandPrefixin classco.aikar.commands.CommandManager<org.bukkit.command.CommandSender,BukkitCommandIssuer,org.bukkit.ChatColor,BukkitMessageFormatter,BukkitCommandExecutionContext,BukkitConditionContext>
-
handleUncaughtException
protected boolean handleUncaughtException(co.aikar.commands.BaseCommand scope, co.aikar.commands.RegisteredCommand registeredCommand, co.aikar.commands.CommandIssuer sender, List<String> args, Throwable t)
- Overrides:
handleUncaughtExceptionin classco.aikar.commands.CommandManager<org.bukkit.command.CommandSender,BukkitCommandIssuer,org.bukkit.ChatColor,BukkitMessageFormatter,BukkitCommandExecutionContext,BukkitConditionContext>
-
-