Class DetectWorldFolderStructure

java.lang.Object
me.pauleff.converter.plugins.DetectWorldFolderStructure
All Implemented Interfaces:
DefaultPlugin, MOOCPlugin

public class DetectWorldFolderStructure extends Object implements DefaultPlugin
Detects how dimension folders are laid out relative to the world and stores the result on the PluginContext.

Distinguishes a single world folder (classic DIM* or 2026-style dimensions/minecraft), per-dimension sibling folders, and unknown layouts.

  • Constructor Details

    • DetectWorldFolderStructure

      public DetectWorldFolderStructure()
  • Method Details

    • metadata

      public PluginMetadata metadata()
      Returns the metadata that identifies and describes this plugin.
      Specified by:
      metadata in interface MOOCPlugin
      Returns:
      the plugin metadata
    • setTargets

      public List<Path> setTargets(PluginContext ctx)
      Returns the server root folder as the sole detection target.
      Specified by:
      setTargets in interface MOOCPlugin
      Parameters:
      ctx - the shared conversion context
      Returns:
      a single-element list containing the server folder
    • run

      public void run(PluginContext ctx, List<Path> resolvedExistingTargets) throws IOException
      Sets the world folder structure on the context from the server and world layout.
      Specified by:
      run in interface MOOCPlugin
      Parameters:
      ctx - the shared conversion context
      resolvedExistingTargets - unused; detection inspects folders from ctx
      Throws:
      IOException - if listing server or world directories fails
      UnknownWorldFolderStructureException - if a single world folder has no recognized dimension layout