ResourcePackBuilder

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
lateinit var assetPacks: List<AssetPack>
Link copied to clipboard

Functions

Link copied to clipboard
fun findOrNull(path: ResourcePath<*>): Path?

Searches for a file under path in both the resource pack and vanilla minecraft assets, returning the Path if it exists or null if it doesn't.

Link copied to clipboard

Searches for a file under path in both the resource pack and vanilla minecraft assets, returning the Path if it exists or throwing an IllegalArgumentException if it doesn't.

Link copied to clipboard
inline fun <T : PackTaskHolder> getHolder(): T

Retrieves the instantiated PackTaskHolder of the specified type.

Link copied to clipboard

Creates a Lazy that retrieves an instantiated PackTaskHolder of the specified type.

Link copied to clipboard

Gets the resource filters for the specified ResourceFilter.Stage.

Link copied to clipboard
inline fun <V> readJson(path: ResourcePath<ResourceType.JsonFile>, json: Json = Json): V?

Deserializes the JSON content of the file under path in the resource pack to V using json, or returns null if the file does not exist.

Link copied to clipboard
fun resolve(path: String): Path
fun resolve(path: ResourcePath<*>): Path

Resolves the file under path in the resource pack.

Link copied to clipboard

Resolves the corresponding .mcmeta file for the specified path.

Link copied to clipboard

Resolves the file under path in the vanilla minecraft assets.

Link copied to clipboard

Resolves the corresponding .mcmeta file for the specified path in the vanilla minecraft assets.

Link copied to clipboard

Writes the image to the file under path, creating parent directories if necessary.

Link copied to clipboard
inline fun <V> writeJson(path: ResourcePath<ResourceType.JsonFile>, value: V, json: Json = Json)

Serializes value to JSON using json and writes it to the file under path, creating parent directories if necessary.

Link copied to clipboard
inline fun <V> writeMeta(path: ResourcePath<ResourceType.HasMcMeta>, value: V, json: Json = Json)

Serializes value to JSON using json and writes it to the corresponding .mcmeta file for the specified path, creating parent directories if necessary.