Class UpdateDefaultServerFiles

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

public class UpdateDefaultServerFiles extends Object implements DefaultPlugin
Rewrites remapped player UUIDs in root server JSON files such as whitelist, bans, and ops.
  • Constructor Details

    • UpdateDefaultServerFiles

      public UpdateDefaultServerFiles()
  • 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 an online/offline conversion was requested.
      Specified by:
      isEnabled in interface DefaultPlugin
      Specified by:
      isEnabled in interface MOOCPlugin
      Parameters:
      ctx - the shared conversion context
      Returns:
      true if this is a conversion operation; false otherwise
    • setTargets

      public List<Path> setTargets(PluginContext ctx)
      Returns the standard server JSON files under the server root that may contain UUIDs.
      Specified by:
      setTargets in interface MOOCPlugin
      Parameters:
      ctx - the shared conversion context
      Returns:
      the candidate server file paths; never null
    • run

      public void run(PluginContext ctx, List<Path> resolvedExistingTargets) throws IOException
      Replaces original UUIDs with remapped values in each resolved server file.
      Specified by:
      run in interface MOOCPlugin
      Parameters:
      ctx - the shared conversion context
      resolvedExistingTargets - the existing server files to rewrite
      Throws:
      IOException - if reading or writing a file fails