pub struct ArmorMaterial {
pub id: String,
pub durability: u32,
pub defense: ArmorDefense,
pub enchantability: u32,
pub equip_sound: String,
pub toughness: f32,
pub knockback_resistance: f32,
pub repair: String,
pub texture: String,
}Expand description
What armor is made of. The game’s are built in
(ArmorMaterial::built_ins); a mod declares its own in a .ydef
(kind: "armor_material") or registers one.
Fields§
§id: String§durability: u32Multiplies each piece’s base durability (helmet 11, chestplate 16, leggings 15, boots 13).
defense: ArmorDefense§enchantability: u32§equip_sound: StringThe sound event of putting it on.
toughness: f32§knockback_resistance: f32§repair: StringWhat repairs it: an item id or #tag.
texture: StringIts look on a player: <ns>:<name> is
<ns>:textures/models/armor/<name>_layer_1.png (and _layer_2).
Implementations§
Source§impl ArmorMaterial
impl ArmorMaterial
Sourcepub fn built_ins() -> &'static [ArmorMaterial]
pub fn built_ins() -> &'static [ArmorMaterial]
The game’s materials: leather, chainmail, iron, gold, diamond, turtle, netherite.
Sourcepub fn built_in(name: &str) -> Option<&'static ArmorMaterial>
pub fn built_in(name: &str) -> Option<&'static ArmorMaterial>
One of the game’s, by short name or id.
Trait Implementations§
Source§impl Clone for ArmorMaterial
impl Clone for ArmorMaterial
Source§fn clone(&self) -> ArmorMaterial
fn clone(&self) -> ArmorMaterial
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ArmorMaterial
impl Debug for ArmorMaterial
Source§impl<'de> Deserialize<'de> for ArmorMaterial
impl<'de> Deserialize<'de> for ArmorMaterial
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ArmorMaterial, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ArmorMaterial, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ArmorMaterial
impl PartialEq for ArmorMaterial
Source§impl Schema for ArmorMaterial
impl Schema for ArmorMaterial
Source§impl Serialize for ArmorMaterial
impl Serialize for ArmorMaterial
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ArmorMaterial
Auto Trait Implementations§
impl Freeze for ArmorMaterial
impl RefUnwindSafe for ArmorMaterial
impl Send for ArmorMaterial
impl Sync for ArmorMaterial
impl Unpin for ArmorMaterial
impl UnsafeUnpin for ArmorMaterial
impl UnwindSafe for ArmorMaterial
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.