FabricScanner

class FabricScanner(objectMapper: ObjectMapper, utilities: Utilities) : JsonBasedScanner, Scanner<TreeSet<File>, Collection<File>>

fabric.mod.json-based scanning of Fabric-Minecraft mods.

Author

Griefed

Parameters

objectMapper

For JSON-parsing.

utilities

Common utilities used across ServerPackCreator.

Constructors

Link copied to clipboard
constructor(objectMapper: ObjectMapper, utilities: Utilities)

Functions

Link copied to clipboard
open override fun checkForClientModsAndDeps(filesInModsDir: Collection<File>, clientMods: TreeSet<String>, modDependencies: ArrayList<Pair<String, Pair<String, String>>>)

Check every file and fill the clientMods and modDependencies sets with ids of mods which are clientside-only or dependencies of a mod.

Link copied to clipboard
fun cleanupClientMods(modDependencies: ArrayList<Pair<String, Pair<String, String>>>, clientMods: TreeSet<String>)

Remove any dependency from the list of clientside-only mods to prevent excluding dependencies of other mods, resulting in a potentially broken server pack.

Link copied to clipboard
fun getJarJson(file: File, entryInJar: String, objectMapper: ObjectMapper): JsonNode

Acquire a JsonNode from the specified file in the specified file.

Link copied to clipboard
open override fun getModsDelta(filesInModsDir: Collection<File>, clientMods: TreeSet<String>): TreeSet<File>

Get a list of mod-jars which can safely be excluded from the server pack.

Link copied to clipboard
open override fun scan(jarFiles: Collection<File>): TreeSet<File>

Scan the fabric.mod.json-files in mod JAR-files of a given directory for their sideness.