mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 06:16:04 +00:00
rename metadata::State to metadata::SnifferState
This commit is contained in:
parent
fa132b61fc
commit
1609b90a93
3 changed files with 12 additions and 8 deletions
|
@ -86,7 +86,7 @@ pub enum EntityDataValue {
|
|||
FrogVariant(azalea_registry::FrogVariant),
|
||||
OptionalGlobalPos(Option<GlobalPos>),
|
||||
PaintingVariant(azalea_registry::PaintingVariant),
|
||||
SnifferState(SnifferState),
|
||||
SnifferState(SnifferStateKind),
|
||||
ArmadilloState(ArmadilloStateKind),
|
||||
Vector3(Vec3),
|
||||
Quaternion(Quaternion),
|
||||
|
@ -162,7 +162,7 @@ pub struct VillagerData {
|
|||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, AzBuf, Default)]
|
||||
pub enum SnifferState {
|
||||
pub enum SnifferStateKind {
|
||||
#[default]
|
||||
Idling,
|
||||
FeelingHappy,
|
||||
|
|
|
@ -16,7 +16,7 @@ use uuid::Uuid;
|
|||
|
||||
use super::{
|
||||
ArmadilloStateKind, EntityDataItem, EntityDataValue, OptionalUnsignedInt, Pose, Quaternion,
|
||||
Rotations, SnifferState, VillagerData,
|
||||
Rotations, SnifferStateKind, VillagerData,
|
||||
};
|
||||
use crate::particle::Particle;
|
||||
|
||||
|
@ -8100,7 +8100,7 @@ impl Default for SmallFireballMetadataBundle {
|
|||
}
|
||||
|
||||
#[derive(Component, Deref, DerefMut, Clone)]
|
||||
pub struct State(pub SnifferState);
|
||||
pub struct SnifferState(pub SnifferStateKind);
|
||||
#[derive(Component, Deref, DerefMut, Clone)]
|
||||
pub struct DropSeedAtTick(pub i32);
|
||||
#[derive(Component)]
|
||||
|
@ -8113,7 +8113,7 @@ impl Sniffer {
|
|||
match d.index {
|
||||
0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
|
||||
17 => {
|
||||
entity.insert(State(d.value.into_sniffer_state()?));
|
||||
entity.insert(SnifferState(d.value.into_sniffer_state()?));
|
||||
}
|
||||
18 => {
|
||||
entity.insert(DropSeedAtTick(d.value.into_int()?));
|
||||
|
@ -8128,7 +8128,7 @@ impl Sniffer {
|
|||
pub struct SnifferMetadataBundle {
|
||||
_marker: Sniffer,
|
||||
parent: AbstractAnimalMetadataBundle,
|
||||
state: State,
|
||||
sniffer_state: SnifferState,
|
||||
drop_seed_at_tick: DropSeedAtTick,
|
||||
}
|
||||
impl Default for SnifferMetadataBundle {
|
||||
|
@ -8179,7 +8179,7 @@ impl Default for SnifferMetadataBundle {
|
|||
abstract_ageable_baby: AbstractAgeableBaby(false),
|
||||
},
|
||||
},
|
||||
state: State(Default::default()),
|
||||
sniffer_state: SnifferState(Default::default()),
|
||||
drop_seed_at_tick: DropSeedAtTick(0),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ use crate::particle::Particle;
|
|||
|
||||
use super::{
|
||||
ArmadilloStateKind, EntityDataItem, EntityDataValue, OptionalUnsignedInt, Pose, Quaternion,
|
||||
Rotations, SnifferState, VillagerData,
|
||||
Rotations, SnifferStateKind, VillagerData,
|
||||
};
|
||||
use azalea_chat::FormattedText;
|
||||
use azalea_core::{
|
||||
|
@ -140,6 +140,10 @@ impl From<EntityDataValue> for UpdateMetadataError {
|
|||
# build the duplicate_field_names set
|
||||
previous_field_names = set()
|
||||
duplicate_field_names = set()
|
||||
|
||||
# some generic names... we don't like these
|
||||
duplicate_field_names.add('state') # SnifferState instead of State
|
||||
|
||||
for entity_id in burger_entity_metadata.keys():
|
||||
field_name_map[entity_id] = {}
|
||||
for field_name_or_bitfield in get_entity_metadata_names(entity_id, burger_entity_metadata, mappings).values():
|
||||
|
|
Loading…
Add table
Reference in a new issue