ModelAsset
Represents a raw model asset that can be loaded into the engine.
This record encapsulates the source of the model data (e.g., a file or stream), its name, and metadata. It provides methods to load and parse the model data into a usable format.
Example: ModelAsset.of("model", "custom", bytes).toResult().
Since
2.0.0
Parameters
rawName
the original raw name or path of the asset
name
the sanitized, pack-compliant name of the asset
extension
the model extension without a leading dot, matched without case sensitivity
sizeAssume
the estimated size of the asset in bytes (0 if unknown)
supplier
a supplier for the input stream containing the model data
Constructors
Link copied to clipboard
@ApiStatus.Internal
Internal constructor for ModelAsset.
@ApiStatus.Internal
Creates an asset using the default
bbmodel extension.Types
Link copied to clipboard
interface StreamSupplier
A functional interface for supplying an input stream.
Companion functions
Link copied to clipboard
Creates a new ModelAsset from a file, inferring its extension or using
bbmodel when absent.Creates a new ModelAsset from a path, inferring its extension or using
bbmodel when absent.Creates a new ModelAsset from a name and byte array using the default
bbmodel extension.@NotNull
Creates a new ModelAsset from a name and stream supplier using the default
bbmodel extension.@NotNull
Creates an asset from bytes with an explicit extension.
@NotNull
Creates an asset from a stream supplier with an explicit extension.
@NotNull
Creates a new ModelAsset from a name, stream supplier, and estimated size using the default
bbmodel extension.@NotNull
Creates an asset with an explicit extension and estimated size.