Module gomint.api

Interface PluginManager


  • public interface PluginManager
    Version:
    1.0
    Author:
    geNAZt
    • Method Detail

      • uninstallPlugin

        void uninstallPlugin​(Plugin plugin)
        Disable the given plugin. This is only valid to be called from Plugin.uninstall()
        Parameters:
        plugin - which should be disabled
        Throws:
        SecurityException - when somebody else as the Main Class tries to disable a plugin
      • getBaseDirectory

        String getBaseDirectory()
        Absolute path of the plugin Directory. This is used to determinate where the data folders of the Plugins should reside
        Returns:
        absolute Path of the plugin folder
      • getPlugin

        <T extends Plugin> T getPlugin​(String name)
        Get a plugin given by its name. The plugin needs to be loaded or enabled to return in here.
        Type Parameters:
        T - Type of the plugin
        Parameters:
        name - The name of the plugin
        Returns:
        loaded or enabled plugin or null when the plugin was not found
      • isPluginInstalled

        boolean isPluginInstalled​(String name)
        Check plugin installation status
        Parameters:
        name - Plugin to check
        Returns:
        Plugin installation status
      • callEvent

        <T extends Event> T callEvent​(T event)
        Call out a event. This will give it to all handlers attached and return it once its done.
        Type Parameters:
        T - The type of event which we handle
        Parameters:
        event - The event which should be handled
        Returns:
        the handled and changed event
      • registerListener

        void registerListener​(Plugin plugin,
                              EventListener listener)
        Register a new event listener for the given plugin. This only works when you call it from a plugin class.
        Parameters:
        plugin - The plugin which wants to register this listener
        listener - The listener which we want to register
        Throws:
        SecurityException - when somebody else except the plugin registers the listener
      • unregisterListener

        void unregisterListener​(Plugin plugin,
                                EventListener listener)
        Unregister a listener. This listener does not get any more events after this
        Parameters:
        plugin - The plugin which owns the listener
        listener - The listener which we want to unregister
        Throws:
        SecurityException - when somebody else except the plugin unregisters the listener
      • registerCommand

        void registerCommand​(Plugin plugin,
                             Command command)
        Register a new command for the given plugin. This only works when you call it from a plugin class.
        Parameters:
        plugin -
        command -