Package net.neoforged.neoforge.resource
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 net.minecraft.server.packs.PackResources
PackResources.ResourceOutput -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final JarContents(package private) static final org.slf4j.Loggerprivate final StringFields inherited from interface net.minecraft.server.packs.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, ResourceLocation location) private @Nullable IoSupplier<InputStream> getResource(String relativePath) getResource(PackType packType, ResourceLocation location) @Nullable IoSupplier<InputStream> getRootResource(String... pathSegments) voidlistResources(PackType packType, String namespace, String prefix, PackResources.ResourceOutput output) Methods inherited from class net.minecraft.server.packs.AbstractPackResources
getMetadataFromStream, getMetadataSection, location, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.common.extensions.IPackResourcesExtension
isHiddenMethods inherited from interface net.minecraft.server.packs.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)
-