Class DetectServerType

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

public class DetectServerType extends Object implements DefaultPlugin
Detects whether the server root is Vanilla, Bukkit-based, or modded and stores the result on the PluginContext.

Defaults to Vanilla, then upgrades to Modded or Bukkit when characteristic folders or files are present.

  • Constructor Details

    • DetectServerType

      public DetectServerType()
  • 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 context server type to Vanilla, Modded, or Bukkit based on root layout.
      Specified by:
      run in interface MOOCPlugin
      Parameters:
      ctx - the shared conversion context
      resolvedExistingTargets - unused; detection inspects the server folder from ctx
      Throws:
      IOException - if I/O fails while detecting the server type