Tabnine Logo
PluginCommand.getExecutor
Code IndexAdd Tabnine to your IDE (free)

How to use
getExecutor
method
in
org.bukkit.command.PluginCommand

Best Java code snippets using org.bukkit.command.PluginCommand.getExecutor (Showing top 6 results out of 315)

origin: GlowstoneMC/Glowstone

  .isAssignableFrom(((PluginCommand) command).getExecutor().getClass())) {
HelpTopic t = entry.getValue().createTopic(command);
if (t != null) {
origin: stackoverflow.com

 private Command registerCommand(String name) {
  PluginCommand command = plugin.getCommand(name);
  if (command.getExecutor() != this) {
    command.setExecutor(this);
  }
  return command;
}
origin: TotalFreedom/TotalFreedomMod

  public static FreedomCommand getFrom(Command command)
  {
    try
    {
      return (FreedomCommand) ((FreedomCommandExecutor) (((PluginCommand) command).getExecutor())).getCommandBase();
    }
    catch (Exception ex)
    {
      return null;
    }
  }
}
origin: EngineHub/CommandHelper

@Override
public MCPlugin getExecutor() {
  // TODO Not all plugins execute commands in their main class, so this cast won't always work
  if(!(cmd instanceof PluginCommand)) {
    return null;
  }
  return new BukkitMCPlugin((Plugin) ((PluginCommand) cmd).getExecutor());
}
origin: me.lucko/helper

/**
 * Unregisters a CommandExecutor with the server
 *
 * @param command the command instance
 * @param <T> the command executor class type
 * @return the command executor
 */
@Nonnull
public static <T extends CommandExecutor> T unregisterCommand(@Nonnull T command) {
  CommandMap map = getCommandMap();
  try {
    //noinspection unchecked
    Map<String, Command> knownCommands = (Map<String, Command>) KNOWN_COMMANDS_FIELD.get(map);
    Iterator<Command> iterator = knownCommands.values().iterator();
    while (iterator.hasNext()) {
      Command cmd = iterator.next();
      if (cmd instanceof PluginCommand) {
        CommandExecutor executor = ((PluginCommand) cmd).getExecutor();
        if (command == executor) {
          cmd.unregister(map);
          iterator.remove();
        }
      }
    }
  } catch (Exception e) {
    throw new RuntimeException("Could not unregister command", e);
  }
  return command;
}
origin: lucko/helper

/**
 * Unregisters a CommandExecutor with the server
 *
 * @param command the command instance
 * @param <T> the command executor class type
 * @return the command executor
 */
@Nonnull
public static <T extends CommandExecutor> T unregisterCommand(@Nonnull T command) {
  CommandMap map = getCommandMap();
  try {
    //noinspection unchecked
    Map<String, Command> knownCommands = (Map<String, Command>) KNOWN_COMMANDS_FIELD.get(map);
    Iterator<Command> iterator = knownCommands.values().iterator();
    while (iterator.hasNext()) {
      Command cmd = iterator.next();
      if (cmd instanceof PluginCommand) {
        CommandExecutor executor = ((PluginCommand) cmd).getExecutor();
        if (command == executor) {
          cmd.unregister(map);
          iterator.remove();
        }
      }
    }
  } catch (Exception e) {
    throw new RuntimeException("Could not unregister command", e);
  }
  return command;
}
org.bukkit.commandPluginCommandgetExecutor

Javadoc

Gets the CommandExecutor associated with this command

Popular methods of PluginCommand

  • setExecutor
  • setTabCompleter
  • getPlugin
    Gets the owner of this PluginCommand
  • getName
  • setDescription
  • setPermission
  • setUsage
  • setAliases
  • <init>
  • setPermissionMessage
  • getAliases
  • testPermission
  • getAliases,
  • testPermission,
  • unregister,
  • getTabCompleter,
  • getUsage,
  • setLabel

Popular in Java

  • Creating JSON documents from java classes using gson
  • compareTo (BigDecimal)
  • getSystemService (Context)
  • setContentView (Activity)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JComboBox (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now