Class FabricScanner

  • All Implemented Interfaces:
    de.griefed.serverpackcreator.api.modscanning.ModJarScanner

    
    public final class FabricScanner
    extends FabricFamilyScanner
                        

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

    If environment specifies client, and the mod is not listed as a dependency of another mod, it is later excluded from the server pack. Sideness and id reading live in FabricFamilyScanner, which Quilt shares; only Fabric's depends-block shape is specific to this scanner.

    Author:

    Griefed

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      FabricScanner(ObjectMapper objectMapper, Utilities utilities)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      String getScanAnnouncement() Logged once before a scan starts, or null to announce nothing.
      String readMinecraftConstraint(JsonNode modConfig) The depends.minecraft range this descriptor states, or null.
      List<ModDependency> readDependencies(JsonNode modConfig, String modId) Fabric declares depends as an object keyed by mod id, so the ids are the block's field names.
      List<String> readProvides(JsonNode modConfig, String modId) Fabric declares provides as a flat array of ids the mod also answers to.
      • Methods inherited from class de.griefed.serverpackcreator.api.modscanning.FabricFamilyScanner

        getUtilities, read
      • 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

      • FabricScanner

        FabricScanner(ObjectMapper objectMapper, Utilities utilities)
        Parameters:
        objectMapper - For JSON-parsing.
        utilities - Common utilities used across ServerPackCreator.
    • Method Detail

      • getScanAnnouncement

         String getScanAnnouncement()

        Logged once before a scan starts, or null to announce nothing. Exists only because the per-loader wording is user-facing progress output.

      • readMinecraftConstraint

         String readMinecraftConstraint(JsonNode modConfig)

        The depends.minecraft range this descriptor states, or null. Read separately from readDependencies because minecraft is deliberately excluded there as the platform — the value is still what says which Minecraft the jar was built against.

      • readDependencies

         List<ModDependency> readDependencies(JsonNode modConfig, String modId)

        Fabric declares depends as an object keyed by mod id, so the ids are the block's field names. A descriptor without the block declares no dependencies and yields an empty list.

      • readProvides

         List<String> readProvides(JsonNode modConfig, String modId)

        Fabric declares provides as a flat array of ids the mod also answers to. Fabric API 0.92.11+1.20.1 uses it to answer to the historical fabric while calling itself fabric-api; the newest builds have dropped the block, so its absence is normal and yields an empty list.