Class DelegatingResourcePack
- java.lang.Object
- 
- net.minecraft.modding.api.game.client.resources.ResourcePack
- 
- net.minecraft.modding.api.game.client.resources.DelegatingResourcePack
 
 
- 
- All Implemented Interfaces:
- java.io.Closeable,- java.lang.AutoCloseable
 - Direct Known Subclasses:
- FileSystemResourcePack
 
 public class DelegatingResourcePack extends ResourcePack 
- 
- 
Constructor SummaryConstructors Modifier Constructor Description protectedDelegatingResourcePack()DelegatingResourcePack(ResourcePack delegate)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()java.util.stream.Stream<Resource>findResources(@Nullable java.lang.String namespace, java.lang.String directory, java.lang.String extension)Finds allResources that match the given query.protected ResourcePackgetDelegate()java.lang.StringgetDescription()java.lang.StringgetName()java.util.Optional<Resource>getResource(ResourceLocation location)Returns aResourcethat exists at the given location.java.util.stream.Stream<Resource>getResources(java.lang.String path)Returns allResources that are at the given path, regardless of namespace.java.util.stream.Stream<Resource>getResources(ResourceLocation location)Returns allResources that match the given location.byte @Nullable []getThumbnail()booleanisLegacyTexturePack()Signals whether callers should search for assets in legacy locations.
 
- 
- 
- 
Constructor Detail- 
DelegatingResourcePackpublic DelegatingResourcePack(ResourcePack delegate) 
 - 
DelegatingResourcePackprotected DelegatingResourcePack() 
 
- 
 - 
Method Detail- 
getDelegateprotected ResourcePack getDelegate() 
 - 
getNamepublic java.lang.String getName() - Specified by:
- getNamein class- ResourcePack
 
 - 
getDescriptionpublic java.lang.String getDescription() - Overrides:
- getDescriptionin class- ResourcePack
 
 - 
getThumbnailpublic byte @Nullable [] getThumbnail() - Overrides:
- getThumbnailin class- ResourcePack
 
 - 
isLegacyTexturePackpublic boolean isLegacyTexturePack() Description copied from class:ResourcePackSignals whether callers should search for assets in legacy locations.- Overrides:
- isLegacyTexturePackin class- ResourcePack
- Returns:
- If this ResourcePackrepresents a legacy texture pack format.
 
 - 
getResourcespublic java.util.stream.Stream<Resource> getResources(ResourceLocation location) Description copied from class:ResourcePackReturns allResources that match the given location. An empty namespace will search outside theassets/dir. This may return multiple resources in the case of aMultiResourcePack.- Overrides:
- getResourcesin class- ResourcePack
- Parameters:
- location- The exact location of the resources.
- Returns:
- A stream that iterates over the Resources.
 
 - 
getResourcepublic java.util.Optional<Resource> getResource(ResourceLocation location) Description copied from class:ResourcePackReturns aResourcethat exists at the given location. An empty namespace will search outside theassets/dir.- Specified by:
- getResourcein class- ResourcePack
- Parameters:
- location- The exact location of the resource.
- Returns:
- A present optional if the resource exists, Optional.empty()otherwise.
 
 - 
getResourcespublic java.util.stream.Stream<Resource> getResources(java.lang.String path) Description copied from class:ResourcePackReturns allResources that are at the given path, regardless of namespace. This includes the empty namespace only ifResourcePack.isLegacyTexturePack()returns true.- Specified by:
- getResourcesin class- ResourcePack
- Parameters:
- path- The path to search at. All namespaces will be checked.
- Returns:
- A stream that iterates over the Resources.
 
 - 
findResourcespublic java.util.stream.Stream<Resource> findResources(@Nullable @Nullable java.lang.String namespace, java.lang.String directory, java.lang.String extension) Description copied from class:ResourcePackFinds allResources that match the given query. UnlikeResourcePack.getResources(ResourceLocation), this will only return the first occurrence of a resource in the case of aMultiResourcePack.- Specified by:
- findResourcesin class- ResourcePack
- Parameters:
- namespace-- nullto search all namespaces. A specific namespace to search otherwise.
- directory- The directory to search through. End with- /**to search recursively.
- extension- The extension to require files to end with. Should be prefixed with a dot (e.g.- ".json"). Use- ""to ignore file extension.
- Returns:
- A stream that iterates over all the found Resources.
 
 - 
closepublic void close() throws java.io.IOException- Specified by:
- closein interface- java.lang.AutoCloseable
- Specified by:
- closein interface- java.io.Closeable
- Overrides:
- closein class- ResourcePack
- Throws:
- java.io.IOException
 
 
- 
 
-