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
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
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 !=
.
Auto Trait Implementations
impl RefUnwindSafe for ModelProperties
impl Send for ModelProperties
impl Sync for ModelProperties
impl Unpin for ModelProperties
impl UnwindSafe for ModelProperties
Blanket Implementations
Mutably borrows from an owned value. Read more