mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 14:26:04 +00:00
Fix example in azalea-world
This commit is contained in:
parent
3b93fc6412
commit
8e1537ab3b
1 changed files with 11 additions and 6 deletions
|
@ -327,14 +327,19 @@ impl WeakEntityStorage {
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// let mut storage = EntityStorage::new();
|
/// # use std::sync::Arc;
|
||||||
/// storage.insert(
|
/// # use azalea_world::{PartialEntityStorage, entity::{EntityData, EntityMetadata, metadata}};
|
||||||
|
/// # use azalea_core::Vec3;
|
||||||
|
/// # use uuid::Uuid;
|
||||||
|
/// #
|
||||||
|
/// let mut storage = PartialEntityStorage::default();
|
||||||
|
/// storage.insert(
|
||||||
/// 0,
|
/// 0,
|
||||||
/// Arc::new(EntityData::new(
|
/// EntityData::new(
|
||||||
/// uuid,
|
/// Uuid::nil(),
|
||||||
/// Vec3::default(),
|
/// Vec3::default(),
|
||||||
/// EntityMetadata::Player(metadata::Player::default()),
|
/// EntityMetadata::Player(metadata::Player::default()),
|
||||||
/// )),
|
/// ),
|
||||||
/// );
|
/// );
|
||||||
/// for entity in storage.shared.read().entities() {
|
/// for entity in storage.shared.read().entities() {
|
||||||
/// if let Some(entity) = entity.upgrade() {
|
/// if let Some(entity) = entity.upgrade() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue