Package net.neoforged.moddevgradle.dsl
Class RunModel
java.lang.Object
net.neoforged.moddevgradle.dsl.RunModel
- All Implemented Interfaces:
org.gradle.api.artifacts.dsl.Dependencies,org.gradle.api.Named
public abstract class RunModel
extends Object
implements org.gradle.api.Named, org.gradle.api.artifacts.dsl.Dependencies
Model of a run. Each run will generate a
runXxx gradle task and optionally
(enabled by default) a corresponding IDE run.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Named
org.gradle.api.Named.Namer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclient()Equivalent to settingtype = "client".voidEquivalent to settingtype = "clientData".voiddata()Equivalent to settingtype = "data".voidEquivalent to settingideName = ""voidenvironment(String key, String value) Shorthand to set a single environment variable.org.gradle.api.artifacts.ConfigurationAdditional environment variables.abstract org.gradle.api.file.DirectoryPropertyDirectory that the game will run in.abstract org.gradle.api.provider.Property<String>Name for the run configuration in the IDE.abstract org.gradle.api.provider.ListProperty<String>Additional JVM arguments to be added to the run configuration.abstract org.gradle.api.provider.SetProperty<ModModel>The mods for this run.abstract org.gradle.api.provider.Property<org.slf4j.event.Level>Changes the games log-level.abstract org.gradle.api.provider.Property<String>Allows overriding the main class for this run.getName()abstract org.gradle.api.provider.ListProperty<String>Additional program arguments to add to the run configuration.abstract org.gradle.api.provider.Property<org.gradle.api.tasks.SourceSet>Sets the source set to be used as the main classpath of this run.Additional system properties to add to the JVM arguments.List<org.gradle.api.tasks.TaskProvider<?>>Gets the Gradle tasks that should be run before running this run.abstract org.gradle.api.provider.Property<String>getType()Sets the run configuration type from NeoForge that should be used.voidjvmArgument(String arg) Shorthand to add a single JVM argument.voidprogramArgument(String arg) Shorthand to add a single program argument.voidserver()Equivalent to settingtype = "server".voidEquivalent to settingtype = "serverData".voidsetTasksBefore(List<org.gradle.api.tasks.TaskProvider<?>> taskNames) Sets the Gradle tasks that should be run before running this run.voidsystemProperty(String key, String value) Shorthand to set a single system property.voidtaskBefore(org.gradle.api.Task task) Configures the given Task to be run before launching the game.voidtaskBefore(org.gradle.api.tasks.TaskProvider<?> task) Configures the given Task to be run before launching the game.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.gradle.api.artifacts.dsl.Dependencies
constraint, constraint, constraint, constraint, getDependencyConstraintFactory, getDependencyFactory, getObjectFactory, getProject, module, module, project, project
-
Constructor Details
-
RunModel
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceorg.gradle.api.Named
-
getIdeName
Name for the run configuration in the IDE. If this is set to"", no config will be generated. -
getGameDirectory
public abstract org.gradle.api.file.DirectoryProperty getGameDirectory()Directory that the game will run in. Defaults torun/. -
getEnvironment
Additional environment variables. -
environment
Shorthand to set a single environment variable. -
getSystemProperties
Additional system properties to add to the JVM arguments. -
systemProperty
Shorthand to set a single system property. -
getMainClass
Allows overriding the main class for this run. -
getProgramArguments
Additional program arguments to add to the run configuration. -
programArgument
Shorthand to add a single program argument. -
getJvmArguments
Additional JVM arguments to be added to the run configuration. -
jvmArgument
Shorthand to add a single JVM argument. -
getLoadedMods
The mods for this run. Defaults to all mods registered in the project.- See Also:
-
getType
Sets the run configuration type from NeoForge that should be used. -
client
public void client()Equivalent to settingtype = "client". -
clientData
public void clientData()Equivalent to settingtype = "clientData".Should only be used for Minecraft versions starting from 1.21.4. (The first snapshot that supports this is 24w45a).
-
data
public void data()Equivalent to settingtype = "data".Should only be used for Minecraft versions up to 1.21.3 included. (The last snapshot that supports this is 24w44a).
-
server
public void server()Equivalent to settingtype = "server". -
serverData
public void serverData()Equivalent to settingtype = "serverData".Should only be used for Minecraft versions starting from 1.21.4. (The first snapshot that supports this is 24w45a).
-
disableIdeRun
public void disableIdeRun()Equivalent to settingideName = "" -
getTasksBefore
Gets the Gradle tasks that should be run before running this run. -
setTasksBefore
Sets the Gradle tasks that should be run before running this run. This also slows down running through your IDE since it will first execute Gradle to run the requested tasks, and then run the actual game. -
taskBefore
public void taskBefore(org.gradle.api.tasks.TaskProvider<?> task) Configures the given Task to be run before launching the game. This also slows down running through your IDE since it will first execute Gradle to run the requested tasks, and then run the actual game. -
taskBefore
public void taskBefore(org.gradle.api.Task task) Configures the given Task to be run before launching the game. This also slows down running through your IDE since it will first execute Gradle to run the requested tasks, and then run the actual game. -
getAdditionalRuntimeClasspathConfiguration
public org.gradle.api.artifacts.Configuration getAdditionalRuntimeClasspathConfiguration() -
getLogLevel
public abstract org.gradle.api.provider.Property<org.slf4j.event.Level> getLogLevel()Changes the games log-level. -
getSourceSet
public abstract org.gradle.api.provider.Property<org.gradle.api.tasks.SourceSet> getSourceSet()Sets the source set to be used as the main classpath of this run. Defaults to themainsource set. Eclipse does not support having multiple different classpaths per project beyond a separate unit-testing classpath. -
toString
-