java.lang.Object
com.portingdeadmods.portingdeadlibs.api.resources.DynamicPack
All Implemented Interfaces:
AutoCloseable, net.minecraft.server.packs.PackResources, net.neoforged.neoforge.common.extensions.IPackResourcesExtension

public class DynamicPack extends Object implements net.minecraft.server.packs.PackResources
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minecraft.server.packs.PackResources

    net.minecraft.server.packs.PackResources.ResourceOutput
  • Field Summary

    Fields inherited from interface net.minecraft.server.packs.PackResources

    METADATA_EXTENSION, PACK_META
  • Constructor Summary

    Constructors
    Constructor
    Description
    DynamicPack(net.minecraft.resources.ResourceLocation packId, net.minecraft.server.packs.PackType packType)
     
    DynamicPack(net.minecraft.resources.ResourceLocation packId, net.minecraft.server.packs.PackType packType, net.minecraft.server.packs.repository.PackSource source)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    <T> T
    getMetadataSection(@NotNull net.minecraft.server.packs.metadata.MetadataSectionSerializer<T> deserializer)
     
    @NotNull Set<String>
    getNamespaces(net.minecraft.server.packs.PackType packType)
     
    @Nullable net.minecraft.server.packs.resources.IoSupplier<InputStream>
    getResource(@NotNull net.minecraft.server.packs.PackType packType, @NotNull net.minecraft.resources.ResourceLocation resourceLocation)
     
    @Nullable net.minecraft.server.packs.resources.IoSupplier<InputStream>
    getRootResource(String @NotNull ... elements)
     
    void
    listResources(@NotNull net.minecraft.server.packs.PackType packType, @NotNull String namespace, @NotNull String path, @NotNull net.minecraft.server.packs.PackResources.ResourceOutput resourceOutput)
     
    @NotNull net.minecraft.server.packs.PackLocationInfo
     
    @NotNull String
     
    put(net.minecraft.resources.ResourceLocation location, byte[] bytes)
     
    put(net.minecraft.resources.ResourceLocation location, com.google.gson.JsonElement json)
     
    put(net.minecraft.resources.ResourceLocation location, String string)
     
    put(net.minecraft.resources.ResourceLocation location, net.minecraft.server.packs.resources.IoSupplier<InputStream> stream)
     
    net.minecraft.server.packs.repository.RepositorySource
    toSource(net.minecraft.server.packs.repository.Pack.Position position)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.neoforged.neoforge.common.extensions.IPackResourcesExtension

    isHidden

    Methods inherited from interface net.minecraft.server.packs.PackResources

    knownPackInfo
  • Constructor Details

    • DynamicPack

      public DynamicPack(net.minecraft.resources.ResourceLocation packId, net.minecraft.server.packs.PackType packType)
    • DynamicPack

      public DynamicPack(net.minecraft.resources.ResourceLocation packId, net.minecraft.server.packs.PackType packType, net.minecraft.server.packs.repository.PackSource source)
  • Method Details

    • put

      public DynamicPack put(net.minecraft.resources.ResourceLocation location, net.minecraft.server.packs.resources.IoSupplier<InputStream> stream)
    • put

      public DynamicPack put(net.minecraft.resources.ResourceLocation location, byte[] bytes)
    • put

      public DynamicPack put(net.minecraft.resources.ResourceLocation location, String string)
    • put

      public DynamicPack put(net.minecraft.resources.ResourceLocation location, com.google.gson.JsonElement json)
    • getRootResource

      @Nullable public @Nullable net.minecraft.server.packs.resources.IoSupplier<InputStream> getRootResource(String @NotNull ... elements)
      Specified by:
      getRootResource in interface net.minecraft.server.packs.PackResources
    • getResource

      @Nullable public @Nullable net.minecraft.server.packs.resources.IoSupplier<InputStream> getResource(@NotNull @NotNull net.minecraft.server.packs.PackType packType, @NotNull @NotNull net.minecraft.resources.ResourceLocation resourceLocation)
      Specified by:
      getResource in interface net.minecraft.server.packs.PackResources
    • listResources

      public void listResources(@NotNull @NotNull net.minecraft.server.packs.PackType packType, @NotNull @NotNull String namespace, @NotNull @NotNull String path, @NotNull @NotNull net.minecraft.server.packs.PackResources.ResourceOutput resourceOutput)
      Specified by:
      listResources in interface net.minecraft.server.packs.PackResources
    • getNamespaces

      @NotNull public @NotNull Set<String> getNamespaces(net.minecraft.server.packs.PackType packType)
      Specified by:
      getNamespaces in interface net.minecraft.server.packs.PackResources
    • getMetadataSection

      @Nullable public <T> T getMetadataSection(@NotNull @NotNull net.minecraft.server.packs.metadata.MetadataSectionSerializer<T> deserializer) throws IOException
      Specified by:
      getMetadataSection in interface net.minecraft.server.packs.PackResources
      Throws:
      IOException
    • location

      @NotNull public @NotNull net.minecraft.server.packs.PackLocationInfo location()
      Specified by:
      location in interface net.minecraft.server.packs.PackResources
    • packId

      @NotNull public @NotNull String packId()
      Specified by:
      packId in interface net.minecraft.server.packs.PackResources
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface net.minecraft.server.packs.PackResources
    • toSource

      public net.minecraft.server.packs.repository.RepositorySource toSource(net.minecraft.server.packs.repository.Pack.Position position)