Package net.minecraftforge.fml.packs
Class DelegatingResourcePack
- java.lang.Object
-
- net.minecraft.resources.ResourcePack
-
- net.minecraftforge.fml.packs.DelegatingResourcePack
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,IResourcePack
,IForgeResourcePack
public class DelegatingResourcePack extends ResourcePack
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<IResourcePack>
delegates
private java.lang.String
name
private java.util.Map<java.lang.String,java.util.List<IResourcePack>>
namespacesAssets
private java.util.Map<java.lang.String,java.util.List<IResourcePack>>
namespacesData
private PackMetadataSection
packInfo
-
Fields inherited from class net.minecraft.resources.ResourcePack
file
-
-
Constructor Summary
Constructors Constructor Description DelegatingResourcePack(java.lang.String id, java.lang.String name, PackMetadataSection packInfo, java.util.List<? extends IResourcePack> packs)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.Map<java.lang.String,java.util.List<IResourcePack>>
buildNamespaceMap(ResourcePackType type, java.util.List<IResourcePack> packList)
void
close()
private java.util.List<IResourcePack>
getCandidatePacks(ResourcePackType type, ResourceLocation location)
private static java.lang.String
getFullPath(ResourcePackType type, ResourceLocation location)
<T> T
getMetadataSection(IMetadataSectionSerializer<T> deserializer)
java.lang.String
getName()
java.util.Set<java.lang.String>
getNamespaces(ResourcePackType type)
protected java.io.InputStream
getResource(java.lang.String resourcePath)
java.io.InputStream
getResource(ResourcePackType type, ResourceLocation location)
java.util.Collection<ResourceLocation>
getResources(ResourcePackType type, java.lang.String pathIn, java.lang.String pathIn2, int maxDepth, java.util.function.Predicate<java.lang.String> filter)
java.io.InputStream
getRootResource(java.lang.String fileName)
protected boolean
hasResource(java.lang.String resourcePath)
boolean
hasResource(ResourcePackType type, ResourceLocation location)
-
Methods inherited from class net.minecraft.resources.ResourcePack
getMetadataFromStream, getRelativePath, logWarning
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.minecraftforge.common.extensions.IForgeResourcePack
isHidden
-
-
-
-
Field Detail
-
delegates
private final java.util.List<IResourcePack> delegates
-
namespacesAssets
private final java.util.Map<java.lang.String,java.util.List<IResourcePack>> namespacesAssets
-
namespacesData
private final java.util.Map<java.lang.String,java.util.List<IResourcePack>> namespacesData
-
name
private final java.lang.String name
-
packInfo
private final PackMetadataSection packInfo
-
-
Constructor Detail
-
DelegatingResourcePack
public DelegatingResourcePack(java.lang.String id, java.lang.String name, PackMetadataSection packInfo, java.util.List<? extends IResourcePack> packs)
-
-
Method Detail
-
buildNamespaceMap
private java.util.Map<java.lang.String,java.util.List<IResourcePack>> buildNamespaceMap(ResourcePackType type, java.util.List<IResourcePack> packList)
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceIResourcePack
- Overrides:
getName
in classResourcePack
-
getMetadataSection
public <T> T getMetadataSection(IMetadataSectionSerializer<T> deserializer) throws java.io.IOException
- Specified by:
getMetadataSection
in interfaceIResourcePack
- Overrides:
getMetadataSection
in classResourcePack
- Throws:
java.io.IOException
-
getResources
public java.util.Collection<ResourceLocation> getResources(ResourcePackType type, java.lang.String pathIn, java.lang.String pathIn2, int maxDepth, java.util.function.Predicate<java.lang.String> filter)
-
getNamespaces
public java.util.Set<java.lang.String> getNamespaces(ResourcePackType type)
-
close
public void close()
-
getRootResource
public java.io.InputStream getRootResource(java.lang.String fileName) throws java.io.IOException
- Specified by:
getRootResource
in interfaceIResourcePack
- Overrides:
getRootResource
in classResourcePack
- Throws:
java.io.IOException
-
getResource
protected java.io.InputStream getResource(java.lang.String resourcePath) throws java.io.IOException
- Specified by:
getResource
in classResourcePack
- Throws:
java.io.IOException
-
hasResource
protected boolean hasResource(java.lang.String resourcePath)
- Specified by:
hasResource
in classResourcePack
-
getResource
public java.io.InputStream getResource(ResourcePackType type, ResourceLocation location) throws java.io.IOException
- Specified by:
getResource
in interfaceIResourcePack
- Overrides:
getResource
in classResourcePack
- Throws:
java.io.IOException
-
hasResource
public boolean hasResource(ResourcePackType type, ResourceLocation location)
- Specified by:
hasResource
in interfaceIResourcePack
- Overrides:
hasResource
in classResourcePack
-
getCandidatePacks
private java.util.List<IResourcePack> getCandidatePacks(ResourcePackType type, ResourceLocation location)
-
getFullPath
private static java.lang.String getFullPath(ResourcePackType type, ResourceLocation location)
-
-