Package net.fabricmc.loader.api.metadata
Interface ModMetadata
public interface ModMetadata
The metadata of a mod.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated.boolean
Returns if the mod'sfabric.mod.json
declares a custom value underkey
.Returns the mod's authors.default Collection<ModDependency>
Deprecated.UsegetDependencies()
and filter forModDependency.Kind.BREAKS
insteaddefault Collection<ModDependency>
Deprecated.UsegetDependencies()
and filter forModDependency.Kind.CONFLICTS
insteadReturns the mod's contact information.Returns the mod's contributors.getCustomValue
(String key) Returns the mod'sfabric.mod.json
declared custom value underkey
.Gets all custom values defined by this mod.Returns all of the mod's dependencies.default Collection<ModDependency>
Deprecated.UsegetDependencies()
and filter forModDependency.Kind.DEPENDS
insteadReturns the mod's description.Returns the mod's environment.getIconPath
(int size) Gets the path to an icon.getId()
Returns the mod's ID.Returns the mod's licenses.getName()
Returns the mod's display name.Returns the mod's ID provides.default Collection<ModDependency>
Deprecated.UsegetDependencies()
and filter forModDependency.Kind.RECOMMENDS
insteaddefault Collection<ModDependency>
Deprecated.UsegetDependencies()
and filter forModDependency.Kind.SUGGESTS
insteadgetType()
Returns the type of the mod.Returns the mod's version.
-
Method Details
-
getType
String getType()Returns the type of the mod.The types may be
fabric
orbuiltin
by default.- Returns:
- the type of the mod
-
getId
String getId()Returns the mod's ID.A mod's id must have only lowercase letters, digits,
-
, or_
.- Returns:
- the mod's ID.
-
getProvides
Collection<String> getProvides()Returns the mod's ID provides.The aliases follow the same rules as ID
- Returns:
- the mod's ID provides
-
getVersion
Version getVersion()Returns the mod's version. -
getEnvironment
ModEnvironment getEnvironment()Returns the mod's environment. -
getDependencies
Collection<ModDependency> getDependencies()Returns all of the mod's dependencies. -
getDepends
Deprecated.UsegetDependencies()
and filter forModDependency.Kind.DEPENDS
insteadReturns the mod's required dependencies, without which the Loader will terminate loading. -
getRecommends
Deprecated.UsegetDependencies()
and filter forModDependency.Kind.RECOMMENDS
insteadReturns the mod's recommended dependencies, without which the Loader will emit a warning. -
getSuggests
Deprecated.UsegetDependencies()
and filter forModDependency.Kind.SUGGESTS
insteadReturns the mod's suggested dependencies. -
getConflicts
Deprecated.UsegetDependencies()
and filter forModDependency.Kind.CONFLICTS
insteadReturns the mod's conflicts, with which the Loader will emit a warning. -
getBreaks
Deprecated.UsegetDependencies()
and filter forModDependency.Kind.BREAKS
insteadReturns the mod's conflicts, with which the Loader will terminate loading. -
getName
String getName()Returns the mod's display name. -
getDescription
String getDescription()Returns the mod's description. -
getAuthors
Collection<Person> getAuthors()Returns the mod's authors. -
getContributors
Collection<Person> getContributors()Returns the mod's contributors. -
getContact
ContactInformation getContact()Returns the mod's contact information. -
getLicense
Collection<String> getLicense()Returns the mod's licenses. -
getIconPath
Gets the path to an icon.The standard defines icons as square .PNG files, however their dimensions are not defined - in particular, they are not guaranteed to be a power of two.
The preferred size is used in the following manner:
- the smallest image larger than or equal to the size is returned, if one is present;
- failing that, the largest image is returned.
- Parameters:
size
- the preferred size- Returns:
- the icon path, if any
-
containsCustomValue
Returns if the mod'sfabric.mod.json
declares a custom value underkey
.- Parameters:
key
- the key- Returns:
- whether a custom value is present
-
getCustomValue
Returns the mod'sfabric.mod.json
declared custom value underkey
.- Parameters:
key
- the key- Returns:
- the custom value, or
null
if no such value is present
-
getCustomValues
Map<String,CustomValue> getCustomValues()Gets all custom values defined by this mod.Note this map is unmodifiable.
- Returns:
- a map containing the custom values this mod defines.
-
containsCustomElement
Deprecated.UsecontainsCustomValue(java.lang.String)
instead, this will be removed (can't expose GSON types)!
-
containsCustomValue(java.lang.String)
instead, this will be removed (can't expose GSON types)!