Interface ModMetadata


public interface ModMetadata
The metadata of a mod.
  • Method Details

    • getType

      String getType()
      Returns the type of the mod.

      The types may be fabric or builtin 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 default Collection<ModDependency> getDepends()
      Deprecated.
      Returns the mod's required dependencies, without which the Loader will terminate loading.
    • getRecommends

      @Deprecated default Collection<ModDependency> getRecommends()
      Deprecated.
      Returns the mod's recommended dependencies, without which the Loader will emit a warning.
    • getSuggests

      @Deprecated default Collection<ModDependency> getSuggests()
      Deprecated.
      Returns the mod's suggested dependencies.
    • getConflicts

      @Deprecated default Collection<ModDependency> getConflicts()
      Deprecated.
      Returns the mod's conflicts, with which the Loader will emit a warning.
    • getBreaks

      @Deprecated default Collection<ModDependency> getBreaks()
      Deprecated.
      Use getDependencies() and filter for ModDependency.Kind.BREAKS instead
      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

      Optional<String> getIconPath(int size)
      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

      boolean containsCustomValue(String key)
      Returns if the mod's fabric.mod.json declares a custom value under key.
      Parameters:
      key - the key
      Returns:
      whether a custom value is present
    • getCustomValue

      CustomValue getCustomValue(String key)
      Returns the mod's fabric.mod.json declared custom value under key.
      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 boolean containsCustomElement(String key)
      Deprecated.
      Use containsCustomValue(java.lang.String) instead, this will be removed (can't expose GSON types)!