Interface ImageResource

All Known Implementing Classes:
ImageResource.PackAsset, ImageResource.PackRoot

public sealed interface ImageResource permits ImageResource.PackRoot, ImageResource.PackAsset
An image resource. This is primarily used for mod display info.
See Also:
  • Method Details

    • get

      Retrieves the image resource contents from the given resource manager. If the resource does not exist, this returns null.
      Parameters:
      resourceManager - the resource manager, which is expected to contain client-side resource packs
      Returns:
      the supplier for the image bytes
    • packRoot

      static ImageResource packRoot(String packId, String path)

      Creates an image resource that exists within a specific pack and path.

      The image resource is always tied to the specific pack ID, and is unaffected by any another pack providing a resource at the same path.

      Parameters:
      packId - the pack ID
      path - the path to the image resource
      Returns:
      an image resource for the given pack and path
    • packAsset

      static ImageResource packAsset(Identifier id)

      Creates an image resource for a given location, which is searched among the active packs.

      The image resource will be searched in the active resource manager, and is thus affected by resource pack ordering, filtering, and overriding of resources.