Class ModuleInfo

java.lang.Object
dev.cwhead.GravesX.module.util.ModuleInfo

public final class ModuleInfo extends Object
Immutable descriptor of a module parsed from module.yml. Holds name, description, main class, version, authors, website, and plugin/module dependency lists.
  • Method Details

    • name

      public String name()
      Gets the module name.
      Returns:
      Module name or null if not provided.
    • description

      public String description()
      Gets the module description.
      Returns:
      Description text or null if not provided.
    • mainClass

      public String mainClass()
      Gets the fully qualified main class.
      Returns:
      Main class name or null if not provided.
    • version

      public String version()
      Gets the module version.
      Returns:
      Version string (defaults to "0.0.0" if missing).
    • website

      public String website()
      Gets the website URL for this module.
      Returns:
      Website URL or null if not provided.
    • authors

      public List<String> authors()
      Gets the authors of this module.
      Returns:
      Unmodifiable list of author names (may be empty).
    • pluginDepends

      public List<String> pluginDepends()
      Gets required Bukkit plugin dependencies.
      Returns:
      Unmodifiable list of plugin names.
    • pluginSoftDepends

      public List<String> pluginSoftDepends()
      Gets optional Bukkit plugin dependencies.
      Returns:
      Unmodifiable list of plugin names.
    • pluginLoadBefore

      public List<String> pluginLoadBefore()
      Gets plugins that should load after this module.
      Returns:
      Unmodifiable list of plugin names.
    • moduleDepends

      public List<String> moduleDepends()
      Gets required module dependencies.
      Returns:
      Unmodifiable list of module names.
    • moduleSoftDepends

      public List<String> moduleSoftDepends()
      Gets optional module dependencies.
      Returns:
      Unmodifiable list of module names.
    • moduleLoadBefore

      public List<String> moduleLoadBefore()
      Gets modules that should load after this module.
      Returns:
      Unmodifiable list of module names.
    • fromYaml

      public static ModuleInfo fromYaml(InputStream in) throws Exception
      Parses a minimal YAML-like stream into a ModuleInfo. Supports keys: name, description, main, version, website, author (single) or authors (list), pluginDepends, pluginSoftDepends, pluginLoadBefore, moduleDepends, moduleSoftDepends, moduleLoadBefore.

      List values may be comma-separated on the same line or via - item lines. Comments (#) and blank lines are ignored.

      Parameters:
      in - Input stream of module.yml. Must not be null.
      Returns:
      Parsed module info.
      Throws:
      Exception - If reading or parsing fails.