Class FabricScanner
-
- All Implemented Interfaces:
-
de.griefed.serverpackcreator.api.modscanning.Scanner
public final class FabricScanner extends JsonBasedScanner implements Scanner<Pair<Collection<File>, Collection<Pair<String, String>>>, Collection<File>>
fabric.mod.json-based scanning of Fabric-Minecraft mods.Griefed
-
-
Constructor Summary
Constructors Constructor Description FabricScanner(ObjectMapper objectMapper, Utilities utilities)
-
Method Summary
Modifier and Type Method Description Pair<Collection<File>, Collection<Pair<String, String>>>scan(Collection<File> jarFiles)Scan the fabric.mod.json-files in mod JAR-files of a given directory for their sideness.UnitcheckForClientModsAndDeps(Collection<File> filesInModsDir, TreeSet<String> clientMods, ArrayList<Pair<String, Pair<String, String>>> modDependencies)Check every file and fill the clientModsandmodDependenciessets with ids of mods which are clientside-only or dependencies of a mod.TreeSet<File>getModsDelta(Collection<File> filesInModsDir, TreeSet<String> clientMods)Get a list of mod-jars which can safely be excluded from the server pack. -
-
Constructor Detail
-
FabricScanner
FabricScanner(ObjectMapper objectMapper, Utilities utilities)
- Parameters:
objectMapper- For JSON-parsing.utilities- Common utilities used across ServerPackCreator.
-
-
Method Detail
-
scan
Pair<Collection<File>, Collection<Pair<String, String>>> scan(Collection<File> jarFiles)
Scan the
fabric.mod.json-files in mod JAR-files of a given directory for their sideness.If
environmentspecifiesclient, and is not listed as a dependency for another mod, it is added and therefore later on excluded from the server pack.- Parameters:
jarFiles- A list of files in which to check thefabric.mod.json-files.- Returns:
List of mods not to include in server pack based on fabric.mod.json-content.
-
checkForClientModsAndDeps
Unit checkForClientModsAndDeps(Collection<File> filesInModsDir, TreeSet<String> clientMods, ArrayList<Pair<String, Pair<String, String>>> modDependencies)
Check every file and fill the
clientModsandmodDependenciessets with ids of mods which are clientside-only or dependencies of a mod.
-
getModsDelta
TreeSet<File> getModsDelta(Collection<File> filesInModsDir, TreeSet<String> clientMods)
Get a list of mod-jars which can safely be excluded from the server pack.
- Returns:
A set of all files from the passed collection which can safely be excluded from the server pack.
-
-
-
-