Package org.geysermc.geyser.api.pack
Class PackCodec
java.lang.Object
org.geysermc.geyser.api.pack.PackCodec
- Direct Known Subclasses:
PathPackCodec,UrlPackCodec
Represents a pack codec that can be used
to provide resource packs to clients.
- Since:
- 2.1.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract @NonNull ResourcePackcreate()Creates a new resource pack from this codec.protected abstract @NonNull ResourcePack.BuilderCreates a new resource pack builder from this codec.static @NonNull PackCodecCreates a new pack provider from the given path.abstract @NonNull SeekableByteChannelSerializes the given codec into a byte buffer.@NonNull SeekableByteChannelserialize(@NonNull ResourcePack resourcePack) Deprecated.abstract byte @NonNull []sha256()Gets the sha256 hash of the resource pack.abstract longsize()Gets the resource pack size.static @NonNull PackCodecCreates a new pack provider from the given url.
-
Constructor Details
-
PackCodec
public PackCodec()
-
-
Method Details
-
sha256
public abstract byte @NonNull [] sha256()Gets the sha256 hash of the resource pack.- Returns:
- the hash of the resource pack
- Since:
- 2.1.1
-
size
public abstract long size()Gets the resource pack size.- Returns:
- the resource pack file size
- Since:
- 2.1.1
-
serialize
@Deprecated public @NonNull SeekableByteChannel serialize(@NonNull ResourcePack resourcePack) throws IOException Deprecated.useserialize()instead.- Throws:
IOException
-
serialize
Serializes the given codec into a byte buffer.- Returns:
- the serialized resource pack
- Throws:
IOException- Since:
- 2.6.2
-
create
Creates a new resource pack from this codec.- Returns:
- the new resource pack
- Since:
- 2.1.1
-
createBuilder
Creates a new resource pack builder from this codec.- Returns:
- the new resource pack builder
- Since:
- 2.6.2
-
path
Creates a new pack provider from the given path.- Parameters:
path- the path to create the pack provider from- Returns:
- the new pack provider
- Since:
- 2.1.1
-
url
Creates a new pack provider from the given url.- Parameters:
url- the url to create the pack provider from- Returns:
- the new pack provider
- Since:
- 2.6.2
-
serialize()instead.