Interface MOOCPlugin

All Known Subinterfaces:
DefaultPlugin, MultiServerPlugin, ServerTypePlugin
All Known Implementing Classes:
ApplyCliServerProperties, ConvertBukkitServer, ConvertFtbQuests, ConvertModdedServer, ConvertVanillaServer, CopyCliPlayerData, DetectSaveFileFormat, DetectServerType, DetectWorldFolderStructure, PrefetchUsercache, UpdateDefaultServerFiles, UpdateProperties

public sealed interface MOOCPlugin permits DefaultPlugin, MultiServerPlugin, ServerTypePlugin
Defines a conversion plugin that can inspect and modify Minecraft server or world files.

Implementations declare metadata, decide when they apply, select target paths, and perform their work against a shared PluginContext. Specialized sealed subtypes control enablement for default, single-server, and multi-server plugins.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether this plugin should run for the given context.
    default org.slf4j.Logger
    Returns a logger named after the runtime class of this plugin.
    Returns the metadata that identifies and describes this plugin.
    default List<Path>
    returnAllFilesInFolders(List<Path> worldDimensionRootFolders)
    Collects all regular files under the given world dimension root folders.
    void
    run(PluginContext ctx, List<Path> resolvedExistingTargets)
    Executes this plugin's conversion or inspection logic.
    Determines the candidate file or directory paths this plugin may operate on.
  • Method Details

    • logger

      default org.slf4j.Logger logger()
      Returns a logger named after the runtime class of this plugin.
      Returns:
      a non-null SLF4J logger for this plugin instance
    • metadata

      PluginMetadata metadata()
      Returns the metadata that identifies and describes this plugin.
      Returns:
      the plugin metadata
    • setTargets

      List<Path> setTargets(PluginContext ctx)
      Determines the candidate file or directory paths this plugin may operate on.

      Paths need not all exist yet; callers typically resolve and filter them before invoking run(PluginContext, List).

      Parameters:
      ctx - the shared conversion context
      Returns:
      the list of target paths for this plugin; never null
    • isEnabled

      boolean isEnabled(PluginContext ctx)
      Indicates whether this plugin should run for the given context.
      Parameters:
      ctx - the shared conversion context
      Returns:
      true if the plugin is applicable; false otherwise
    • run

      void run(PluginContext ctx, List<Path> resolvedExistingTargets) throws IOException
      Executes this plugin's conversion or inspection logic.

      Receives only targets that were declared by setTargets(PluginContext) and confirmed to exist by the caller.

      Parameters:
      ctx - the shared conversion context
      resolvedExistingTargets - the existing target paths to process
      Throws:
      IOException - if reading or writing server or world files fails
    • returnAllFilesInFolders

      default List<Path> returnAllFilesInFolders(List<Path> worldDimensionRootFolders)
      Collects all regular files under the given world dimension root folders.

      Missing roots are skipped with a debug log. Walk failures for a root are logged as warnings and do not abort collection from other roots. The root directories themselves are excluded from the result.

      Parameters:
      worldDimensionRootFolders - the world or dimension root directories to walk
      Returns:
      all regular files found beneath the existing roots; never null