Struct minecraft_assets::schemas::blockstates::ModelProperties[][src]

pub struct ModelProperties {
    pub model: String,
    pub x: i32,
    pub y: i32,
    pub uv_lock: bool,
    pub weight: u32,
}
Expand description

Contains the properties of a model that is used to render all or part of a block in a particular state.

Fields

model: String

Specifies the path to the model file of the block, in the form of a resource location.

Version note

In version 1.13 and beyond, this path includes a prefix such as block/ or item/ to disambiguate between different model types. Versions prior to 1.13 do not include this.

See the ModelIdentifier documentation for more information.

x: i32

Rotation of the model on the x-axis in increments of 90 degrees.

y: i32

Rotation of the model on the y-axis in increments of 90 degrees.

uv_lock: bool

Can be true or false (default). Locks the rotation of the texture of a block, if set to true. This way the texture does not rotate with the block when using the x and y fields above.

See the example on the wiki page.

weight: u32

Sets the probability of the model for being used in the game.

The weight defaults to 1 (=100%). If more than one model is used for the same variant, the probability is calculated by dividing the individual model’s weight by the sum of the weights of all models. (For example, if three models are used with weights 1, 1, and 2, then their combined weight would be 4 (1+1+2). The probability of each model being used would then be determined by dividing each weight by 4: 1/4, 1/4 and 2/4, or 25%, 25% and 50%, respectively.)

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.