package net.minecraft.server.packs; import java.io.IOException; import java.io.InputStream; import java.util.Optional; import java.util.Set; import java.util.function.BiConsumer; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.packs.metadata.MetadataSectionType; import net.minecraft.server.packs.repository.KnownPack; import net.minecraft.server.packs.resources.IoSupplier; import org.jetbrains.annotations.Nullable; public interface PackResources extends AutoCloseable { String METADATA_EXTENSION = ".mcmeta"; String PACK_META = "pack.mcmeta"; @Nullable IoSupplier getRootResource(String... elements); @Nullable IoSupplier getResource(PackType packType, ResourceLocation location); void listResources(PackType packType, String namespace, String path, PackResources.ResourceOutput resourceOutput); Set getNamespaces(PackType type); @Nullable T getMetadataSection(MetadataSectionType type) throws IOException; PackLocationInfo location(); default String packId() { return this.location().id(); } default Optional knownPackInfo() { return this.location().knownPackInfo(); } void close(); @FunctionalInterface public interface ResourceOutput extends BiConsumer> { } }