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()
      final Utilities getUtilities()
      String readMinecraftConstraint(JsonNode modConfig) The depends.minecraft range this descriptor states, or null.
      List<ModDependency> readDependencies(JsonNode modConfig, String modId) The non-platform mods this descriptor names as dependencies.
      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

        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

      • 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)

        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.

      • 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.