Class JarContentsPackResources
java.lang.Object
net.minecraft.server.packs.AbstractPackResources
net.neoforged.neoforge.resource.JarContentsPackResources
- All Implemented Interfaces:
AutoCloseable, PackResources, IPackResourcesExtension
Exposes the content of an arbitrary
JarContents as data/resource pack resources.
In general, you should use the factory ResourcePackLoader.createPackForJarContents(JarContents) instead,
since it will try to create a more optimal implementation based on the actual underlying Jar storage.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classNested classes/interfaces inherited from interface PackResources
PackResources.ResourceOutput -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final JarContents(package private) static final org.slf4j.Loggerprivate final StringFields inherited from interface PackResources
METADATA_EXTENSION, PACK_META -
Constructor Summary
ConstructorsConstructorDescriptionJarContentsPackResources(PackLocationInfo locationInfo, JarContents contents, String prefix) -
Method Summary
Modifier and TypeMethodDescriptionprivate Stringvoidclose()getNamespaces(PackType packType) private static StringgetPathFromLocation(PackType packType, Identifier location) private @Nullable IoSupplier<InputStream> getResource(String relativePath) getResource(PackType packType, Identifier location) @Nullable IoSupplier<InputStream> getRootResource(String... pathSegments) voidlistResources(PackType packType, String namespace, String prefix, PackResources.ResourceOutput output) Methods inherited from class AbstractPackResources
getMetadataSection, loadMetadata, location, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface IPackResourcesExtension
isHiddenMethods inherited from interface PackResources
knownPackInfo, packId
-
Field Details
-
LOGGER
static final org.slf4j.Logger LOGGER -
contents
-
prefix
-
-
Constructor Details
-
JarContentsPackResources
-
-
Method Details
-
getPathFromLocation
-
getRootResource
-
getResource
-
addPrefix
-
getResource
-
getNamespaces
-
close
public void close() -
listResources
public void listResources(PackType packType, String namespace, String prefix, PackResources.ResourceOutput output)
-