Class NeoForgeExtension

java.lang.Object
net.neoforged.moddevgradle.dsl.NeoForgeExtension

public abstract class NeoForgeExtension extends Object
This is the top-level neoForge extension, used to configure the moddev plugin.
  • Field Details

  • Constructor Details

  • Method Details

    • addModdingDependenciesTo

      public void addModdingDependenciesTo(org.gradle.api.tasks.SourceSet sourceSet)
      Adds the necessary dependencies to develop a Minecraft mod to the given source set. The plugin automatically adds these dependencies to the main source set.
    • getVersion

      public abstract org.gradle.api.provider.Property<String> getVersion()
      NeoForge version number. You have to set either this, getNeoFormVersion() or getNeoFormArtifact().
    • getNeoFormVersion

      public abstract org.gradle.api.provider.Property<String> getNeoFormVersion()
      You can set this property to a version of NeoForm to either override the version used in the version of NeoForge you set, or to compile against Vanilla artifacts that have no NeoForge code added.

      This property is mutually exclusive with getNeoFormArtifact().

    • getNeoForgeArtifact

      public abstract org.gradle.api.provider.Property<String> getNeoForgeArtifact()
      Is derived automatically from getVersion().
      Returns:
      Maven artifact coordinate (group:module:version)
    • getNeoFormArtifact

      public abstract org.gradle.api.provider.Property<String> getNeoFormArtifact()
      Derived automatically from the getNeoFormVersion(). You can override this property to use i.e. MCP for up to 1.20.1.

      This property is mutually exclusive with getNeoForgeArtifact().

      Returns:
      Maven artifact coordinate (group:module:version)
    • accessTransformers

      public void accessTransformers(org.gradle.api.Action<DataFileCollection> action)
      The list of additional access transformers that should be applied to the Minecraft source code.

      If you do not set this property, the plugin will look for an access transformer file at META-INF/accesstransformer.cfg relative to your main source sets resource directories.

      See Also:
    • getAccessTransformers

      public DataFileCollection getAccessTransformers()
    • setAccessTransformers

      public void setAccessTransformers(Object... paths)
      Replaces current access transformers.
    • interfaceInjectionData

      public void interfaceInjectionData(org.gradle.api.Action<DataFileCollection> action)
      The data-files describing additional interface implementation declarations to be added to Minecraft classes.

      This is an advanced property: Injecting interfaces in your development environment using this property will not implement the interfaces in your published mod. You have to use Mixin or ASM to do that.

      See Also:
    • getInterfaceInjectionData

      public DataFileCollection getInterfaceInjectionData()
    • setInterfaceInjectionData

      public void setInterfaceInjectionData(Object... paths)
      Replaces current interface injection data files.
    • getValidateAccessTransformers

      public abstract org.gradle.api.provider.Property<Boolean> getValidateAccessTransformers()
      Enable access transformer validation, raising fatal errors if an AT targets a member that doesn't exist.

      Default false

    • getMods

      public org.gradle.api.NamedDomainObjectContainer<ModModel> getMods()
    • mods

      public void mods(org.gradle.api.Action<org.gradle.api.NamedDomainObjectContainer<ModModel>> action)
    • getRuns

      public org.gradle.api.NamedDomainObjectContainer<RunModel> getRuns()
    • runs

      public void runs(org.gradle.api.Action<org.gradle.api.NamedDomainObjectContainer<RunModel>> action)
    • getParchment

      public Parchment getParchment()
    • parchment

      public void parchment(org.gradle.api.Action<Parchment> action)
    • getUnitTest

      public UnitTest getUnitTest()
    • unitTest

      public void unitTest(org.gradle.api.Action<UnitTest> action)
    • getIdeSyncTasks

      public abstract org.gradle.api.provider.ListProperty<org.gradle.api.tasks.TaskProvider<?>> getIdeSyncTasks()
      The tasks to be run when the IDE reloads the Gradle project.
    • ideSyncTask

      public void ideSyncTask(org.gradle.api.tasks.TaskProvider<?> task)
      Configures the given task to be run when the IDE reloads the Gradle project.
    • ideSyncTask

      public void ideSyncTask(org.gradle.api.Task task)
      Configures the given task to be run when the IDE reloads the Gradle project.
    • getAdditionalMinecraftArtifacts

      public abstract org.gradle.api.provider.MapProperty<String,File> getAdditionalMinecraftArtifacts()
      Used to request additional Minecraft artifacts from NFRT for advanced usage scenarios.

      Maps a result name to the file it should be written to. The result names are specific to the NeoForm process that is being used in the background and may change between NeoForge versions.