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

  • Reactive rest calls using spring rest template
  • getSystemService (Context)
  • getSupportFragmentManager (FragmentActivity)
  • findViewById (Activity)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Permission (java.security)
    Legacy security code; do not use.
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • JTextField (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • 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