Class JarPluginResourcePack

java.lang.Object
cn.nukkit.resourcepacks.AbstractResourcePack
cn.nukkit.resourcepacks.JarPluginResourcePack
All Implemented Interfaces:
ResourcePack

@PowerNukkitXOnly @Since("1.19.62-r1") public class JarPluginResourcePack extends AbstractResourcePack
此类描述了放在jar插件文件内assets/resource_pack目录的资源包相关文件
  • Field Details

    • RESOURCE_PACK_PATH

      public static final String RESOURCE_PACK_PATH
      See Also:
    • jarPluginFile

      protected File jarPluginFile
    • zippedByteBuffer

      protected ByteBuffer zippedByteBuffer
    • sha256

      protected byte[] sha256
    • encryptionKey

      protected String encryptionKey
  • Constructor Details

    • JarPluginResourcePack

      public JarPluginResourcePack(File jarPluginFile)
  • Method Details

    • hasResourcePack

      public static boolean hasResourcePack(File jarPluginFile)
    • findManifestInJar

      @Nullable protected static ZipEntry findManifestInJar(ZipFile jar)
    • getPackSize

      public int getPackSize()
      Returns:
      此资源包的文件大小
    • getSha256

      public byte[] getSha256()
      Returns:
      资源包文件的SHA-256值
    • getEncryptionKey

      public String getEncryptionKey()
      Returns:
      资源包密钥(若加密)
    • getPackChunk

      public byte[] getPackChunk(int off, int len)
      Parameters:
      off - 偏移值
      len - 长度
      Returns:
      资源包文件的指定分块