mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 06:16:04 +00:00
add Client::metadata
This commit is contained in:
parent
614c0df053
commit
709c5dbc19
2 changed files with 8 additions and 1 deletions
|
@ -910,6 +910,12 @@ impl Client {
|
|||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Get the player metadata for ourselves. You can use this to get your
|
||||
/// health, xp score, and other useful information.
|
||||
pub fn metadata(&self) -> metadata::Player {
|
||||
self.entity().metadata.clone().into_player().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> From<std::sync::PoisonError<T>> for HandleError {
|
||||
|
|
|
@ -6,6 +6,7 @@ use super::{EntityDataValue, Pose, Rotations, VillagerData};
|
|||
use azalea_block::BlockState;
|
||||
use azalea_chat::Component;
|
||||
use azalea_core::{BlockPos, Direction, Particle, Slot};
|
||||
use enum_as_inner::EnumAsInner;
|
||||
use std::{
|
||||
collections::VecDeque,
|
||||
ops::{Deref, DerefMut},
|
||||
|
@ -7908,7 +7909,7 @@ impl DerefMut for AbstractTameable {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, EnumAsInner)]
|
||||
pub enum EntityMetadata {
|
||||
Allay(Allay),
|
||||
AreaEffectCloud(AreaEffectCloud),
|
||||
|
|
Loading…
Add table
Reference in a new issue