Package net.fabricmc.loom.api.fmj
Class FabricModJsonV1Spec
java.lang.Object
net.fabricmc.loom.api.fmj.FabricModJsonV1Spec
Represents the Fabric mod JSON v1 specification.
This class defines properties of a Fabric mod JSON file via a type-safe DSL.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a new author with the given name.voidauthor(String name, org.gradle.api.Action<FabricModJsonV1Spec.Person> action) Add a new author with the given name, and configure it with the given action.voidauthor(org.gradle.api.Action<FabricModJsonV1Spec.Person> action) Add a new author, and configure it with the given action.voidAdd a broken dependency on another mod with the given mod ID and version requirements.voidAdd a broken dependency on another mod with the given mod ID and a single version requirement.voidbreaks(String modId, org.gradle.api.Action<FabricModJsonV1Spec.Dependency> action) Add a broken dependency on another mod with the given mod ID, and configure it with the given action.voidbreaks(org.gradle.api.Action<FabricModJsonV1Spec.Dependency> action) Add a broken dependency, and configure it with the given action.voidclient()Sets the environment to 'client', indicating the mod only runs on the client side.voidAdd a conflicting dependency on another mod with the given mod ID and version requirements.voidAdd a conflicting dependency on another mod with the given mod ID and a single version requirement.voidconflicts(String modId, org.gradle.api.Action<FabricModJsonV1Spec.Dependency> action) Add a conflicting dependency on another mod with the given mod ID, and configure it with the given action.voidconflicts(org.gradle.api.Action<FabricModJsonV1Spec.Dependency> action) Add a conflicting dependency, and configure it with the given action.voidcontributor(String name) Add a new contributor with the given name.voidcontributor(String name, org.gradle.api.Action<FabricModJsonV1Spec.Person> action) Add a new contributor with the given name, and configure it with the given action.voidcontributor(org.gradle.api.Action<FabricModJsonV1Spec.Person> action) Add a new contributor, and configure it with the given action.voidAdd a required dependency on another mod with the given mod ID and version requirements.voidAdd a required dependency on another mod with the given mod ID and a single version requirement.voiddepends(String modId, org.gradle.api.Action<FabricModJsonV1Spec.Dependency> action) Add a required dependency on another mod with the given mod ID, and configure it with the given action.voiddepends(org.gradle.api.Action<FabricModJsonV1Spec.Dependency> action) Add a required dependency, and configure it with the given action.voidentrypoint(String entrypoint, String value) Add a new entrypoint with the given name and value.voidentrypoint(String entrypoint, String value, String adapter) Add a new entrypoint with the given name, value, and language adapter.voidentrypoint(String entrypoint, String value, org.gradle.api.Action<FabricModJsonV1Spec.Entrypoint> action) Add a new entrypoint with the given name and value, and configure it with the given action.voidentrypoint(String entrypoint, org.gradle.api.Action<FabricModJsonV1Spec.Entrypoint> action) Add a new entrypoint with the given name, and configure it with the given action.abstract org.gradle.api.provider.Property<String> The path to the access widener file for the mod.abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Person> A list of authors of the mod.abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Dependency> A list of dependencies that this mod breaks.abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Dependency> A list of conflicting dependencies.A map of contact information for the mod.abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Person> A list of contributors to the mod.A map of custom data for the mod.abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Dependency> A list of depedencies that this mod depends on (required).abstract org.gradle.api.provider.Property<String> The description of the mod.abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Entrypoint> A list of entrypoints for the mod.abstract org.gradle.api.provider.Property<String> The environment the mod runs in.abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Icon> getIcons()A list of icons for the mod.abstract org.gradle.api.provider.ListProperty<String> getJars()A list of additional JARs to load with the mod.A map of language adapters for the mod.abstract org.gradle.api.provider.ListProperty<String> A list of licenses for the mod.abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Mixin> A list of Mixin configurations for the mod.abstract org.gradle.api.provider.Property<String> getModId()The ID of the mod.abstract org.gradle.api.provider.Property<String> getName()The display name of the mod.protected abstract org.gradle.api.model.ObjectFactoryabstract org.gradle.api.provider.ListProperty<String> A list of other mod IDs that this mod uses as aliases.abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Dependency> A list of recommended dependencies.abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Dependency> A list of suggested dependencies.abstract org.gradle.api.provider.Property<String> The version of the mod.voidAdd a new icon with the given size and path.voidAdd a new icon with the given path.voidicon(String path, org.gradle.api.Action<FabricModJsonV1Spec.Icon> action) Add a new icon with the given path, and configure it with the given action.voidicon(org.gradle.api.Action<FabricModJsonV1Spec.Icon> action) Add a new icon, and configure it with the given action.voidAdd a new Mixin configuration with the given value.voidmixin(String value, org.gradle.api.Action<FabricModJsonV1Spec.Mixin> action) Add a new Mixin configuration with the given value, and configure it with the given action.voidmixin(org.gradle.api.Action<FabricModJsonV1Spec.Mixin> action) Add a new Mixin configuration, and configure it with the given action.voidrecommends(String modId, Iterable<String> versionRequirements) Add a recommended dependency on another mod with the given mod ID and version requirements.voidrecommends(String modId, String versionRequirement) Add a recommended dependency on another mod with the given mod ID and a single version requirement.voidrecommends(String modId, org.gradle.api.Action<FabricModJsonV1Spec.Dependency> action) Add a recommended dependency on another mod with the given mod ID, and configure it with the given action.voidrecommends(org.gradle.api.Action<FabricModJsonV1Spec.Dependency> action) Add a recommended dependency, and configure it with the given action.voidserver()Sets the environment to 'server', indicating the mod only runs on the server side.voidAdd a suggested dependency on another mod with the given mod ID and version requirements.voidAdd a suggested dependency on another mod with the given mod ID and a single version requirement.voidsuggests(String modId, org.gradle.api.Action<FabricModJsonV1Spec.Dependency> action) Add a suggested dependency on another mod with the given mod ID, and configure it with the given action.voidsuggests(org.gradle.api.Action<FabricModJsonV1Spec.Dependency> action) Add a suggested dependency, and configure it with the given action.
-
Constructor Details
-
FabricModJsonV1Spec
public FabricModJsonV1Spec()
-
-
Method Details
-
getModId
The ID of the mod.- Returns:
- A
Propertycontaining aStringrepresenting the mod ID
-
getVersion
The version of the mod.- Returns:
- A
Propertycontaining aStringrepresenting the mod version
-
getName
The display name of the mod.- Returns:
- A
Propertycontaining aStringrepresenting the mod name
-
getDescription
The description of the mod.- Returns:
- A
Propertycontaining aStringrepresenting the mod description
-
getProvides
A list of other mod IDs that this mod uses as aliases.- Returns:
- A
ListPropertycontaining a list ofStringrepresenting the mod aliases
-
getEnvironment
The environment the mod runs in.One of `client`, `server`, or `*`.
- Returns:
- A
Propertycontaining aStringrepresenting the mod environment
-
client
public void client()Sets the environment to 'client', indicating the mod only runs on the client side. -
server
public void server()Sets the environment to 'server', indicating the mod only runs on the server side. -
getEntrypoints
@Input @Optional public abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Entrypoint> getEntrypoints()A list of entrypoints for the mod.- Returns:
- A
ListPropertycontaining a list ofFabricModJsonV1Spec.Entrypointrepresenting the mod entrypoints
-
entrypoint
Add a new entrypoint with the given name and value.- Parameters:
entrypoint- The name of the entrypoint, such as "main" or "client"value- The value of the entrypoint, typically a fully qualified class name
-
entrypoint
Add a new entrypoint with the given name, value, and language adapter.- Parameters:
entrypoint- The name of the entrypoint, such as "main" or "client"value- The value of the entrypoint, typically a fully qualified class nameadapter- The language adapter of the entrypoint, such as "kotlin" or "scala"
-
entrypoint
public void entrypoint(String entrypoint, String value, org.gradle.api.Action<FabricModJsonV1Spec.Entrypoint> action) Add a new entrypoint with the given name and value, and configure it with the given action.- Parameters:
entrypoint- The name of the entrypoint, such as "main" or "client"value- The value of the entrypoint, typically a fully qualified class nameaction- An action to configure the entrypoint further
-
entrypoint
public void entrypoint(String entrypoint, org.gradle.api.Action<FabricModJsonV1Spec.Entrypoint> action) Add a new entrypoint with the given name, and configure it with the given action.- Parameters:
entrypoint- The name of the entrypoint, such as "main" or "client"action- An action to configure the entrypoint
-
getJars
A list of additional JARs to load with the mod.A path relative to the root of the mod JAR.
- Returns:
- A
ListPropertycontaining a list ofStringrepresenting the additional JARs
-
getMixins
@Input @Optional public abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Mixin> getMixins()A list of Mixin configurations for the mod.- Returns:
- A
ListPropertycontaining a list ofFabricModJsonV1Spec.Mixinrepresenting the mod Mixins
-
mixin
Add a new Mixin configuration with the given value.- Parameters:
value- The value of the Mixin configuration, typically a path to a JSON file
-
mixin
Add a new Mixin configuration with the given value, and configure it with the given action.- Parameters:
value- The value of the Mixin configuration, typically a path to a JSON fileaction- An action to configure the Mixin further
-
mixin
Add a new Mixin configuration, and configure it with the given action.- Parameters:
action- An action to configure the Mixin
-
getAccessWidener
The path to the access widener file for the mod.A path relative to the root of the mod JAR.
- Returns:
- A
Propertycontaining aStringrepresenting the access widener path
-
getDepends
@Input @Optional public abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Dependency> getDepends()A list of depedencies that this mod depends on (required).- Returns:
- A
ListPropertycontaining a list ofFabricModJsonV1Spec.Dependencyrepresenting the mod dependencies
-
depends
Add a required dependency on another mod with the given mod ID and version requirements.- Parameters:
modId- The mod ID of the dependencyversionRequirements- A collection of version requirement strings
-
depends
Add a required dependency on another mod with the given mod ID and a single version requirement.- Parameters:
modId- The mod ID of the dependencyversionRequirement- A version requirement string
-
depends
Add a required dependency on another mod with the given mod ID, and configure it with the given action.- Parameters:
modId- The mod ID of the dependencyaction- An action to configure the dependency further
-
depends
Add a required dependency, and configure it with the given action.- Parameters:
action- An action to configure the dependency
-
getRecommends
@Input @Optional public abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Dependency> getRecommends()A list of recommended dependencies.- Returns:
- A
ListPropertycontaining a list ofFabricModJsonV1Spec.Dependencyrepresenting the mod recommended dependencies
-
recommends
Add a recommended dependency on another mod with the given mod ID and version requirements.- Parameters:
modId- The mod ID of the recommended dependencyversionRequirements- A collection of version requirement strings
-
recommends
Add a recommended dependency on another mod with the given mod ID and a single version requirement.- Parameters:
modId- The mod ID of the recommended dependencyversionRequirement- A version requirement string
-
recommends
Add a recommended dependency on another mod with the given mod ID, and configure it with the given action.- Parameters:
modId- The mod ID of the recommended dependencyaction- An action to configure the recommended dependency further
-
recommends
Add a recommended dependency, and configure it with the given action.- Parameters:
action- An action to configure the recommended dependency
-
getSuggests
@Input @Optional public abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Dependency> getSuggests()A list of suggested dependencies.- Returns:
- A
ListPropertycontaining a list ofFabricModJsonV1Spec.Dependencyrepresenting the mod suggested dependencies
-
suggests
Add a suggested dependency on another mod with the given mod ID and version requirements.- Parameters:
modId- The mod ID of the suggested dependencyversionRequirements- A collection of version requirement strings
-
suggests
Add a suggested dependency on another mod with the given mod ID and a single version requirement.- Parameters:
modId- The mod ID of the suggested dependencyversionRequirement- A version requirement string
-
suggests
Add a suggested dependency on another mod with the given mod ID, and configure it with the given action.- Parameters:
modId- The mod ID of the suggested dependencyaction- An action to configure the suggested dependency further
-
suggests
Add a suggested dependency, and configure it with the given action.- Parameters:
action- An action to configure the suggested dependency
-
getConflicts
@Input @Optional public abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Dependency> getConflicts()A list of conflicting dependencies.- Returns:
- A
ListPropertycontaining a list ofFabricModJsonV1Spec.Dependencyrepresenting the mod conflicting dependencies
-
conflicts
Add a conflicting dependency on another mod with the given mod ID and version requirements.- Parameters:
modId- The mod ID of the conflicting dependencyversionRequirements- A collection of version requirement strings
-
conflicts
Add a conflicting dependency on another mod with the given mod ID and a single version requirement.- Parameters:
modId- The mod ID of the conflicting dependencyversionRequirement- A version requirement string
-
conflicts
Add a conflicting dependency on another mod with the given mod ID, and configure it with the given action.- Parameters:
modId- The mod ID of the conflicting dependencyaction- An action to configure the conflicting dependency further
-
conflicts
Add a conflicting dependency, and configure it with the given action.- Parameters:
action- An action to configure the conflicting dependency
-
getBreaks
@Input @Optional public abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Dependency> getBreaks()A list of dependencies that this mod breaks.- Returns:
- A
ListPropertycontaining a list ofFabricModJsonV1Spec.Dependencyrepresenting the mod broken dependencies
-
breaks
Add a broken dependency on another mod with the given mod ID and version requirements.- Parameters:
modId- The mod ID of the broken dependencyversionRequirements- A collection of version requirement strings
-
breaks
Add a broken dependency on another mod with the given mod ID and a single version requirement.- Parameters:
modId- The mod ID of the broken dependencyversionRequirement- A version requirement string
-
breaks
Add a broken dependency on another mod with the given mod ID, and configure it with the given action.- Parameters:
modId- The mod ID of the broken dependencyaction- An action to configure the broken dependency further
-
breaks
Add a broken dependency, and configure it with the given action.- Parameters:
action- An action to configure the broken dependency
-
getLicenses
A list of licenses for the mod.- Returns:
- A
ListPropertycontaining a list ofStringrepresenting the mod licenses
-
getAuthors
@Input @Optional public abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Person> getAuthors()A list of authors of the mod.- Returns:
- A
ListPropertycontaining a list ofFabricModJsonV1Spec.Personrepresenting the mod authors
-
author
Add a new author with the given name.- Parameters:
name- The name of the author
-
author
Add a new author with the given name, and configure it with the given action.- Parameters:
name- The name of the authoraction- An action to configure the author further
-
author
Add a new author, and configure it with the given action.- Parameters:
action- An action to configure the author
-
getContributors
@Input @Optional public abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Person> getContributors()A list of contributors to the mod.- Returns:
- A
ListPropertycontaining a list ofFabricModJsonV1Spec.Personrepresenting the mod contributors
-
contributor
Add a new contributor with the given name.- Parameters:
name- The name of the contributor
-
contributor
Add a new contributor with the given name, and configure it with the given action.- Parameters:
name- The name of the contributoraction- An action to configure the contributor further
-
contributor
Add a new contributor, and configure it with the given action.- Parameters:
action- An action to configure the contributor
-
getContactInformation
@Input @Optional public abstract org.gradle.api.provider.MapProperty<String,String> getContactInformation()A map of contact information for the mod.The key is the platform (e.g. "email", "github", "discord") and the value is the contact detail for that platform.
-
getIcons
@Input @Optional public abstract org.gradle.api.provider.ListProperty<FabricModJsonV1Spec.Icon> getIcons()A list of icons for the mod.- Returns:
- A
ListPropertycontaining a list ofFabricModJsonV1Spec.Iconrepresenting the mod icons
-
icon
Add a new icon with the given path.Note: Only 1 unsized icon is allowed. If you need to specify multiple icons or sizes, use
icon(int, String)- Parameters:
path- The path to the icon file, relative to the root of the mod JAR
-
icon
Add a new icon with the given size and path.- Parameters:
size- The size of the icon in pixels (e.g. 16, 32, 64)path- The path to the icon file, relative to the root of the mod JAR
-
icon
Add a new icon with the given path, and configure it with the given action.- Parameters:
path- The path to the icon file, relative to the root of the mod JARaction- An action to configure the icon further
-
icon
Add a new icon, and configure it with the given action.- Parameters:
action- An action to configure the icon
-
getLanguageAdapters
@Input @Optional public abstract org.gradle.api.provider.MapProperty<String,String> getLanguageAdapters()A map of language adapters for the mod.The key is the adapter name and the value is the fully qualified class name of the adapter.
-
getCustomData
A map of custom data for the mod.This can be used by other tools to store additional information about the mod.
The object is encoded to JSON using Gson, so it can be any type that Gson supports.
-
getObjectFactory
@Inject @Internal protected abstract org.gradle.api.model.ObjectFactory getObjectFactory()
-