of

@NotNull
open fun of(@NotNull name: @NotNull String, bytes: Array<Byte>): @NotNull ModelAsset

Creates a new ModelAsset from a name and byte array using the default bbmodel extension.

Return

the created asset

Since

2.0.0

Parameters

name

the name of the asset

bytes

the byte array containing the model data


@NotNull
open fun of(@NotNull name: @NotNull String, @NotNull supplier: @NotNull ModelAsset.StreamSupplier): @NotNull ModelAsset

Creates a new ModelAsset from a name and stream supplier using the default bbmodel extension.

Return

the created asset

Since

2.0.0

Parameters

name

the name of the asset

supplier

the stream supplier


@NotNull
open fun of(@NotNull name: @NotNull String, sizeAssume: Long, @NotNull supplier: @NotNull ModelAsset.StreamSupplier): @NotNull ModelAsset

Creates a new ModelAsset from a name, stream supplier, and estimated size using the default bbmodel extension.

Return

the created asset

Since

2.0.0

Parameters

name

the name of the asset

sizeAssume

the estimated size in bytes

supplier

the stream supplier


@NotNull
open fun of(@NotNull name: @NotNull String, @NotNull extension: @NotNull String, bytes: Array<Byte>): @NotNull ModelAsset

Creates an asset from bytes with an explicit extension.

Example: ModelAsset.of("model", "custom", bytes).

Return

the created asset

Since

3.7.0

Parameters

name

the pack-compliant model name

extension

the extension without a leading dot

bytes

the model data

Throws

if the name is not pack-compliant


@NotNull
open fun of(@NotNull name: @NotNull String, @NotNull extension: @NotNull String, @NotNull supplier: @NotNull ModelAsset.StreamSupplier): @NotNull ModelAsset

Creates an asset from a stream supplier with an explicit extension.

Example: ModelAsset.of("model", "custom", supplier).

Return

the created asset

Since

3.7.0

Parameters

name

the pack-compliant model name

extension

the extension without a leading dot

supplier

the stream supplier

Throws

if the name is not pack-compliant


@NotNull
open fun of(@NotNull name: @NotNull String, @NotNull extension: @NotNull String, sizeAssume: Long, @NotNull supplier: @NotNull ModelAsset.StreamSupplier): @NotNull ModelAsset

Creates an asset with an explicit extension and estimated size.

Example: ModelAsset.of("model", "custom", size, supplier).

Return

the created asset

Since

3.7.0

Parameters

name

the pack-compliant model name

extension

the extension without a leading dot

sizeAssume

the estimated size in bytes

supplier

the stream supplier

Throws

if the name is not pack-compliant


@NotNull
open fun of(@NotNull file: @NotNull File): @NotNull ModelAsset

Creates a new ModelAsset from a file, inferring its extension or using bbmodel when absent.

Return

the created asset

Since

2.0.0

Parameters

file

the source file


@NotNull
open fun of(@NotNull path: @NotNull Path): @NotNull ModelAsset

Creates a new ModelAsset from a path, inferring its extension or using bbmodel when absent.

Return

the created asset

Since

2.0.0

Parameters

path

the source path

Throws

if an I/O error occurs