Class ForgeTomlScanner

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

    
    public class ForgeTomlScanner
    extends DescriptorScanner
                        

    mods.toml-based scanning of Forge-Minecraft mods for Minecraft 1.16.5 and newer.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      ForgeTomlScanner(TomlParser tomlParser)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      String getModsToml() Path of the descriptor inside a Forge jar.
      final Regex getNeoForgeMinecraft() Dependency ids that are the platform itself rather than another mod.
      final Regex getClient() The side value a Forge descriptor uses for client-only, spelled the way the TOML spells it: upper case, matched exactly.
      ScannedMod read(File modJar) Read one mod's mods.toml for its sideness.
      • Methods inherited from class de.griefed.serverpackcreator.api.modscanning.DescriptorScanner

        getScanAnnouncement, scan
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ForgeTomlScanner

        ForgeTomlScanner(TomlParser tomlParser)
        Parameters:
        tomlParser - To parse .toml-files.
    • Method Detail

      • getModsToml

         String getModsToml()

        Path of the descriptor inside a Forge jar. open because NeoForge moved it, and that subclass overrides it.

      • getNeoForgeMinecraft

         final Regex getNeoForgeMinecraft()

        Dependency ids that are the platform itself rather than another mod. A mod declaring these is not depending on anything the server pack has to keep, so they must not pull a jar into the dependency list.

      • getClient

         final Regex getClient()

        The side value a Forge descriptor uses for client-only, spelled the way the TOML spells it: upper case, matched exactly. Read together with neoForgeMinecraft — it is a side=CLIENT on the platform dependency that marks the mod itself clientside, which is the one signal read is after.

      • read

         ScannedMod read(File modJar)

        Read one mod's mods.toml for its sideness.

        The side a mod demands of the platform (Forge/NeoForge/Minecraft) is taken as its own: a mod requiring Minecraft side=CLIENT is clientside. Every other dependency is recorded as a dependency instead. A mod declaring no dependencies at all is treated as server-side, to prevent false positives.

        Parameters:
        modJar - The jar whose mods.toml to read.
        Returns:

        What this mod declared.