Class PackBuilder
java.lang.Object
kr.toxicity.model.api.pack.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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a resource to the pack at the current path using multiple path components.voidAdds a resource to the pack at the current path using multiple path components with unknown size.voidAdds a resource to the pack at the current path.voidAdds a resource to the pack at the current path with unknown size.@NotNull PackObfuscatorReturns the obfuscator associated with this builder.@NotNull PackBuilderResolves a sub-path and returns a new builder for that path.
-
Constructor Details
-
PackBuilder
public PackBuilder()
-
-
Method Details
-
resolve
Resolves a sub-path and returns a new builder for that path.- Parameters:
paths- the sub-path components- Returns:
- a new PackBuilder for the resolved path
- Since:
- 1.15.2
-
add
public void add(@NotNull @NotNull String path, long estimatedSize, @NotNull @NotNull Supplier<byte[]> supplier) Adds a resource to the pack at the current path.- Parameters:
path- the relative path of the resourceestimatedSize- the estimated size of the resourcesupplier- the supplier for the resource content- Since:
- 1.15.2
-
add
public void add(@NotNull @NotNull String[] paths, long size, @NotNull @NotNull Supplier<byte[]> supplier) Adds a resource to the pack at the current path using multiple path components.- Parameters:
paths- the relative path componentssize- the estimated size of the resourcesupplier- the supplier for the resource content- Since:
- 1.15.2
-
obfuscator
Returns the obfuscator associated with this builder.- Returns:
- the obfuscator
- Since:
- 1.15.2
-
add
-
add
Adds a resource to the pack at the current path using multiple path components with unknown size.- Parameters:
paths- the relative path componentssupplier- the supplier for the resource content- Since:
- 1.15.2
-