Interface ImageResource
- All Known Implementing Classes:
ImageResource.PackAsset, ImageResource.PackRoot
An image resource. This is primarily used for mod display info.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordstatic final record -
Method Summary
Modifier and TypeMethodDescriptionget(ResourceManager resourceManager) Retrieves the image resource contents from the given resource manager.static ImageResourcepackAsset(Identifier id) Creates an image resource for a given location, which is searched among the active packs.static ImageResourceCreates an image resource that exists within a specific pack and path.
-
Method Details
-
get
Retrieves the image resource contents from the given resource manager. If the resource does not exist, this returnsnull.- Parameters:
resourceManager- the resource manager, which is expected to contain client-side resource packs- Returns:
- the supplier for the image bytes
-
packRoot
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 IDpath- the path to the image resource- Returns:
- an image resource for the given pack and path
-
packAsset
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.
-