Class FabricFamilyScanner
-
- All Implemented Interfaces:
-
de.griefed.serverpackcreator.api.modscanning.ModJarScanner
public abstract class FabricFamilyScanner extends JsonDescriptorScanner
Base for the two scanners reading a Fabric-format descriptor: Fabric's own
fabric.mod.jsonand thequilt.mod.jsonQuilt derived from it.Both state sideness the same way — a single
environmentstring that either saysclientor does not — and both name the mod with anid. Only the paths to those fields differ (Quilt nests them underquilt_loaderandminecraft), so they are constructor parameters here rather than a second copy of the logic. Dependencies are not shared: Fabric declares them as an object keyed by mod id, Quilt as an array of either objects or bare strings, so readDependencies stays abstract.
-
-
Field Summary
Fields Modifier and Type Field Description private final Utilitiesutilitiesprivate final StringscanAnnouncement
-
Method Summary
Modifier and Type Method Description final UtilitiesgetUtilities()StringgetScanAnnouncement()abstract List<ModDependency>readDependencies(JsonNode modConfig, String modId)The non-platform mods this descriptor names as dependencies. final ScannedModread(File modJar)Read a single jar's descriptor into the verdict for that mod. -
Methods inherited from class de.griefed.serverpackcreator.api.modscanning.JsonDescriptorScanner
getJarJson -
Methods inherited from class de.griefed.serverpackcreator.api.modscanning.DescriptorScanner
scan -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
FabricFamilyScanner
FabricFamilyScanner(String descriptor, Array<String> idPath, Array<String> environmentPath, ObjectMapper objectMapper, Utilities utilities)
- Parameters:
descriptor- Path of the descriptor inside the jar.idPath- Path to the mod's id within the descriptor.environmentPath- Path to the declared environment within the descriptor.objectMapper- For JSON-parsing.utilities- Common utilities used across ServerPackCreator.
-
-
Method Detail
-
getUtilities
final Utilities getUtilities()
-
getScanAnnouncement
String getScanAnnouncement()
-
readDependencies
abstract List<ModDependency> readDependencies(JsonNode modConfig, String modId)
The non-platform mods this descriptor names as dependencies.
Abstract because the two formats disagree on the shape of the block, not merely its path. A descriptor declaring none must yield an empty list rather than throwing.
- Parameters:
modConfig- The parsed descriptor.modId- Id of the mod being read, for logging.
-
read
final ScannedMod read(File modJar)
Read a single jar's descriptor into the verdict for that mod.
Implementations are free to throw: scan catches everything and falls back to the defaults, so there is no need to guard the jar-level failure modes here. It is public because the distinction between what it throws is meaningful — MissingDescriptorException means the jar simply belongs to another loader, anything else means the jar could not be read — and that distinction is only observable here; scan deliberately flattens both to a default entry.
-
-
-
-