Package net.neoforged.moddevgradle.dsl
Class ModDevExtension
java.lang.Object
net.neoforged.moddevgradle.dsl.ModDevExtension
- Direct Known Subclasses:
NeoForgeExtension
-
Constructor Summary
ConstructorsConstructorDescriptionModDevExtension(org.gradle.api.Project project, DataFileCollection accessTransformers, DataFileCollection interfaceInjectionData) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccessTransformers(org.gradle.api.Action<DataFileCollection> action) The list of additional access transformers that should be applied to the Minecraft source code.voidaddModdingDependenciesTo(org.gradle.api.tasks.SourceSet sourceSet) Adds the necessary dependencies to develop a Minecraft mod to additional source sets.Used to request additional Minecraft artifacts from NFRT for advanced usage scenarios.abstract org.gradle.api.provider.ListProperty<org.gradle.api.tasks.TaskProvider<?>>The tasks to be run when the IDE reloads the Gradle project.After enabling modding, you can retrieve the effective Minecraft version using this getter.org.gradle.api.NamedDomainObjectContainer<ModModel>getMods()org.gradle.api.NamedDomainObjectContainer<RunModel>getRuns()abstract org.gradle.api.provider.Property<Boolean>Enable access transformer validation, raising fatal errors if an AT targets a member that doesn't exist.After enabling modding, you can retrieve the version of the modding platform you picked using this getter.After enabling modding, you can retrieve the capabilities of the version you picked using this getter.voidideSyncTask(org.gradle.api.Task task) Configures the given task to be run when the IDE reloads the Gradle project.voidideSyncTask(org.gradle.api.tasks.TaskProvider<?> task) Configures the given task to be run when the IDE reloads the Gradle project.voidinterfaceInjectionData(org.gradle.api.Action<DataFileCollection> action) The data-files describing additional interface implementation declarations to be added to Minecraft classes.voidvoidvoidvoidsetAccessTransformers(Object... paths) Replaces current access transformers.voidsetInterfaceInjectionData(Object... paths) Replaces current interface injection data files.
-
Constructor Details
-
ModDevExtension
@Inject public ModDevExtension(org.gradle.api.Project project, DataFileCollection accessTransformers, DataFileCollection interfaceInjectionData)
-
-
Method Details
-
accessTransformers
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.cfgrelative to your main source sets resource directories.- See Also:
-
getAccessTransformers
-
setAccessTransformers
Replaces current access transformers. -
interfaceInjectionData
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
-
setInterfaceInjectionData
Replaces current interface injection data files. -
getValidateAccessTransformers
Enable access transformer validation, raising fatal errors if an AT targets a member that doesn't exist.Default
false -
getMods
-
mods
-
getRuns
-
runs
-
getParchment
-
parchment
-
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
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.
-
addModdingDependenciesTo
public void addModdingDependenciesTo(org.gradle.api.tasks.SourceSet sourceSet) Adds the necessary dependencies to develop a Minecraft mod to additional source sets. If you do not specify a source set when you enable modding, the dependencies are automatically added to the main source set. -
getVersion
After enabling modding, you can retrieve the version of the modding platform you picked using this getter. I.e. the NeoForge or Forge version. If you chose to enable vanilla-only mode, this getter will throw. -
getMinecraftVersion
After enabling modding, you can retrieve the effective Minecraft version using this getter. -
getVersionCapabilities
After enabling modding, you can retrieve the capabilities of the version you picked using this getter.
-