Package cn.nukkit.resourcepacks
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 Summary
Modifier and TypeFieldDescriptionprotected String
protected File
static final String
protected byte[]
protected ByteBuffer
Fields inherited from class cn.nukkit.resourcepacks.AbstractResourcePack
id, manifest
Fields inherited from interface cn.nukkit.resourcepacks.ResourcePack
EMPTY_ARRAY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static ZipEntry
findManifestInJar
(ZipFile jar) byte[]
getPackChunk
(int off, int len) int
byte[]
static boolean
hasResourcePack
(File jarPluginFile) Methods inherited from class cn.nukkit.resourcepacks.AbstractResourcePack
equals, getPackId, getPackName, getPackVersion, hashCode, verifyManifest
-
Field Details
-
RESOURCE_PACK_PATH
- See Also:
-
jarPluginFile
-
zippedByteBuffer
-
sha256
protected byte[] sha256 -
encryptionKey
-
-
Constructor Details
-
JarPluginResourcePack
-
-
Method Details
-
hasResourcePack
-
findManifestInJar
-
getPackSize
public int getPackSize()- Returns:
- 此资源包的文件大小
-
getSha256
public byte[] getSha256()- Returns:
- 资源包文件的SHA-256值
-
getEncryptionKey
- Returns:
- 资源包密钥(若加密)
-
getPackChunk
public byte[] getPackChunk(int off, int len) - Parameters:
off
- 偏移值len
- 长度- Returns:
- 资源包文件的指定分块
-