Class PluginManager

java.lang.Object
net.ME1312.Galaxi.Plugin.PluginManager

public abstract class PluginManager extends Object
  • Constructor Details

    • PluginManager

      public PluginManager()
  • Method Details

    • getPlugins

      public abstract Map<String,PluginInfo> getPlugins()
      Get a map of the Plugins
      Returns:
      PluginInfo Map
    • getPlugin

      public abstract PluginInfo getPlugin(String name)
      Gets a Plugin
      Parameters:
      name - Plugin Name
      Returns:
      PluginInfo
    • getPlugin

      public PluginInfo getPlugin(Class<?> main)
      Gets a Plugin
      Parameters:
      main - Plugin Main Class
      Returns:
      PluginInfo
    • getPlugin

      public PluginInfo getPlugin(Object main)
      Gets a Plugin
      Parameters:
      main - Plugin Object
      Returns:
      PluginInfo
    • addCommand

      public void addCommand(Command command, String... handles)
      Registers a Command
      Parameters:
      command - Command
      handles - Aliases
    • removeCommand

      public void removeCommand(String... handles)
      Unregisters a Command
      Parameters:
      handles - Aliases
    • registerListeners

      public void registerListeners(PluginInfo plugin, Object... listeners)
      Register Event Listeners
      Parameters:
      plugin - Plugin
      listeners - Listeners
      See Also:
    • registerListener

      @SafeVarargs public final <T extends Event> void registerListener(PluginInfo plugin, Class<T> event, Listener<? extends T>... listeners)
      Register Event Listeners
      Type Parameters:
      T - Event Type
      Parameters:
      plugin - Plugin
      event - Event Type
      listeners - Listeners
    • registerListener

      @SafeVarargs public final <T extends Event> void registerListener(PluginInfo plugin, Class<T> event, Number order, Listener<? extends T>... listeners)
      Register Event Listeners
      Type Parameters:
      T - Event Type
      Parameters:
      plugin - Plugin
      event - Event Type
      order - Listener Order (will convert to short)
      listeners - Listeners
      See Also:
    • getListeners

      public List<Subscriber> getListeners(Class<? extends Event> type)
      Get Registered Event Listeners
      Parameters:
      type - Event Type
      Returns:
      Event Listeners
    • unregisterListeners

      public void unregisterListeners(PluginInfo plugin)
      Unregister Event Listeners
      Parameters:
      plugin - Plugin
    • unregisterListeners

      public void unregisterListeners(PluginInfo plugin, Object... listeners)
      Unregister Event Listeners
      Parameters:
      plugin - Plugin
      listeners - Listeners
    • executeEvent

      public boolean executeEvent(Event event)
      Run an Event
      Parameters:
      event - Event
    • executeEvent

      public <T extends Event> boolean executeEvent(Class<T> type, T event)
      Run an Event (as its super class)
      Type Parameters:
      T - Event Type
      Parameters:
      type - Super Class
      event - Event
      Returns:
      true if the event was not cancelled