Class AllowedModsGenerator

java.lang.Object
com.craftingdead.protect.whitelist.AllowedModsGenerator

public final class AllowedModsGenerator extends Object
Generates the allowed-mods.json whitelist by scanning a directory of mod JARs. This is designed to be called during the release build process.
  • Method Details

    • main

      public static void main(String[] args)
      Main entry point for Gradle task execution.
      Parameters:
      args - [0] = mods directory path, [1] = output JSON path
    • generateWhitelist

      public static AllowedModsData generateWhitelist(Path modsDir) throws IOException
      Generates the whitelist by scanning all JAR files in the given directory.
      Parameters:
      modsDir - Directory containing mod JAR files
      Returns:
      AllowedModsData containing all discovered mods
      Throws:
      IOException
    • writeWhitelist

      public static void writeWhitelist(AllowedModsData data, Path outputPath) throws IOException
      Writes the whitelist data to a JSON file.
      Parameters:
      data - The whitelist data
      outputPath - Output file path
      Throws:
      IOException