Class DetectSaveFileFormat

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

public class DetectSaveFileFormat extends Object implements DefaultPlugin
Detects the world's region save format (Anvil vs McRegion) and stores it on the PluginContext.

If McRegion is detected, the process exits early because UUID-based conversion is not needed for pre-1.7.6 worlds.

  • Constructor Details

    • DetectSaveFileFormat

      public DetectSaveFileFormat()
  • 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 world 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 world folder
    • run

      public void run(PluginContext ctx, List<Path> resolvedExistingTargets) throws IOException
      Sets the save file format on the context, or exits if McRegion (pre-UUID) is found.
      Specified by:
      run in interface MOOCPlugin
      Parameters:
      ctx - the shared conversion context
      resolvedExistingTargets - unused; detection walks the world folder from ctx
      Throws:
      IOException - if walking the world folder fails