Codota Logo
net.md_5.bungee.api.plugin
Code IndexAdd Codota to your IDE (free)

How to use net.md_5.bungee.api.plugin

Best Java code snippets using net.md_5.bungee.api.plugin (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: SpigotMC/BungeeCord

/**
 * Called by the loader to initialize the fields in this plugin.
 *
 * @param proxy current proxy instance
 * @param description the description that describes this plugin
 */
final void init(ProxyServer proxy, PluginDescription description)
{
  this.proxy = proxy;
  this.description = description;
  this.file = description.getFile();
  this.logger = new PluginLogger( this );
}
origin: SpigotMC/BungeeCord

/**
 * Checks if the command is registered and can possibly be executed by the
 * sender (without taking permissions into account).
 *
 * @param commandName the name of the command
 * @param sender the sender executing the command
 * @return whether the command will be handled
 */
public boolean isExecutableCommand(String commandName, CommandSender sender)
{
  return getCommandIfEnabled( commandName, sender ) != null;
}
origin: SpigotMC/BungeeCord

@Override
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
{
  return loadClass0( name, resolve, true );
}
origin: SpigotMC/BungeeCord

public void enablePlugins()
{
  for ( Plugin plugin : plugins.values() )
  {
    try
    {
      plugin.onEnable();
      ProxyServer.getInstance().getLogger().log( Level.INFO, "Enabled plugin {0} version {1} by {2}", new Object[]
      {
        plugin.getDescription().getName(), plugin.getDescription().getVersion(), plugin.getDescription().getAuthor()
      } );
    } catch ( Throwable t )
    {
      ProxyServer.getInstance().getLogger().log( Level.WARNING, "Exception encountered when loading plugin: " + plugin.getDescription().getName(), t );
    }
  }
}
origin: SpigotMC/BungeeCord

  @Override
  public void onEnable()
  {
    getProxy().getPluginManager().registerCommand( this, new CommandSend() );
  }
}
origin: SpigotMC/BungeeCord

protected PluginLogger(Plugin plugin)
{
  super( plugin.getClass().getCanonicalName(), null );
  pluginName = "[" + plugin.getDescription().getName() + "] ";
  setParent( plugin.getProxy().getLogger() );
}
origin: SpigotMC/BungeeCord

/**
 * Gets the data folder where this plugin may store arbitrary data. It will
 * be a child of {@link ProxyServer#getPluginsFolder()}.
 *
 * @return the data folder of this plugin
 */
public final File getDataFolder()
{
  return new File( getProxy().getPluginsFolder(), getDescription().getName() );
}
origin: SpigotMC/BungeeCord

@Deprecated
public ExecutorService getExecutorService()
{
  if ( service == null )
  {
    String name = ( getDescription() == null ) ? "unknown" : getDescription().getName();
    service = Executors.newCachedThreadPool( new ThreadFactoryBuilder().setNameFormat( name + " Pool Thread #%1$d" )
        .setThreadFactory( new GroupedThreadFactory( this, name ) ).build() );
  }
  return service;
}
//
origin: SpigotMC/BungeeCord

public boolean dispatchCommand(CommandSender sender, String commandLine)
{
  return dispatchCommand( sender, commandLine, null );
}
origin: SpigotMC/BungeeCord

@Override
public boolean hasPermission(String permission)
{
  return bungee.getPluginManager().callEvent( new PermissionCheckEvent( this, permission, permissions.contains( permission ) ) ).hasPermission();
}
origin: SpigotMC/BungeeCord

/**
 * Register a command so that it may be executed.
 *
 * @param plugin the plugin owning this command
 * @param command the command to register
 */
public void registerCommand(Plugin plugin, Command command)
{
  commandMap.put( command.getName().toLowerCase( Locale.ROOT ), command );
  for ( String alias : command.getAliases() )
  {
    commandMap.put( alias.toLowerCase( Locale.ROOT ), command );
  }
  commandsByPlugin.put( plugin, command );
}
origin: SpigotMC/BungeeCord

  @Override
  public ExecutorService getExecutorService(Plugin plugin)
  {
    return plugin.getExecutorService();
  }
};
origin: SpigotMC/BungeeCord

  /**
   * Checks whether this message is run on this proxy server.
   *
   * @return if this command runs on the proxy
   * @see PluginManager#isExecutableCommand(java.lang.String, net.md_5.bungee.api.CommandSender)
   */
  public boolean isProxyCommand()
  {
    if ( !isCommand() )
    {
      return false;
    }

    int index = message.indexOf( " " );
    String commandName = ( index == -1 ) ? message.substring( 1 ) : message.substring( 1, index );
    CommandSender sender = ( getSender() instanceof CommandSender ) ? (CommandSender) getSender() : null;

    return ProxyServer.getInstance().getPluginManager().isExecutableCommand( commandName, sender );
  }
}
origin: SpigotMC/BungeeCord

  @Override
  public void onEnable()
  {
    getProxy().getPluginManager().registerCommand( this, new CommandList() );
  }
}
origin: SpigotMC/BungeeCord

  @Override
  public int complete(String buffer, int cursor, List<CharSequence> candidates)
  {
    List<String> suggestions = new ArrayList<>();
    proxy.getPluginManager().dispatchCommand( proxy.getConsole(), buffer, suggestions );
    candidates.addAll( suggestions );

    int lastSpace = buffer.lastIndexOf( ' ' );
    return ( lastSpace == -1 ) ? cursor - buffer.length() : cursor - ( buffer.length() - lastSpace - 1 );
  }
}
origin: SpigotMC/BungeeCord

@Override
public void handle(ClientSettings settings) throws Exception
{
  con.setSettings( settings );
  SettingsChangedEvent settingsEvent = new SettingsChangedEvent( con );
  bungee.getPluginManager().callEvent( settingsEvent );
}
origin: SpigotMC/BungeeCord

  private Class<?> loadClass0(String name, boolean resolve, boolean checkOther) throws ClassNotFoundException
  {
    try
    {
      return super.loadClass( name, resolve );
    } catch ( ClassNotFoundException ex )
    {
    }
    if ( checkOther )
    {
      for ( PluginClassloader loader : allLoaders )
      {
        if ( loader != this )
        {
          try
          {
            return loader.loadClass0( name, resolve, false );
          } catch ( ClassNotFoundException ex )
          {
          }
        }
      }
    }
    throw new ClassNotFoundException( name );
  }
}
origin: SpigotMC/BungeeCord

  @Override
  public void onEnable()
  {
    getProxy().getPluginManager().registerCommand( this, new CommandServer() );
  }
}
origin: SpigotMC/BungeeCord

  @Override
  public void onEnable()
  {
    getProxy().getPluginManager().registerCommand( this, new CommandFind() );
  }
}
origin: SpigotMC/BungeeCord

  @Override
  public void onEnable()
  {
    getProxy().getPluginManager().registerCommand( this, new CommandAlert() );
    getProxy().getPluginManager().registerCommand( this, new CommandAlertRaw() );
  }
}
net.md_5.bungee.api.plugin

Most used classes

  • PluginManager
    Class to manage bridging between plugin duties and implementation duties, for example event handling
  • PluginDescription
    POJO representing the plugin.yml file.
  • Plugin
    Represents any Plugin that may be loaded at runtime to enhance existing functionality.
  • Command
    A command that can be executed by a CommandSender.
  • TabExecutor
  • PluginClassloader,
  • PluginLogger
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now