From abe59fe9719ff2cc7f3aff0cb6a138d20cfd4040 Mon Sep 17 00:00:00 2001 From: Yjn024 Date: Sat, 26 Aug 2023 18:40:27 +0800 Subject: [PATCH] doc --- core/src/component.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/component.rs b/core/src/component.rs index c4197e6..a31d7dc 100644 --- a/core/src/component.rs +++ b/core/src/component.rs @@ -196,7 +196,7 @@ impl ComponentsBuilder { } /// Enable nbt reading and writing feature for the instance. - pub fn nbt_rw(mut self) -> Self { + pub fn nbt_storing(mut self) -> Self { self.inner .register(nbt_save_event_comp_id(), nbt_event_comp()); self.inner @@ -354,6 +354,11 @@ static NBT_SAVE_ID: once_cell::sync::Lazy = static NBT_READ_ID: once_cell::sync::Lazy = once_cell::sync::Lazy::new(nbt_read_event_comp_id); +/// Represents a component that able to be stored +/// by nbt, through [`crate::nbt::Update`] trait. +/// +/// The `1` field is the component id which is used +/// to be registered into components. pub struct Saved(pub T, pub crate::Id) where T: Attach + crate::nbt::Update + 'static;