pub struct BlockModel {
pub parent: Option<String>,
pub ambient_occlusion: bool,
pub textures: HashMap<String, String>,
pub elements: Vec<ModelElement>,
pub display: Option<Value>,
}Expand description
A parsed block model from models/*.json.
Fields§
§parent: Option<String>Parent model to inherit from.
ambient_occlusion: boolWhether to use ambient occlusion.
textures: HashMap<String, String>Texture variable definitions.
elements: Vec<ModelElement>Model elements (cuboids).
display: Option<Value>Display transforms (for item rendering, not used for block meshing).
Implementations§
Source§impl BlockModel
impl BlockModel
Sourcepub fn parent_location(&self) -> Option<String>
pub fn parent_location(&self) -> Option<String>
Get the full parent resource location.
Sourcepub fn has_elements(&self) -> bool
pub fn has_elements(&self) -> bool
Check if this model has its own elements (not inherited).
Sourcepub fn resolve_texture<'a>(&'a self, reference: &'a str) -> Option<&'a str>
pub fn resolve_texture<'a>(&'a self, reference: &'a str) -> Option<&'a str>
Resolve a texture reference (e.g., “#side”) to a texture path. Returns None if the reference cannot be resolved.
Trait Implementations§
Source§impl Clone for BlockModel
impl Clone for BlockModel
Source§fn clone(&self) -> BlockModel
fn clone(&self) -> BlockModel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BlockModel
impl Debug for BlockModel
Source§impl Default for BlockModel
impl Default for BlockModel
Source§fn default() -> BlockModel
fn default() -> BlockModel
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BlockModel
impl<'de> Deserialize<'de> for BlockModel
Source§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
Auto Trait Implementations§
impl Freeze for BlockModel
impl RefUnwindSafe for BlockModel
impl Send for BlockModel
impl Sync for BlockModel
impl Unpin for BlockModel
impl UnwindSafe for BlockModel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more