Class ModSettings

java.lang.Object
net.fabricmc.loom.api.ModSettings
All Implemented Interfaces:
org.gradle.api.Named

public abstract class ModSettings extends Object implements org.gradle.api.Named
A Named object for setting mod-related values. The name should match the mod id.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Named

    org.gradle.api.Named.Namer
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    configuration(org.gradle.api.artifacts.Configuration configuration)
    Add a Configuration to the mod's classpath group.
    void
    dependency(org.gradle.api.artifacts.Dependency... dependencies)
    Add a number of Dependency to the mod's classpath group.
    abstract org.gradle.api.provider.ListProperty<ExternalClasspathGroup>
    List of ExternalClasspathGroup that will later be resolved to populate the classpath groups from another Gradle project.
    abstract org.gradle.api.file.DirectoryProperty
    The main resource directory in the mod.
    abstract org.gradle.api.file.ConfigurableFileCollection
    List of classpath directories, or jar files used to populate the `fabric.classPathGroups` Fabric Loader system property.
    abstract org.gradle.api.provider.ListProperty<SourceSetReference>
    Deprecated, for removal: This API element is subject to removal in a future version.
    abstract org.gradle.api.Project
     
    void
    Add SourceSet's output directories from the current project to be grouped with the named mod.
    void
    sourceSet(String sourceSetName, String projectPath)
    Add SourceSet's output directories from the supplied project to be grouped with the named mod.
    void
    sourceSet(String sourceSetName, org.gradle.api.artifacts.ProjectDependency projectDependency)
    Add SourceSet's output directories from the supplied project to be grouped with the named mod.
    void
    sourceSet(String name, org.gradle.api.Project project)
    Deprecated.
    Replaced with sourceSet(String, String) to avoid passing a project reference.
    void
    sourceSet(org.gradle.api.tasks.SourceSet sourceSet)
    Add SourceSet's output directories from the current project to be grouped with the named mod.
    void
    sourceSet(org.gradle.api.tasks.SourceSet sourceSet, org.gradle.api.Project project)
    Deprecated.
    Replaced with sourceSet(String, String) to avoid passing a project reference.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.gradle.api.Named

    getName
  • Constructor Details

    • ModSettings

      @Inject public ModSettings()
  • Method Details

    • getModFiles

      public abstract org.gradle.api.file.ConfigurableFileCollection getModFiles()
      List of classpath directories, or jar files used to populate the `fabric.classPathGroups` Fabric Loader system property.
    • getMainResourceDirectory

      @Experimental public abstract org.gradle.api.file.DirectoryProperty getMainResourceDirectory()
      The main resource directory in the mod. On Forge and NeoForge, this is the resource directory that contains mods.toml.
    • sourceSet

      public void sourceSet(org.gradle.api.tasks.SourceSet sourceSet)
      Add SourceSet's output directories from the current project to be grouped with the named mod.
    • sourceSet

      public void sourceSet(String name)
      Add SourceSet's output directories from the current project to be grouped with the named mod.
      Parameters:
      name - the name of the source set
    • sourceSet

      @Deprecated public void sourceSet(org.gradle.api.tasks.SourceSet sourceSet, org.gradle.api.Project project)
      Deprecated.
      Replaced with sourceSet(String, String) to avoid passing a project reference.
      Add SourceSet's output directories from the supplied project to be grouped with the named mod.
    • sourceSet

      @Deprecated public void sourceSet(String name, org.gradle.api.Project project)
      Deprecated.
      Replaced with sourceSet(String, String) to avoid passing a project reference.
      Add SourceSet's output directories from the supplied project to be grouped with the named mod.
      Parameters:
      name - the name of the source set
    • sourceSet

      public void sourceSet(String sourceSetName, String projectPath)
      Add SourceSet's output directories from the supplied project to be grouped with the named mod.

      If the other project is not a Loom project you must apply the `net.fabricmc.fabric-loom-companion` plugin.

      Parameters:
      sourceSetName - the name of the source set
      projectPath - the path of the project the source set belongs to
    • sourceSet

      public void sourceSet(String sourceSetName, org.gradle.api.artifacts.ProjectDependency projectDependency)
      Add SourceSet's output directories from the supplied project to be grouped with the named mod.

      If the other project is not a Loom project you must apply the `net.fabricmc.fabric-loom-companion` plugin.

      Parameters:
      sourceSetName - the name of the source set
      projectDependency - the ProjectDependency the source set belongs to
    • dependency

      public void dependency(org.gradle.api.artifacts.Dependency... dependencies)
      Add a number of Dependency to the mod's classpath group. Should be used to include all dependencies that are shaded into your mod.

      Uses a detached configuration.

    • configuration

      public void configuration(org.gradle.api.artifacts.Configuration configuration)
      Add a Configuration to the mod's classpath group. Should be used to include all dependencies that are shaded into your mod.
    • getExternalGroups

      @Internal public abstract org.gradle.api.provider.ListProperty<ExternalClasspathGroup> getExternalGroups()
      List of ExternalClasspathGroup that will later be resolved to populate the classpath groups from another Gradle project.
    • getProject

      @Inject public abstract org.gradle.api.Project getProject()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getModSourceSets

      @Internal @Deprecated(forRemoval=true) public abstract org.gradle.api.provider.ListProperty<SourceSetReference> getModSourceSets()
      Deprecated, for removal: This API element is subject to removal in a future version.