Class ConvertCliTargetFile

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

public class ConvertCliTargetFile extends Object implements DefaultPlugin
Converts the single file specified by the CLI -customFile option.

Enabled only when an online/offline conversion is requested and -customFile is set. Detection still runs against the full server so save format, world layout, and UUID mappings stay accurate; only the target file is rewritten.

  • Constructor Details

    • ConvertCliTargetFile

      public ConvertCliTargetFile()
  • 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
    • isEnabled

      public boolean isEnabled(PluginContext ctx)
      Returns true when a conversion was requested and -customFile is set.
      Specified by:
      isEnabled in interface DefaultPlugin
      Specified by:
      isEnabled in interface MOOCPlugin
      Parameters:
      ctx - the shared conversion context
      Returns:
      true if this plugin should run; false otherwise
    • setTargets

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

      public void run(PluginContext ctx, List<Path> resolvedExistingTargets) throws IOException
      Runs UUID conversion on the resolved file via ConverterV3.
      Specified by:
      run in interface MOOCPlugin
      Parameters:
      ctx - the shared conversion context
      resolvedExistingTargets - the existing target paths to process
      Throws:
      IOException - if reading or writing files fails