Class PluginClassLoader

    • Field Detail

      • NAME_PLUGIN_MAP

        public static final Map<String,​Plugin> NAME_PLUGIN_MAP
      • REGISTERED_PLUGINS

        public static final List<Plugin> REGISTERED_PLUGINS
    • Method Detail

      • disablePlugin

        public static File disablePlugin​(Plugin plugin)
        Used to disable plugin
        Parameters:
        plugin - the plugin need to be disabled
        Returns:
        the plugin jar file, or null if the plugin is MainPlugin
      • getPlugin

        @Nullable
        public static <T extends Plugin> T getPlugin​(Class<T> plugin)
        Get Plugin instance by the class instance
        Type Parameters:
        T - the plugin type
        Parameters:
        plugin - the class instance of the plugin
        Returns:
        the plugin instance
        See Also:
        Plugin.getPlugin(Class)
      • getPlugins

        @NotNull
        public static @NotNull List<Plugin> getPlugins()
        Get all plugins registered
        Returns:
        a list of registered plugins
      • getPlugin

        @Nullable
        public static @Nullable Plugin getPlugin​(String name)
        Get Plugin instance by the name
        Parameters:
        name - the name of the plugin
        Returns:
        the plugin instance
        See Also:
        Plugin.getPlugin(String)
      • getFile

        public File getFile()
      • getPlugin

        public Plugin getPlugin()
      • getLoadedClasses

        public Set<Class<?>> getLoadedClasses()
      • load

        public boolean load()