Package net.fabricmc.loader.api.metadata
Interface ModMetadata
public interface ModMetadata
The metadata of a mod.
-
Method Summary
Modifier and Type Method Description boolean
containsCustomElement(String key)
Deprecated.boolean
containsCustomValue(String key)
Returns if the mod'sfabric.mod.json
declares a custom value underkey
.Collection<Person>
getAuthors()
Returns the mod's authors.Collection<ModDependency>
getBreaks()
Returns the mod's conflicts, with which the Loader will terminate loading.Collection<ModDependency>
getConflicts()
Returns the mod's conflicts, with which the Loader will emit a warning.ContactInformation
getContact()
Returns the mod's contact information.Collection<Person>
getContributors()
Returns the mod's contributors.com.google.gson.JsonElement
getCustomElement(String key)
Deprecated.UsegetCustomValue(java.lang.String)
instead, this will be removed (can't expose GSON types)!CustomValue
getCustomValue(String key)
Returns the mod'sfabric.mod.json
declared custom value underkey
.Map<String,CustomValue>
getCustomValues()
Gets all custom values defined by this mod.Collection<ModDependency>
getDepends()
Returns the mod's required dependencies, without which the Loader will terminate loading.String
getDescription()
Returns the mod's description.ModEnvironment
getEnvironment()
Returns the mod's environment.Optional<String>
getIconPath(int size)
Gets the path to an icon.String
getId()
Returns the mod's ID.Collection<String>
getLicense()
Returns the mod's licenses.String
getName()
Returns the mod's display name.Collection<String>
getProvides()
Returns the mod's ID provides.Collection<ModDependency>
getRecommends()
Returns the mod's recommended dependencies, without which the Loader will emit a warning.Collection<ModDependency>
getSuggests()
Returns the mod's suggested dependencies.String
getType()
Returns the type of the mod.Version
getVersion()
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. -
getDepends
Collection<ModDependency> getDepends()Returns the mod's required dependencies, without which the Loader will terminate loading. -
getRecommends
Collection<ModDependency> getRecommends()Returns the mod's recommended dependencies, without which the Loader will emit a warning. -
getSuggests
Collection<ModDependency> getSuggests()Returns the mod's suggested dependencies. -
getConflicts
Collection<ModDependency> getConflicts()Returns the mod's conflicts, with which the Loader will emit a warning. -
getBreaks
Collection<ModDependency> getBreaks()Returns 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)! -
getCustomElement
Deprecated.UsegetCustomValue(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)!