Package net.fabricmc.loader.api.metadata
Interface ModMetadata
public interface ModMetadata
The metadata of a mod.
-
Method Summary
Modifier and Type Method Description booleancontainsCustomElement(String key)Deprecated.booleancontainsCustomValue(String key)Returns if the mod'sfabric.mod.jsondeclares 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.ContactInformationgetContact()Returns the mod's contact information.Collection<Person>getContributors()Returns the mod's contributors.com.google.gson.JsonElementgetCustomElement(String key)Deprecated.UsegetCustomValue(java.lang.String)instead, this will be removed (can't expose GSON types)!CustomValuegetCustomValue(String key)Returns the mod'sfabric.mod.jsondeclared 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.StringgetDescription()Returns the mod's description.ModEnvironmentgetEnvironment()Returns the mod's environment.Optional<String>getIconPath(int size)Gets the path to an icon.StringgetId()Returns the mod's ID.Collection<String>getLicense()Returns the mod's licenses.StringgetName()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.StringgetType()Returns the type of the mod.VersiongetVersion()Returns the mod's version.
-
Method Details
-
getType
String getType()Returns the type of the mod.The types may be
fabricorbuiltinby 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.jsondeclares a custom value underkey.- Parameters:
key- the key- Returns:
- whether a custom value is present
-
getCustomValue
Returns the mod'sfabric.mod.jsondeclared custom value underkey.- Parameters:
key- the key- Returns:
- the custom value, or
nullif 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)!