Package dev.cwhead.GravesX.module.util
Class ModuleInfo
java.lang.Object
dev.cwhead.GravesX.module.util.ModuleInfo
Immutable descriptor of a module parsed from
module.yml
.
Holds name, description, main class, version, authors, website,
and plugin/module dependency lists.-
Method Summary
Modifier and TypeMethodDescriptionauthors()
Gets the authors of this module.Gets the module description.static ModuleInfo
fromYaml
(InputStream in) Parses a minimal YAML-like stream into aModuleInfo
.Gets the fully qualified main class.Gets required module dependencies.Gets modules that should load after this module.Gets optional module dependencies.name()
Gets the module name.Gets required Bukkit plugin dependencies.Gets plugins that should load after this module.Gets optional Bukkit plugin dependencies.version()
Gets the module version.website()
Gets the website URL for this module.
-
Method Details
-
name
Gets the module name.- Returns:
- Module name or
null
if not provided.
-
description
Gets the module description.- Returns:
- Description text or
null
if not provided.
-
mainClass
Gets the fully qualified main class.- Returns:
- Main class name or
null
if not provided.
-
version
Gets the module version.- Returns:
- Version string (defaults to
"0.0.0"
if missing).
-
website
Gets the website URL for this module.- Returns:
- Website URL or
null
if not provided.
-
authors
Gets the authors of this module.- Returns:
- Unmodifiable list of author names (may be empty).
-
pluginDepends
Gets required Bukkit plugin dependencies.- Returns:
- Unmodifiable list of plugin names.
-
pluginSoftDepends
Gets optional Bukkit plugin dependencies.- Returns:
- Unmodifiable list of plugin names.
-
pluginLoadBefore
Gets plugins that should load after this module.- Returns:
- Unmodifiable list of plugin names.
-
moduleDepends
Gets required module dependencies.- Returns:
- Unmodifiable list of module names.
-
moduleSoftDepends
Gets optional module dependencies.- Returns:
- Unmodifiable list of module names.
-
moduleLoadBefore
Gets modules that should load after this module.- Returns:
- Unmodifiable list of module names.
-
fromYaml
Parses a minimal YAML-like stream into aModuleInfo
. Supports keys:name
,description
,main
,version
,website
,author
(single) orauthors
(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 ofmodule.yml
. Must not benull
.- Returns:
- Parsed module info.
- Throws:
Exception
- If reading or parsing fails.
-