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
FieldsModifier and TypeFieldDescriptionprivate final List<PackResources>private final Map<String,List<PackResources>> private final Map<String,List<PackResources>> private final PackMetadataSectionFields inherited from interface net.minecraft.server.packs.PackResources
METADATA_EXTENSION, PACK_META -
Constructor Summary
ConstructorsConstructorDescriptionDelegatingPackResources(String packId, boolean isBuiltin, PackMetadataSection packMeta, List<? extends PackResources> packs) -
Method Summary
Modifier and TypeMethodDescriptionprivate Map<String,List<PackResources>> buildNamespaceMap(PackType type, List<PackResources> packList) voidclose()private List<PackResources>getCandidatePacks(PackType type, ResourceLocation location) @Nullable Collection<PackResources>Gets a collection ofPackResourceinstances nested inside this pack.<T> TgetMetadataSection(MetadataSectionSerializer<T> deserializer) getNamespaces(PackType type) @Nullable IoSupplier<InputStream>getResource(PackType type, ResourceLocation location) @Nullable IoSupplier<InputStream>getRootResource(String... paths) voidlistResources(PackType type, String resourceNamespace, String paths, PackResources.ResourceOutput resourceOutput) Methods inherited from class net.minecraft.server.packs.AbstractPackResources
getMetadataFromStream, isBuiltin, packId, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraftforge.common.extensions.IForgePackResources
isHidden
-
Field Details
-
packMeta
-
delegates
-
namespacesAssets
-
namespacesData
-
-
Constructor Details
-
DelegatingPackResources
public DelegatingPackResources(String packId, boolean isBuiltin, 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:
getMetadataSectionin interfacePackResources- Overrides:
getMetadataSectionin 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:IForgePackResourcesGets a collection ofPackResourceinstances 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
-