Class ForgeAnnotationScanner
-
- All Implemented Interfaces:
-
de.griefed.serverpackcreator.api.modscanning.Scanner
public final class ForgeAnnotationScanner extends JsonBasedScanner implements Scanner<Pair<Collection<File>, Collection<Pair<String, String>>>, Collection<File>>
fml-cache-annotation.json-based scanning of Forge-Minecraft mods of older versions.Griefed
-
-
Field Summary
Fields Modifier and Type Field Description private final RegexdependencyCheckprivate final RegexdependencyReplace
-
Constructor Summary
Constructors Constructor Description ForgeAnnotationScanner(ObjectMapper objectMapper, Utilities utilities)
-
Method Summary
Modifier and Type Method Description final RegexgetDependencyCheck()final RegexgetDependencyReplace()Pair<Collection<File>, Collection<Pair<String, String>>>scan(Collection<File> jarFiles)Scan the fml-cache-annotation.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
-
ForgeAnnotationScanner
ForgeAnnotationScanner(ObjectMapper objectMapper, Utilities utilities)
- Parameters:
objectMapper- For JSON-parsing.utilities- Common utilities used across ServerPackCreator.
-
-
Method Detail
-
getDependencyCheck
final Regex getDependencyCheck()
-
getDependencyReplace
final Regex getDependencyReplace()
-
scan
Pair<Collection<File>, Collection<Pair<String, String>>> scan(Collection<File> jarFiles)
Scan the
fml-cache-annotation.json-files in mod JAR-files of a given directory for their sideness.If
clientSideOnlyspecifies"value": "true", 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 thefml-cache-annotation.json-files.- Returns:
List of mods not to include in server pack based on fml-cache-annotation.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.
-
-
-
-