Class JarContentsPackResources
java.lang.Object
net.minecraft.server.packs.AbstractPackMetadataResources
net.neoforged.neoforge.resource.JarContentsPackResources
- All Implemented Interfaces:
AutoCloseable, PackMetadataResources, PackResources, PackMetadataResourcesExtension
@Internal
public class JarContentsPackResources
extends AbstractPackMetadataResources
implements PackResources
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.Filter, 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) getRootResource(String... pathSegments) voidlistResources(PackType packType, String namespace, String prefix, PackResources.ResourceOutput output) Methods inherited from class AbstractPackMetadataResources
getMetadataSection, loadMetadata, location, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface PackMetadataResources
getMetadataSection, locationMethods inherited from interface PackMetadataResourcesExtension
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
- Specified by:
getRootResourcein interfacePackMetadataResources
-
getResource
- Specified by:
getResourcein interfacePackResources
-
addPrefix
-
getResource
-
getNamespaces
- Specified by:
getNamespacesin interfacePackResources
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfacePackMetadataResources
-
listResources
public void listResources(PackType packType, String namespace, String prefix, PackResources.ResourceOutput output) - Specified by:
listResourcesin interfacePackResources
-