Struct ModBlockEntity
pub struct ModBlockEntity { /* private fields */ }Expand description
A mod’s block entity, read and changed through its fields
(ModBlockEntityFields) as a struct’s: entity.nbt. Each change goes
through DerefMut and gives it a new revision, so a client tells
whether what it kept of it (BlockEntityDraw::keep) is still right
without comparing the whole entity, and no write can skip that. Its type
identity is fixed at construction and is not part of the mutable fields.
Returned guest snapshots apply only changed mutable fields through the same revision path.
Implementations§
§impl ModBlockEntity
impl ModBlockEntity
pub fn new(id: String, fields: ModBlockEntityFields) -> ModBlockEntity
pub fn revision(&self) -> ModRevision
pub fn merge_update_tag(&mut self, tag: &BTreeMap<JavaString, Tag>)
pub fn merge_update_tag(&mut self, tag: &BTreeMap<JavaString, Tag>)
A client’s copy loads the tag the server sent (loadWithComponents
in ClientPacketListener.handleBlockEntityData): tag’s fields
replace its own of the same names. One it already has as sent is
left alone, so a tag sent again unchanged keeps its revision.
Trait Implementations§
§impl Clone for ModBlockEntity
impl Clone for ModBlockEntity
§fn clone(&self) -> ModBlockEntity
fn clone(&self) -> ModBlockEntity
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 more§impl Debug for ModBlockEntity
impl Debug for ModBlockEntity
§impl Default for ModBlockEntity
impl Default for ModBlockEntity
§fn default() -> ModBlockEntity
fn default() -> ModBlockEntity
Returns the “default value” for a type. Read more
§impl Deref for ModBlockEntity
impl Deref for ModBlockEntity
§impl DerefMut for ModBlockEntity
impl DerefMut for ModBlockEntity
§impl PartialEq for ModBlockEntity
impl PartialEq for ModBlockEntity
§impl Wire for ModBlockEntity
impl Wire for ModBlockEntity
Auto Trait Implementations§
impl Freeze for ModBlockEntity
impl RefUnwindSafe for ModBlockEntity
impl Send for ModBlockEntity
impl Sync for ModBlockEntity
impl Unpin for ModBlockEntity
impl UnsafeUnpin for ModBlockEntity
impl UnwindSafe for ModBlockEntity
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