PackBuilder

A builder for constructing resource pack contents within a specific path context.

This class simplifies adding resources to a pack by managing the current path and providing methods to resolve sub-paths. It also integrates with PackObfuscator for resource name obfuscation.

Since

1.15.2

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun add(@NotNull path: @NotNull String, @NotNull supplier: @NotNull Supplier<Array<Byte>>)
Adds a resource to the pack at the current path with unknown size.
open fun add(@NotNull paths: Array<@NotNull String>, @NotNull supplier: @NotNull Supplier<Array<Byte>>)
Adds a resource to the pack at the current path using multiple path components with unknown size.
open fun add(@NotNull path: @NotNull String, estimatedSize: Long, @NotNull supplier: @NotNull Supplier<Array<Byte>>)
Adds a resource to the pack at the current path.
open fun add(@NotNull paths: Array<@NotNull String>, size: Long, @NotNull supplier: @NotNull Supplier<Array<Byte>>)
Adds a resource to the pack at the current path using multiple path components.
Link copied to clipboard
@NotNull
open fun obfuscator(): @NotNull PackObfuscator
Returns the obfuscator associated with this builder.
Link copied to clipboard
@NotNull
open fun resolve(@NotNull paths: Array<@NotNull String>): @NotNull PackBuilder
Resolves a sub-path and returns a new builder for that path.