Package net.minecraft.resources
Class VanillaPack
- java.lang.Object
-
- net.minecraft.resources.VanillaPack
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,IResourcePack
,IForgeResourcePack
- Direct Known Subclasses:
VirtualAssetsPack
public class VanillaPack extends java.lang.Object implements IResourcePack
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Class<?>
clientObject
static java.nio.file.Path
generatedDir
private static java.util.Map<ResourcePackType,java.nio.file.FileSystem>
JAR_FILESYSTEM_BY_TYPE
private static org.apache.logging.log4j.Logger
LOGGER
java.util.Set<java.lang.String>
namespaces
-
Constructor Summary
Constructors Constructor Description VanillaPack(java.lang.String... p_i47912_1_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
private static java.lang.String
createPath(ResourcePackType p_223458_0_, ResourceLocation p_223458_1_)
private java.io.InputStream
getExtraInputStream(ResourcePackType type, java.lang.String resource)
<T> T
getMetadataSection(IMetadataSectionSerializer<T> p_195760_1_)
java.lang.String
getName()
java.util.Set<java.lang.String>
getNamespaces(ResourcePackType p_195759_1_)
java.io.InputStream
getResource(ResourcePackType p_195761_1_, ResourceLocation p_195761_2_)
protected java.io.InputStream
getResourceAsStream(java.lang.String p_200010_1_)
protected java.io.InputStream
getResourceAsStream(ResourcePackType p_195782_1_, ResourceLocation p_195782_2_)
private static void
getResources(java.util.Collection<ResourceLocation> p_229867_0_, int p_229867_1_, java.lang.String p_229867_2_, java.nio.file.Path p_229867_3_, java.lang.String p_229867_4_, java.util.function.Predicate<java.lang.String> p_229867_5_)
java.util.Collection<ResourceLocation>
getResources(ResourcePackType p_225637_1_, java.lang.String p_225637_2_, java.lang.String p_225637_3_, int p_225637_4_, java.util.function.Predicate<java.lang.String> p_225637_5_)
java.io.InputStream
getRootResource(java.lang.String p_195763_1_)
boolean
hasResource(ResourcePackType p_195764_1_, ResourceLocation p_195764_2_)
private static boolean
isResourceUrlValid(java.lang.String p_223459_0_, java.net.URL p_223459_1_)
-
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
-
generatedDir
public static java.nio.file.Path generatedDir
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
clientObject
public static java.lang.Class<?> clientObject
-
JAR_FILESYSTEM_BY_TYPE
private static final java.util.Map<ResourcePackType,java.nio.file.FileSystem> JAR_FILESYSTEM_BY_TYPE
-
namespaces
public final java.util.Set<java.lang.String> namespaces
-
-
Method Detail
-
getRootResource
public java.io.InputStream getRootResource(java.lang.String p_195763_1_) throws java.io.IOException
- Specified by:
getRootResource
in interfaceIResourcePack
- Throws:
java.io.IOException
-
getResource
public java.io.InputStream getResource(ResourcePackType p_195761_1_, ResourceLocation p_195761_2_) throws java.io.IOException
- Specified by:
getResource
in interfaceIResourcePack
- Throws:
java.io.IOException
-
getResources
public java.util.Collection<ResourceLocation> getResources(ResourcePackType p_225637_1_, java.lang.String p_225637_2_, java.lang.String p_225637_3_, int p_225637_4_, java.util.function.Predicate<java.lang.String> p_225637_5_)
- Specified by:
getResources
in interfaceIResourcePack
-
getResources
private static void getResources(java.util.Collection<ResourceLocation> p_229867_0_, int p_229867_1_, java.lang.String p_229867_2_, java.nio.file.Path p_229867_3_, java.lang.String p_229867_4_, java.util.function.Predicate<java.lang.String> p_229867_5_) throws java.io.IOException
- Throws:
java.io.IOException
-
getResourceAsStream
@Nullable protected java.io.InputStream getResourceAsStream(ResourcePackType p_195782_1_, ResourceLocation p_195782_2_)
-
createPath
private static java.lang.String createPath(ResourcePackType p_223458_0_, ResourceLocation p_223458_1_)
-
isResourceUrlValid
private static boolean isResourceUrlValid(java.lang.String p_223459_0_, @Nullable java.net.URL p_223459_1_) throws java.io.IOException
- Throws:
java.io.IOException
-
getResourceAsStream
@Nullable protected java.io.InputStream getResourceAsStream(java.lang.String p_200010_1_)
-
hasResource
public boolean hasResource(ResourcePackType p_195764_1_, ResourceLocation p_195764_2_)
- Specified by:
hasResource
in interfaceIResourcePack
-
getNamespaces
public java.util.Set<java.lang.String> getNamespaces(ResourcePackType p_195759_1_)
- Specified by:
getNamespaces
in interfaceIResourcePack
-
getMetadataSection
@Nullable public <T> T getMetadataSection(IMetadataSectionSerializer<T> p_195760_1_) throws java.io.IOException
- Specified by:
getMetadataSection
in interfaceIResourcePack
- Throws:
java.io.IOException
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceIResourcePack
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceIResourcePack
-
getExtraInputStream
private java.io.InputStream getExtraInputStream(ResourcePackType type, java.lang.String resource)
-
-