Enum minecraft_assets::schemas::blockstates::BlockStates [−][src]
pub enum BlockStates {
Variants {
variants: HashMap<String, Variant>,
},
Multipart {
cases: Vec<Case>,
},
}
Expand description
Block states as stored in the assets/<namespace>/blockstates
directory.
There are several different variants of some blocks (like doors, which can be open or closed), hence each block has its own block state file, which lists all its existing variants and links them to their corresponding models.
Blocks can also be compound of several different models at the same time, called “multipart”. The models are then used depending on the block states of the block.
See also the corresponding section of the wiki page.
Variants
Variants
One way of representing the different states of a block.
This uses a map from variant name to block variant. The variant name
consists of the relevant block states separated by commas, for example,
"face=wall,facing=east,powered=false"
.
A block with just one variant uses ""
as the name for its variant.
Multipart
Another way of representing the different states of a block.
This uses a list of “cases” that specify when a particular model should apply.
Implementations
Consumes self
and returns a new BlockStates::Multipart
where all
of the Variants
have been converted to an equivalent Case
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 BlockStates
impl Send for BlockStates
impl Sync for BlockStates
impl Unpin for BlockStates
impl UnwindSafe for BlockStates
Blanket Implementations
Mutably borrows from an owned value. Read more