pub struct CustomItemDefinition {
pub id: String,
pub display_name: String,
pub texture_data: Vec<u8>,
pub category: i32,
pub group: Option<String>,
pub meta: i32,
}Expand description
CustomItemDefinition defines a custom (non-vanilla) item that requires a resource pack and client-side registration
Fields§
§id: StringUnique identifier for the custom item (e.g., “my_plugin:custom_sword”)
display_name: StringDisplay name shown to players
texture_data: Vec<u8>Texture data encoded as PNG bytes
category: i32Creative inventory category
group: Option<String>Optional subgroup within the category (e.g., “sword”, “pickaxe”, “food”)
meta: i32Metadata value for this item (defaults to 0)
Implementations§
Source§impl CustomItemDefinition
impl CustomItemDefinition
Sourcepub fn category(&self) -> ItemCategory
pub fn category(&self) -> ItemCategory
Returns the enum value of category, or the default if the field is set to an invalid enum value.
Sourcepub fn set_category(&mut self, value: ItemCategory)
pub fn set_category(&mut self, value: ItemCategory)
Sets category to the provided enum value.
Trait Implementations§
Source§impl Clone for CustomItemDefinition
impl Clone for CustomItemDefinition
Source§fn clone(&self) -> CustomItemDefinition
fn clone(&self) -> CustomItemDefinition
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 CustomItemDefinition
impl Debug for CustomItemDefinition
Source§impl Default for CustomItemDefinition
impl Default for CustomItemDefinition
Source§impl Message for CustomItemDefinition
impl Message for CustomItemDefinition
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.Source§impl PartialEq for CustomItemDefinition
impl PartialEq for CustomItemDefinition
impl StructuralPartialEq for CustomItemDefinition
Auto Trait Implementations§
impl Freeze for CustomItemDefinition
impl RefUnwindSafe for CustomItemDefinition
impl Send for CustomItemDefinition
impl Sync for CustomItemDefinition
impl Unpin for CustomItemDefinition
impl UnwindSafe for CustomItemDefinition
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request