Class AllowedModsGenerator
java.lang.Object
com.craftingdead.protect.whitelist.AllowedModsGenerator
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 Summary
Modifier and TypeMethodDescriptionstatic AllowedModsDatagenerateWhitelist(Path modsDir) Generates the whitelist by scanning all JAR files in the given directory.static voidMain entry point for Gradle task execution.static voidwriteWhitelist(AllowedModsData data, Path outputPath) Writes the whitelist data to a JSON file.
-
Method Details
-
main
Main entry point for Gradle task execution.- Parameters:
args- [0] = mods directory path, [1] = output JSON path
-
generateWhitelist
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
Writes the whitelist data to a JSON file.- Parameters:
data- The whitelist dataoutputPath- Output file path- Throws:
IOException
-