Package net.minecraftforge.resource
Class DelegatingPackResources
java.lang.Object
net.minecraft.server.packs.AbstractPackResources
net.minecraftforge.resource.DelegatingPackResources
- All Implemented Interfaces:
AutoCloseable
,PackResources
,IForgePackResources
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.server.packs.PackResources
PackResources.ResourceOutput
-
Field Summary
Modifier and TypeFieldDescriptionprivate final List
<PackResources> private final Map
<String, List<PackResources>> private final Map
<String, List<PackResources>> private final PackMetadataSection
Fields inherited from interface net.minecraft.server.packs.PackResources
METADATA_EXTENSION, PACK_META
-
Constructor Summary
ConstructorDescriptionDelegatingPackResources
(PackLocationInfo info, PackMetadataSection packMeta, List<? extends PackResources> packs) -
Method Summary
Modifier and TypeMethodDescriptionprivate Map
<String, List<PackResources>> buildNamespaceMap
(PackType type, List<PackResources> packList) void
close()
private List
<PackResources> getCandidatePacks
(PackType type, ResourceLocation location) @Nullable Collection
<PackResources> Gets a collection ofPackResource
instances nested inside this pack.<T> T
getMetadataSection
(MetadataSectionSerializer<T> deserializer) getNamespaces
(PackType type) @Nullable IoSupplier
<InputStream> getResource
(PackType type, ResourceLocation location) @Nullable IoSupplier
<InputStream> getRootResource
(String... paths) void
listResources
(PackType type, String resourceNamespace, String paths, PackResources.ResourceOutput resourceOutput) supplier()
Methods inherited from class net.minecraft.server.packs.AbstractPackResources
getMetadataFromStream, location, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraftforge.common.extensions.IForgePackResources
isHidden
Methods inherited from interface net.minecraft.server.packs.PackResources
knownPackInfo, packId
-
Field Details
-
packMeta
-
delegates
-
namespacesAssets
-
namespacesData
-
-
Constructor Details
-
DelegatingPackResources
public DelegatingPackResources(PackLocationInfo info, PackMetadataSection packMeta, List<? extends PackResources> packs)
-
-
Method Details
-
buildNamespaceMap
private Map<String,List<PackResources>> buildNamespaceMap(PackType type, List<PackResources> packList) -
getMetadataSection
@Nullable public <T> T getMetadataSection(MetadataSectionSerializer<T> deserializer) throws IOException - Specified by:
getMetadataSection
in interfacePackResources
- Overrides:
getMetadataSection
in classAbstractPackResources
- Throws:
IOException
-
listResources
public void listResources(PackType type, String resourceNamespace, String paths, PackResources.ResourceOutput resourceOutput) -
getNamespaces
-
close
public void close() -
getRootResource
-
getResource
@Nullable public @Nullable IoSupplier<InputStream> getResource(PackType type, ResourceLocation location) -
getChildren
Description copied from interface:IForgePackResources
Gets a collection ofPackResource
instances nested inside this pack. Used to merge several packs into one entry in the resource pack selection UI without losing the ability for each pack to return a resource inResourceManager.getResourceStack(ResourceLocation)
- Returns:
- Collection of nested
PackResource
, or null if this pack has no children - See Also:
-
getCandidatePacks
-
supplier
-