Class JsonBasedScanner
-
- All Implemented Interfaces:
public abstract class JsonBasedScannerHelper-class containing methods implemented and used by JSON-based scanners, like the ForgeAnnotationScanner, FabricScanner and QuiltScanner.
Griefed
-
-
Constructor Summary
Constructors Constructor Description JsonBasedScanner()
-
Method Summary
Modifier and Type Method Description final JsonNodegetJarJson(File file, String entryInJar, ObjectMapper objectMapper)Acquire a JsonNode from the specified file in the specified file. final UnitcleanupClientMods(ArrayList<Pair<String, Pair<String, String>>> modDependencies, TreeSet<String> clientMods)Remove any dependency from the list of clientside-only mods to prevent excluding dependencies of other mods, resulting in a potentially broken server pack. abstract 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.abstract TreeSet<File>getModsDelta(Collection<File> filesInModsDir, TreeSet<String> clientMods)Get a list of mod-jars which can safely be excluded from the server pack. -
-
Method Detail
-
getJarJson
final JsonNode getJarJson(File file, String entryInJar, ObjectMapper objectMapper)
Acquire a JsonNode from the specified file in the specified file.
- Parameters:
file- The file from which to get the JsonNode from.entryInJar- The file in the jar from which to get the JsonNode form.objectMapper- The ObjectMapper with which to parse the Json to a JsonNode.- Returns:
A JsonNode containing all information from the requested file in the specified jar.
-
cleanupClientMods
final Unit cleanupClientMods(ArrayList<Pair<String, Pair<String, String>>> modDependencies, TreeSet<String> clientMods)
Remove any dependency from the list of clientside-only mods to prevent excluding dependencies of other mods, resulting in a potentially broken server pack.
- Parameters:
modDependencies- A set of modIds of dependencies.clientMods- A set of modIds of clientside-only mods.
-
checkForClientModsAndDeps
abstract 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.- Parameters:
filesInModsDir- Collection of files to check.clientMods- Set of clientside-only mod-ids.modDependencies- Set dependencies of other mods.
-
getModsDelta
abstract TreeSet<File> getModsDelta(Collection<File> filesInModsDir, TreeSet<String> clientMods)
Get a list of mod-jars which can safely be excluded from the server pack.
- Parameters:
filesInModsDir- A collection of files from which to exclude mods.clientMods- A set of modIds which are clientside-only.- Returns:
A set of all files from the passed collection which can safely be excluded from the server pack.
-
-
-
-