From 9846cb008abd88cb1785881dcac14014762977eb Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 15 Dec 2025 05:45:53 -0100 Subject: generate docs for metadata components --- .gitignore | 3 - azalea-entity/src/metadata.rs | 21856 +++++++++++++++++++++++++--------------- codegen/lib/code/entity.py | 127 +- 3 files changed, 13869 insertions(+), 8117 deletions(-) diff --git a/.gitignore b/.gitignore index e2e62e00..02af2033 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,6 @@ doc/ target/ rustc-ice-* -.cargo/config -.cargo/config.toml - # created by azalea-auth/examples/auth, defined in the main .gitignore because # the example could be run from anywhere example_cache.json diff --git a/azalea-entity/src/metadata.rs b/azalea-entity/src/metadata.rs index 5bbdbf1b..065b57ba 100644 --- a/azalea-entity/src/metadata.rs +++ b/azalea-entity/src/metadata.rs @@ -1,8 +1,200 @@ -#![allow(clippy::single_match)] - // This file is @generated from codegen/lib/code/entity.py. // Don't change it manually! +//! Metadata fields stored on entities. +//! +//! Also see the [protocol wiki documentation](https://minecraft.wiki/w/Java_Edition_protocol/Entity_metadata). +//! +//! # Entities +//! +//! Azalea creates a marker ECS component for every entity and abstract entity. +//! You can use these to check if an entity is of a given type with an ECS +//! filter, such as `With`. +//! +//! All marker components are shown as a tree structure below: +//! +//! - [AbstractEntity] +//! - [AreaEffectCloud] +//! - [BreezeWindCharge] +//! - [DragonFireball] +//! - [EndCrystal] +//! - [EvokerFangs] +//! - [ExperienceOrb] +//! - [EyeOfEnder] +//! - [FallingBlock] +//! - [Fireball] +//! - [FireworkRocket] +//! - [FishingBobber] +//! - [Interaction] +//! - [Item] +//! - [ItemFrame] +//! - [GlowItemFrame] +//! - [LeashKnot] +//! - [LightningBolt] +//! - [LlamaSpit] +//! - [Marker] +//! - [OminousItemSpawner] +//! - [Painting] +//! - [ShulkerBullet] +//! - [SmallFireball] +//! - [Tnt] +//! - [WindCharge] +//! - [WitherSkull] +//! - [AbstractArrow] +//! - [Arrow] +//! - [SpectralArrow] +//! - [Trident] +//! - [AbstractDisplay] +//! - [BlockDisplay] +//! - [ItemDisplay] +//! - [TextDisplay] +//! - [AbstractLiving] +//! - [ArmorStand] +//! - [AbstractAvatar] +//! - [Mannequin] +//! - [Player] +//! - [AbstractInsentient] +//! - [Bat] +//! - [EnderDragon] +//! - [Ghast] +//! - [Phantom] +//! - [Slime] +//! - [MagmaCube] +//! - [AbstractCreature] +//! - [Allay] +//! - [CopperGolem] +//! - [IronGolem] +//! - [Pufferfish] +//! - [Shulker] +//! - [SnowGolem] +//! - [Tadpole] +//! - [AbstractAgeable] +//! - [Dolphin] +//! - [Squid] +//! - [GlowSquid] +//! - [AbstractAnimal] +//! - [Armadillo] +//! - [Axolotl] +//! - [Bee] +//! - [Chicken] +//! - [Cow] +//! - [Fox] +//! - [Frog] +//! - [Goat] +//! - [HappyGhast] +//! - [Hoglin] +//! - [Mooshroom] +//! - [Ocelot] +//! - [Panda] +//! - [Pig] +//! - [PolarBear] +//! - [Rabbit] +//! - [Sheep] +//! - [Sniffer] +//! - [Strider] +//! - [Turtle] +//! - [AbstractHorse] +//! - [Camel] +//! - [CamelHusk] +//! - [Horse] +//! - [SkeletonHorse] +//! - [ZombieHorse] +//! - [AbstractChestedHorse] +//! - [Donkey] +//! - [Llama] +//! - [TraderLlama] +//! - [Mule] +//! - [AbstractTameable] +//! - [Cat] +//! - [Nautilus] +//! - [Parrot] +//! - [Wolf] +//! - [ZombieNautilus] +//! - [AbstractVillager] +//! - [Villager] +//! - [WanderingTrader] +//! - [AbstractFish] +//! - [Cod] +//! - [Salmon] +//! - [TropicalFish] +//! - [AbstractMonster] +//! - [Blaze] +//! - [Bogged] +//! - [Breeze] +//! - [Creaking] +//! - [Creeper] +//! - [Enderman] +//! - [Endermite] +//! - [Giant] +//! - [Guardian] +//! - [ElderGuardian] +//! - [Parched] +//! - [Silverfish] +//! - [Skeleton] +//! - [Spider] +//! - [CaveSpider] +//! - [Stray] +//! - [Vex] +//! - [Warden] +//! - [Wither] +//! - [WitherSkeleton] +//! - [Zoglin] +//! - [Zombie] +//! - [Drowned] +//! - [Husk] +//! - [ZombieVillager] +//! - [ZombifiedPiglin] +//! - [AbstractPiglin] +//! - [Piglin] +//! - [PiglinBrute] +//! - [AbstractRaider] +//! - [Pillager] +//! - [Ravager] +//! - [Vindicator] +//! - [Witch] +//! - [AbstractSpellcasterIllager] +//! - [Evoker] +//! - [Illusioner] +//! - [AbstractThrownItemProjectile] +//! - [Egg] +//! - [EnderPearl] +//! - [ExperienceBottle] +//! - [LingeringPotion] +//! - [Snowball] +//! - [SplashPotion] +//! - [AbstractVehicle] +//! - [AbstractBoat] +//! - [AcaciaBoat] +//! - [AcaciaChestBoat] +//! - [BambooChestRaft] +//! - [BambooRaft] +//! - [BirchBoat] +//! - [BirchChestBoat] +//! - [CherryBoat] +//! - [CherryChestBoat] +//! - [DarkOakBoat] +//! - [DarkOakChestBoat] +//! - [JungleBoat] +//! - [JungleChestBoat] +//! - [MangroveBoat] +//! - [MangroveChestBoat] +//! - [OakBoat] +//! - [OakChestBoat] +//! - [PaleOakBoat] +//! - [PaleOakChestBoat] +//! - [SpruceBoat] +//! - [SpruceChestBoat] +//! - [AbstractMinecart] +//! - [ChestMinecart] +//! - [CommandBlockMinecart] +//! - [FurnaceMinecart] +//! - [HopperMinecart] +//! - [Minecart] +//! - [SpawnerMinecart] +//! - [TntMinecart] + +#![allow(clippy::single_match)] + use azalea_chat::FormattedText; use azalea_core::{ direction::Direction, @@ -21,7 +213,7 @@ use super::{ }; use crate::{HumanoidArm, particle::Particle}; -#[derive(Debug, Error)] +#[derive(Error, Debug)] pub enum UpdateMetadataError { #[error("Wrong type ({0:?})")] WrongType(EntityDataValue), @@ -32,198 +224,288 @@ impl From for UpdateMetadataError { } } -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractEntity]. pub struct OnFire(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractEntity]. pub struct AbstractEntityShiftKeyDown(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractEntity]. pub struct Sprinting(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractEntity]. pub struct Swimming(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractEntity]. pub struct CurrentlyGlowing(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractEntity]. pub struct Invisible(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractEntity]. pub struct FallFlying(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] +/// A metadata field for [AbstractEntity]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] pub struct AirSupply(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] +/// A metadata field for [AbstractEntity]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] pub struct CustomName(pub Option); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] +/// A metadata field for [AbstractEntity]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] pub struct CustomNameVisible(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] +/// A metadata field for [AbstractEntity]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] pub struct Silent(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] +/// A metadata field for [AbstractEntity]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] pub struct NoGravity(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] +/// A metadata field for [AbstractEntity]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] pub struct TicksFrozen(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Hurt(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Hurtdir(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Damage(pub f32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PaddleLeft(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PaddleRight(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct BubbleTime(pub i32); -#[derive(Component)] -pub struct AcaciaBoat; -impl AcaciaBoat { - pub fn apply_metadata( - entity: &mut bevy_ecs::system::EntityCommands, - d: EntityDataItem, - ) -> Result<(), UpdateMetadataError> { - match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, - _ => {} - } - Ok(()) - } -} - -#[derive(Bundle)] -pub struct AcaciaBoatMetadataBundle { - _marker: AcaciaBoat, - parent: AbstractBoatMetadataBundle, -} -impl Default for AcaciaBoatMetadataBundle { - fn default() -> Self { - Self { - _marker: AcaciaBoat, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), - }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), - }, - } - } -} - -#[derive(Component)] -pub struct AcaciaChestBoat; -impl AcaciaChestBoat { - pub fn apply_metadata( - entity: &mut bevy_ecs::system::EntityCommands, - d: EntityDataItem, - ) -> Result<(), UpdateMetadataError> { - match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, - _ => {} - } - Ok(()) - } -} - -#[derive(Bundle)] -pub struct AcaciaChestBoatMetadataBundle { - _marker: AcaciaChestBoat, - parent: AbstractBoatMetadataBundle, -} -impl Default for AcaciaChestBoatMetadataBundle { - fn default() -> Self { - Self { - _marker: AcaciaChestBoat, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), - }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), - }, - } - } -} - -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct AutoSpinAttack(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct AbstractLivingUsingItem(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Health(pub f32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct EffectParticles(pub Vec); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct EffectAmbience(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ArrowCount(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct StingerCount(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct SleepingPos(pub Option); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct NoAi(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct LeftHanded(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct Aggressive(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Dancing(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct CanDuplicate(pub bool); +/// The root entity marker component. +/// +/// All entities that have had their metadata sent by the server will have this +/// component. +/// +/// # Metadata +/// +/// These are the metadata components that all `AbstractEntity` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [OnFire] +/// - [AbstractEntityShiftKeyDown] +/// - [Sprinting] +/// - [Swimming] +/// - [CurrentlyGlowing] +/// - [Invisible] +/// - [FallFlying] +/// - [AirSupply] +/// - [CustomName] +/// - [CustomNameVisible] +/// - [Silent] +/// - [NoGravity] +/// - [TicksFrozen] +/// +/// # Children +/// +/// - [AreaEffectCloud] +/// - [BreezeWindCharge] +/// - [DragonFireball] +/// - [EndCrystal] +/// - [EvokerFangs] +/// - [ExperienceOrb] +/// - [EyeOfEnder] +/// - [FallingBlock] +/// - [Fireball] +/// - [FireworkRocket] +/// - [FishingBobber] +/// - [Interaction] +/// - [Item] +/// - [ItemFrame] +/// - [GlowItemFrame] +/// - [LeashKnot] +/// - [LightningBolt] +/// - [LlamaSpit] +/// - [Marker] +/// - [OminousItemSpawner] +/// - [Painting] +/// - [ShulkerBullet] +/// - [SmallFireball] +/// - [Tnt] +/// - [WindCharge] +/// - [WitherSkull] +/// - [AbstractArrow] +/// - [Arrow] +/// - [SpectralArrow] +/// - [Trident] +/// - [AbstractDisplay] +/// - [BlockDisplay] +/// - [ItemDisplay] +/// - [TextDisplay] +/// - [AbstractLiving] +/// - [ArmorStand] +/// - [AbstractAvatar] +/// - [Mannequin] +/// - [Player] +/// - [AbstractInsentient] +/// - [Bat] +/// - [EnderDragon] +/// - [Ghast] +/// - [Phantom] +/// - [Slime] +/// - [MagmaCube] +/// - [AbstractCreature] +/// - [Allay] +/// - [CopperGolem] +/// - [IronGolem] +/// - [Pufferfish] +/// - [Shulker] +/// - [SnowGolem] +/// - [Tadpole] +/// - [AbstractAgeable] +/// - [Dolphin] +/// - [Squid] +/// - [GlowSquid] +/// - [AbstractAnimal] +/// - [Armadillo] +/// - [Axolotl] +/// - [Bee] +/// - [Chicken] +/// - [Cow] +/// - [Fox] +/// - [Frog] +/// - [Goat] +/// - [HappyGhast] +/// - [Hoglin] +/// - [Mooshroom] +/// - [Ocelot] +/// - [Panda] +/// - [Pig] +/// - [PolarBear] +/// - [Rabbit] +/// - [Sheep] +/// - [Sniffer] +/// - [Strider] +/// - [Turtle] +/// - [AbstractHorse] +/// - [Camel] +/// - [CamelHusk] +/// - [Horse] +/// - [SkeletonHorse] +/// - [ZombieHorse] +/// - [AbstractChestedHorse] +/// - [Donkey] +/// - [Llama] +/// - [TraderLlama] +/// - [Mule] +/// - [AbstractTameable] +/// - [Cat] +/// - [Nautilus] +/// - [Parrot] +/// - [Wolf] +/// - [ZombieNautilus] +/// - [AbstractVillager] +/// - [Villager] +/// - [WanderingTrader] +/// - [AbstractFish] +/// - [Cod] +/// - [Salmon] +/// - [TropicalFish] +/// - [AbstractMonster] +/// - [Blaze] +/// - [Bogged] +/// - [Breeze] +/// - [Creaking] +/// - [Creeper] +/// - [Enderman] +/// - [Endermite] +/// - [Giant] +/// - [Guardian] +/// - [ElderGuardian] +/// - [Parched] +/// - [Silverfish] +/// - [Skeleton] +/// - [Spider] +/// - [CaveSpider] +/// - [Stray] +/// - [Vex] +/// - [Warden] +/// - [Wither] +/// - [WitherSkeleton] +/// - [Zoglin] +/// - [Zombie] +/// - [Drowned] +/// - [Husk] +/// - [ZombieVillager] +/// - [ZombifiedPiglin] +/// - [AbstractPiglin] +/// - [Piglin] +/// - [PiglinBrute] +/// - [AbstractRaider] +/// - [Pillager] +/// - [Ravager] +/// - [Vindicator] +/// - [Witch] +/// - [AbstractSpellcasterIllager] +/// - [Evoker] +/// - [Illusioner] +/// - [AbstractThrownItemProjectile] +/// - [Egg] +/// - [EnderPearl] +/// - [ExperienceBottle] +/// - [LingeringPotion] +/// - [Snowball] +/// - [SplashPotion] +/// - [AbstractVehicle] +/// - [AbstractBoat] +/// - [AcaciaBoat] +/// - [AcaciaChestBoat] +/// - [BambooChestRaft] +/// - [BambooRaft] +/// - [BirchBoat] +/// - [BirchChestBoat] +/// - [CherryBoat] +/// - [CherryChestBoat] +/// - [DarkOakBoat] +/// - [DarkOakChestBoat] +/// - [JungleBoat] +/// - [JungleChestBoat] +/// - [MangroveBoat] +/// - [MangroveChestBoat] +/// - [OakBoat] +/// - [OakChestBoat] +/// - [PaleOakBoat] +/// - [PaleOakChestBoat] +/// - [SpruceBoat] +/// - [SpruceChestBoat] +/// - [AbstractMinecart] +/// - [ChestMinecart] +/// - [CommandBlockMinecart] +/// - [FurnaceMinecart] +/// - [HopperMinecart] +/// - [Minecart] +/// - [SpawnerMinecart] +/// - [TntMinecart] #[derive(Component)] -pub struct Allay; -impl Allay { +pub struct AbstractEntity; +impl AbstractEntity { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractCreature::apply_metadata(entity, d)?, - 16 => { - entity.insert(Dancing(d.value.into_boolean()?)); + 0 => { + let bitfield = d.value.into_byte()?; + entity.insert(OnFire(bitfield & 0x1 != 0)); + entity.insert(AbstractEntityShiftKeyDown(bitfield & 0x2 != 0)); + entity.insert(Sprinting(bitfield & 0x8 != 0)); + entity.insert(Swimming(bitfield & 0x10 != 0)); + entity.insert(CurrentlyGlowing(bitfield & 0x40 != 0)); + entity.insert(Invisible(bitfield & 0x20 != 0)); + entity.insert(FallFlying(bitfield & 0x80 != 0)); } - 17 => { - entity.insert(CanDuplicate(d.value.into_boolean()?)); + 1 => { + entity.insert(AirSupply(d.value.into_int()?)); + } + 2 => { + entity.insert(CustomName(d.value.into_optional_formatted_text()?)); + } + 3 => { + entity.insert(CustomNameVisible(d.value.into_boolean()?)); + } + 4 => { + entity.insert(Silent(d.value.into_boolean()?)); + } + 5 => { + entity.insert(NoGravity(d.value.into_boolean()?)); + } + 6 => { + entity.insert(d.value.into_pose()?); + } + 7 => { + entity.insert(TicksFrozen(d.value.into_int()?)); } _ => {} } @@ -231,64 +513,76 @@ impl Allay { } } +/// The metadata bundle for [AbstractEntity]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AllayMetadataBundle { - _marker: Allay, - parent: AbstractCreatureMetadataBundle, - dancing: Dancing, - can_duplicate: CanDuplicate, +pub struct AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire, + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown, + sprinting: Sprinting, + swimming: Swimming, + currently_glowing: CurrentlyGlowing, + invisible: Invisible, + fall_flying: FallFlying, + air_supply: AirSupply, + custom_name: CustomName, + custom_name_visible: CustomNameVisible, + silent: Silent, + no_gravity: NoGravity, + pose: Pose, + ticks_frozen: TicksFrozen, } -impl Default for AllayMetadataBundle { +impl Default for AbstractEntityMetadataBundle { fn default() -> Self { Self { - _marker: Allay, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - dancing: Dancing(false), - can_duplicate: CanDuplicate(true), + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] +/// A metadata field for [AreaEffectCloud]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] pub struct Radius(pub f32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] +/// A metadata field for [AreaEffectCloud]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] pub struct Waiting(pub bool); +/// The marker component for entities of type `minecraft:area_effect_cloud`. +/// +/// # Metadata +/// +/// These are the metadata components that all `AreaEffectCloud` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [Radius] +/// - [Waiting] +/// +/// # Parents +/// +/// Entities with `AreaEffectCloud` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] pub struct AreaEffectCloud; impl AreaEffectCloud { @@ -313,6 +607,9 @@ impl AreaEffectCloud { } } +/// The metadata bundle for [AreaEffectCloud]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] pub struct AreaEffectCloudMetadataBundle { _marker: AreaEffectCloud, @@ -349,231 +646,177 @@ impl Default for AreaEffectCloudMetadataBundle { } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct AbstractAgeableBaby(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ArmadilloState(pub ArmadilloStateKind); +/// The marker component for entities of type `minecraft:breeze_wind_charge`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `BreezeWindCharge` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Armadillo; -impl Armadillo { +pub struct BreezeWindCharge; +impl BreezeWindCharge { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, - 17 => { - entity.insert(ArmadilloState(d.value.into_armadillo_state()?)); - } + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [BreezeWindCharge]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct ArmadilloMetadataBundle { - _marker: Armadillo, - parent: AbstractAnimalMetadataBundle, - armadillo_state: ArmadilloState, +pub struct BreezeWindChargeMetadataBundle { + _marker: BreezeWindCharge, + parent: AbstractEntityMetadataBundle, } -impl Default for ArmadilloMetadataBundle { +impl Default for BreezeWindChargeMetadataBundle { fn default() -> Self { Self { - _marker: Armadillo, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - abstract_ageable_baby: AbstractAgeableBaby(false), - }, + _marker: BreezeWindCharge, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - armadillo_state: ArmadilloState(Default::default()), } } } -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct Small(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct ShowArms(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct ShowBasePlate(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct ArmorStandMarker(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct HeadPose(pub Rotations); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct BodyPose(pub Rotations); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct LeftArmPose(pub Rotations); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct RightArmPose(pub Rotations); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct LeftLegPose(pub Rotations); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct RightLegPose(pub Rotations); +/// The marker component for entities of type `minecraft:dragon_fireball`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `DragonFireball` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct ArmorStand; -impl ArmorStand { +pub struct DragonFireball; +impl DragonFireball { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=14 => AbstractLiving::apply_metadata(entity, d)?, - 15 => { - let bitfield = d.value.into_byte()?; - entity.insert(Small(bitfield & 0x1 != 0)); - entity.insert(ShowArms(bitfield & 0x4 != 0)); - entity.insert(ShowBasePlate(bitfield & 0x8 != 0)); - entity.insert(ArmorStandMarker(bitfield & 0x10 != 0)); - } - 16 => { - entity.insert(HeadPose(d.value.into_rotations()?)); - } - 17 => { - entity.insert(BodyPose(d.value.into_rotations()?)); - } - 18 => { - entity.insert(LeftArmPose(d.value.into_rotations()?)); - } - 19 => { - entity.insert(RightArmPose(d.value.into_rotations()?)); - } - 20 => { - entity.insert(LeftLegPose(d.value.into_rotations()?)); - } - 21 => { - entity.insert(RightLegPose(d.value.into_rotations()?)); - } + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [DragonFireball]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct ArmorStandMetadataBundle { - _marker: ArmorStand, - parent: AbstractLivingMetadataBundle, - small: Small, - show_arms: ShowArms, - show_base_plate: ShowBasePlate, - armor_stand_marker: ArmorStandMarker, - head_pose: HeadPose, - body_pose: BodyPose, - left_arm_pose: LeftArmPose, - right_arm_pose: RightArmPose, - left_leg_pose: LeftLegPose, - right_leg_pose: RightLegPose, +pub struct DragonFireballMetadataBundle { + _marker: DragonFireball, + parent: AbstractEntityMetadataBundle, } -impl Default for ArmorStandMetadataBundle { +impl Default for DragonFireballMetadataBundle { fn default() -> Self { Self { - _marker: ArmorStand, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + _marker: DragonFireball, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - small: Small(false), - show_arms: ShowArms(false), - show_base_plate: ShowBasePlate(false), - armor_stand_marker: ArmorStandMarker(false), - head_pose: HeadPose(Default::default()), - body_pose: BodyPose(Default::default()), - left_arm_pose: LeftArmPose(Default::default()), - right_arm_pose: RightArmPose(Default::default()), - left_leg_pose: LeftLegPose(Default::default()), - right_leg_pose: RightLegPose(Default::default()), } } } -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct CritArrow(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct NoPhysics(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PierceLevel(pub u8); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct InGround(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct EffectColor(pub i32); +/// A metadata field for [EndCrystal]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct BeamTarget(pub Option); +/// A metadata field for [EndCrystal]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ShowBottom(pub bool); +/// The marker component for entities of type `minecraft:end_crystal`. +/// +/// # Metadata +/// +/// These are the metadata components that all `EndCrystal` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [BeamTarget] +/// - [ShowBottom] +/// +/// # Parents +/// +/// Entities with `EndCrystal` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Arrow; -impl Arrow { +pub struct EndCrystal; +impl EndCrystal { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=10 => AbstractArrow::apply_metadata(entity, d)?, - 11 => { - entity.insert(EffectColor(d.value.into_int()?)); + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 8 => { + entity.insert(BeamTarget(d.value.into_optional_block_pos()?)); + } + 9 => { + entity.insert(ShowBottom(d.value.into_boolean()?)); } _ => {} } @@ -581,268 +824,294 @@ impl Arrow { } } +/// The metadata bundle for [EndCrystal]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct ArrowMetadataBundle { - _marker: Arrow, - parent: AbstractArrowMetadataBundle, - effect_color: EffectColor, +pub struct EndCrystalMetadataBundle { + _marker: EndCrystal, + parent: AbstractEntityMetadataBundle, + beam_target: BeamTarget, + show_bottom: ShowBottom, } -impl Default for ArrowMetadataBundle { +impl Default for EndCrystalMetadataBundle { fn default() -> Self { Self { - _marker: Arrow, - parent: AbstractArrowMetadataBundle { - _marker: AbstractArrow, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - crit_arrow: CritArrow(false), - no_physics: NoPhysics(false), - pierce_level: PierceLevel(0), - in_ground: InGround(false), - }, - effect_color: EffectColor(-1), - } - } -} + _marker: EndCrystal, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + beam_target: BeamTarget(None), + show_bottom: ShowBottom(true), + } + } +} -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct AxolotlVariant(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PlayingDead(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct AxolotlFromBucket(pub bool); +/// The marker component for entities of type `minecraft:evoker_fangs`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `EvokerFangs` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Axolotl; -impl Axolotl { +pub struct EvokerFangs; +impl EvokerFangs { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, - 17 => { - entity.insert(AxolotlVariant(d.value.into_int()?)); - } - 18 => { - entity.insert(PlayingDead(d.value.into_boolean()?)); - } - 19 => { - entity.insert(AxolotlFromBucket(d.value.into_boolean()?)); - } + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [EvokerFangs]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AxolotlMetadataBundle { - _marker: Axolotl, - parent: AbstractAnimalMetadataBundle, - axolotl_variant: AxolotlVariant, - playing_dead: PlayingDead, - axolotl_from_bucket: AxolotlFromBucket, +pub struct EvokerFangsMetadataBundle { + _marker: EvokerFangs, + parent: AbstractEntityMetadataBundle, } -impl Default for AxolotlMetadataBundle { +impl Default for EvokerFangsMetadataBundle { fn default() -> Self { Self { - _marker: Axolotl, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - abstract_ageable_baby: AbstractAgeableBaby(false), - }, + _marker: EvokerFangs, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - axolotl_variant: AxolotlVariant(0), - playing_dead: PlayingDead(false), - axolotl_from_bucket: AxolotlFromBucket(false), } } } +/// A metadata field for [ExperienceOrb]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Value(pub i32); +/// The marker component for entities of type `minecraft:experience_orb`. +/// +/// # Metadata +/// +/// These are the metadata components that all `ExperienceOrb` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [Value] +/// +/// # Parents +/// +/// Entities with `ExperienceOrb` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct BambooChestRaft; -impl BambooChestRaft { +pub struct ExperienceOrb; +impl ExperienceOrb { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 8 => { + entity.insert(Value(d.value.into_int()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [ExperienceOrb]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct BambooChestRaftMetadataBundle { - _marker: BambooChestRaft, - parent: AbstractBoatMetadataBundle, +pub struct ExperienceOrbMetadataBundle { + _marker: ExperienceOrb, + parent: AbstractEntityMetadataBundle, + value: Value, } -impl Default for BambooChestRaftMetadataBundle { +impl Default for ExperienceOrbMetadataBundle { fn default() -> Self { Self { - _marker: BambooChestRaft, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), - }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), + _marker: ExperienceOrb, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + value: Value(0), } } } +/// A metadata field for [EyeOfEnder]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct EyeOfEnderItemStack(pub ItemStack); +/// The marker component for entities of type `minecraft:eye_of_ender`. +/// +/// # Metadata +/// +/// These are the metadata components that all `EyeOfEnder` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [EyeOfEnderItemStack] +/// +/// # Parents +/// +/// Entities with `EyeOfEnder` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct BambooRaft; -impl BambooRaft { +pub struct EyeOfEnder; +impl EyeOfEnder { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 8 => { + entity.insert(EyeOfEnderItemStack(d.value.into_item_stack()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [EyeOfEnder]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct BambooRaftMetadataBundle { - _marker: BambooRaft, - parent: AbstractBoatMetadataBundle, +pub struct EyeOfEnderMetadataBundle { + _marker: EyeOfEnder, + parent: AbstractEntityMetadataBundle, + eye_of_ender_item_stack: EyeOfEnderItemStack, } -impl Default for BambooRaftMetadataBundle { +impl Default for EyeOfEnderMetadataBundle { fn default() -> Self { Self { - _marker: BambooRaft, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), - }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), + _marker: EyeOfEnder, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + eye_of_ender_item_stack: EyeOfEnderItemStack(Default::default()), } } } -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct Resting(pub bool); +/// A metadata field for [FallingBlock]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct StartPos(pub BlockPos); +/// The marker component for entities of type `minecraft:falling_block`. +/// +/// # Metadata +/// +/// These are the metadata components that all `FallingBlock` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [StartPos] +/// +/// # Parents +/// +/// Entities with `FallingBlock` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Bat; -impl Bat { +pub struct FallingBlock; +impl FallingBlock { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractInsentient::apply_metadata(entity, d)?, - 16 => { - let bitfield = d.value.into_byte()?; - entity.insert(Resting(bitfield & 0x1 != 0)); + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 8 => { + entity.insert(StartPos(d.value.into_block_pos()?)); } _ => {} } @@ -850,80 +1119,75 @@ impl Bat { } } +/// The metadata bundle for [FallingBlock]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct BatMetadataBundle { - _marker: Bat, - parent: AbstractInsentientMetadataBundle, - resting: Resting, +pub struct FallingBlockMetadataBundle { + _marker: FallingBlock, + parent: AbstractEntityMetadataBundle, + start_pos: StartPos, } -impl Default for BatMetadataBundle { +impl Default for FallingBlockMetadataBundle { fn default() -> Self { Self { - _marker: Bat, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + _marker: FallingBlock, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - resting: Resting(false), + start_pos: StartPos(BlockPos::new(0, 0, 0)), } } } -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct HasNectar(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct HasStung(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct BeeRolling(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct BeeAngerEndTime(pub i64); +/// A metadata field for [Fireball]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct FireballItemStack(pub ItemStack); +/// The marker component for entities of type `minecraft:fireball`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Fireball` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [FireballItemStack] +/// +/// # Parents +/// +/// Entities with `Fireball` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Bee; -impl Bee { +pub struct Fireball; +impl Fireball { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, - 17 => { - let bitfield = d.value.into_byte()?; - entity.insert(HasNectar(bitfield & 0x8 != 0)); - entity.insert(HasStung(bitfield & 0x4 != 0)); - entity.insert(BeeRolling(bitfield & 0x2 != 0)); - } - 18 => { - entity.insert(BeeAngerEndTime(d.value.into_long()?)); + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 8 => { + entity.insert(FireballItemStack(d.value.into_item_stack()?)); } _ => {} } @@ -931,201 +1195,268 @@ impl Bee { } } +/// The metadata bundle for [Fireball]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct BeeMetadataBundle { - _marker: Bee, - parent: AbstractAnimalMetadataBundle, - has_nectar: HasNectar, - has_stung: HasStung, - bee_rolling: BeeRolling, - bee_anger_end_time: BeeAngerEndTime, +pub struct FireballMetadataBundle { + _marker: Fireball, + parent: AbstractEntityMetadataBundle, + fireball_item_stack: FireballItemStack, } -impl Default for BeeMetadataBundle { +impl Default for FireballMetadataBundle { fn default() -> Self { Self { - _marker: Bee, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - abstract_ageable_baby: AbstractAgeableBaby(false), - }, + _marker: Fireball, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - has_nectar: HasNectar(false), - has_stung: HasStung(false), - bee_rolling: BeeRolling(false), - bee_anger_end_time: BeeAngerEndTime(-1), + fireball_item_stack: FireballItemStack(Default::default()), } } } +/// A metadata field for [FireworkRocket]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct FireworksItem(pub ItemStack); +/// A metadata field for [FireworkRocket]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct AttachedToTarget(pub OptionalUnsignedInt); +/// A metadata field for [FireworkRocket]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ShotAtAngle(pub bool); +/// The marker component for entities of type `minecraft:firework_rocket`. +/// +/// # Metadata +/// +/// These are the metadata components that all `FireworkRocket` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [FireworksItem] +/// - [AttachedToTarget] +/// - [ShotAtAngle] +/// +/// # Parents +/// +/// Entities with `FireworkRocket` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct BirchBoat; -impl BirchBoat { +pub struct FireworkRocket; +impl FireworkRocket { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 8 => { + entity.insert(FireworksItem(d.value.into_item_stack()?)); + } + 9 => { + entity.insert(AttachedToTarget(d.value.into_optional_unsigned_int()?)); + } + 10 => { + entity.insert(ShotAtAngle(d.value.into_boolean()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [FireworkRocket]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct BirchBoatMetadataBundle { - _marker: BirchBoat, - parent: AbstractBoatMetadataBundle, +pub struct FireworkRocketMetadataBundle { + _marker: FireworkRocket, + parent: AbstractEntityMetadataBundle, + fireworks_item: FireworksItem, + attached_to_target: AttachedToTarget, + shot_at_angle: ShotAtAngle, } -impl Default for BirchBoatMetadataBundle { +impl Default for FireworkRocketMetadataBundle { fn default() -> Self { Self { - _marker: BirchBoat, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), - }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), + _marker: FireworkRocket, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + fireworks_item: FireworksItem(Default::default()), + attached_to_target: AttachedToTarget(OptionalUnsignedInt(None)), + shot_at_angle: ShotAtAngle(false), } } } +/// A metadata field for [FishingBobber]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct HookedEntity(pub i32); +/// A metadata field for [FishingBobber]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Biting(pub bool); +/// The marker component for entities of type `minecraft:fishing_bobber`. +/// +/// # Metadata +/// +/// These are the metadata components that all `FishingBobber` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [HookedEntity] +/// - [Biting] +/// +/// # Parents +/// +/// Entities with `FishingBobber` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct BirchChestBoat; -impl BirchChestBoat { +pub struct FishingBobber; +impl FishingBobber { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 8 => { + entity.insert(HookedEntity(d.value.into_int()?)); + } + 9 => { + entity.insert(Biting(d.value.into_boolean()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [FishingBobber]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct BirchChestBoatMetadataBundle { - _marker: BirchChestBoat, - parent: AbstractBoatMetadataBundle, +pub struct FishingBobberMetadataBundle { + _marker: FishingBobber, + parent: AbstractEntityMetadataBundle, + hooked_entity: HookedEntity, + biting: Biting, } -impl Default for BirchChestBoatMetadataBundle { +impl Default for FishingBobberMetadataBundle { fn default() -> Self { Self { - _marker: BirchChestBoat, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), - }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), + _marker: FishingBobber, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + hooked_entity: HookedEntity(0), + biting: Biting(false), } } } -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct Charged(pub bool); +/// A metadata field for [Interaction]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct InteractionWidth(pub f32); +/// A metadata field for [Interaction]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct InteractionHeight(pub f32); +/// A metadata field for [Interaction]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Response(pub bool); +/// The marker component for entities of type `minecraft:interaction`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Interaction` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [InteractionWidth] +/// - [InteractionHeight] +/// - [Response] +/// +/// # Parents +/// +/// Entities with `Interaction` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Blaze; -impl Blaze { +pub struct Interaction; +impl Interaction { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractMonster::apply_metadata(entity, d)?, - 16 => { - let bitfield = d.value.into_byte()?; - entity.insert(Charged(bitfield & 0x1 != 0)); + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 8 => { + entity.insert(InteractionWidth(d.value.into_float()?)); + } + 9 => { + entity.insert(InteractionHeight(d.value.into_float()?)); + } + 10 => { + entity.insert(Response(d.value.into_boolean()?)); } _ => {} } @@ -1133,104 +1464,78 @@ impl Blaze { } } +/// The metadata bundle for [Interaction]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct BlazeMetadataBundle { - _marker: Blaze, - parent: AbstractMonsterMetadataBundle, - charged: Charged, +pub struct InteractionMetadataBundle { + _marker: Interaction, + parent: AbstractEntityMetadataBundle, + interaction_width: InteractionWidth, + interaction_height: InteractionHeight, + response: Response, } -impl Default for BlazeMetadataBundle { +impl Default for InteractionMetadataBundle { fn default() -> Self { Self { - _marker: Blaze, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, + _marker: Interaction, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - charged: Charged(false), + interaction_width: InteractionWidth(1.0), + interaction_height: InteractionHeight(1.0), + response: Response(false), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct TransformationInterpolationStartDeltaTicks(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct TransformationInterpolationDuration(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PosRotInterpolationDuration(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Translation(pub Vec3f32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Scale(pub Vec3f32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct LeftRotation(pub Quaternion); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct RightRotation(pub Quaternion); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct BillboardRenderConstraints(pub u8); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct BrightnessOverride(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ViewRange(pub f32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ShadowRadius(pub f32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ShadowStrength(pub f32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct AbstractDisplayWidth(pub f32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct AbstractDisplayHeight(pub f32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct GlowColorOverride(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct BlockDisplayBlockState(pub azalea_block::BlockState); +/// A metadata field for [Item]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ItemItem(pub ItemStack); +/// The marker component for entities of type `minecraft:item`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Item` entities are guaranteed to +/// have, in addition to the metadata components from parent types: +/// +/// - [ItemItem] +/// +/// # Parents +/// +/// Entities with `Item` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct BlockDisplay; -impl BlockDisplay { +pub struct Item; +impl Item { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=22 => AbstractDisplay::apply_metadata(entity, d)?, - 23 => { - entity.insert(BlockDisplayBlockState(d.value.into_block_state()?)); + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 8 => { + entity.insert(ItemItem(d.value.into_item_stack()?)); } _ => {} } @@ -1238,88 +1543,89 @@ impl BlockDisplay { } } +/// The metadata bundle for [Item]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct BlockDisplayMetadataBundle { - _marker: BlockDisplay, - parent: AbstractDisplayMetadataBundle, - block_display_block_state: BlockDisplayBlockState, +pub struct ItemMetadataBundle { + _marker: Item, + parent: AbstractEntityMetadataBundle, + item_item: ItemItem, } -impl Default for BlockDisplayMetadataBundle { +impl Default for ItemMetadataBundle { fn default() -> Self { Self { - _marker: BlockDisplay, - parent: AbstractDisplayMetadataBundle { - _marker: AbstractDisplay, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - transformation_interpolation_start_delta_ticks: - TransformationInterpolationStartDeltaTicks(0), - transformation_interpolation_duration: TransformationInterpolationDuration(0), - pos_rot_interpolation_duration: PosRotInterpolationDuration(0), - translation: Translation(Vec3f32 { - x: 0.0, - y: 0.0, - z: 0.0, - }), - scale: Scale(Vec3f32 { - x: 1.0, - y: 1.0, - z: 1.0, - }), - left_rotation: LeftRotation(Quaternion { - x: 0.0, - y: 0.0, - z: 0.0, - w: 1.0, - }), - right_rotation: RightRotation(Quaternion { - x: 0.0, - y: 0.0, - z: 0.0, - w: 1.0, - }), - billboard_render_constraints: BillboardRenderConstraints(Default::default()), - brightness_override: BrightnessOverride(-1), - view_range: ViewRange(1.0), - shadow_radius: ShadowRadius(0.0), - shadow_strength: ShadowStrength(1.0), - abstract_display_width: AbstractDisplayWidth(0.0), - abstract_display_height: AbstractDisplayHeight(0.0), - glow_color_override: GlowColorOverride(-1), - }, - block_display_block_state: BlockDisplayBlockState(Default::default()), - } - } -} + _marker: Item, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + item_item: ItemItem(Default::default()), + } + } +} -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct BoggedSheared(pub bool); +/// A metadata field for [ItemFrame]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ItemFrameDirection(pub Direction); +/// A metadata field for [ItemFrame]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ItemFrameItem(pub ItemStack); +/// A metadata field for [ItemFrame]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Rotation(pub i32); +/// The marker component for entities of type `minecraft:item_frame`. +/// +/// # Metadata +/// +/// These are the metadata components that all `ItemFrame` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [ItemFrameDirection] +/// - [ItemFrameItem] +/// - [Rotation] +/// +/// # Parents +/// +/// Entities with `ItemFrame` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [GlowItemFrame] #[derive(Component)] -pub struct Bogged; -impl Bogged { +pub struct ItemFrame; +impl ItemFrame { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractMonster::apply_metadata(entity, d)?, - 16 => { - entity.insert(BoggedSheared(d.value.into_boolean()?)); + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 8 => { + entity.insert(ItemFrameDirection(d.value.into_direction()?)); + } + 9 => { + entity.insert(ItemFrameItem(d.value.into_item_stack()?)); + } + 10 => { + entity.insert(Rotation(d.value.into_int()?)); } _ => {} } @@ -1327,132 +1633,137 @@ impl Bogged { } } +/// The metadata bundle for [ItemFrame]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct BoggedMetadataBundle { - _marker: Bogged, - parent: AbstractMonsterMetadataBundle, - bogged_sheared: BoggedSheared, +pub struct ItemFrameMetadataBundle { + _marker: ItemFrame, + parent: AbstractEntityMetadataBundle, + item_frame_direction: ItemFrameDirection, + item_frame_item: ItemFrameItem, + rotation: Rotation, } -impl Default for BoggedMetadataBundle { +impl Default for ItemFrameMetadataBundle { fn default() -> Self { Self { - _marker: Bogged, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, + _marker: ItemFrame, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - bogged_sheared: BoggedSheared(false), + item_frame_direction: ItemFrameDirection(Default::default()), + item_frame_item: ItemFrameItem(Default::default()), + rotation: Rotation(0), } } } +/// The marker component for entities of type `minecraft:glow_item_frame`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `GlowItemFrame` will also have the following marker components +/// and their metadata fields: +/// +/// - [ItemFrame] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Breeze; -impl Breeze { +pub struct GlowItemFrame; +impl GlowItemFrame { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractMonster::apply_metadata(entity, d)?, + 0..=10 => ItemFrame::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [GlowItemFrame]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct BreezeMetadataBundle { - _marker: Breeze, - parent: AbstractMonsterMetadataBundle, +pub struct GlowItemFrameMetadataBundle { + _marker: GlowItemFrame, + parent: ItemFrameMetadataBundle, } -impl Default for BreezeMetadataBundle { +impl Default for GlowItemFrameMetadataBundle { fn default() -> Self { Self { - _marker: Breeze, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, + _marker: GlowItemFrame, + parent: ItemFrameMetadataBundle { + _marker: ItemFrame, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + item_frame_direction: ItemFrameDirection(Default::default()), + item_frame_item: ItemFrameItem(Default::default()), + rotation: Rotation(0), }, } } } +/// The marker component for entities of type `minecraft:leash_knot`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `LeashKnot` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct BreezeWindCharge; -impl BreezeWindCharge { +pub struct LeashKnot; +impl LeashKnot { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, @@ -1465,15 +1776,18 @@ impl BreezeWindCharge { } } +/// The metadata bundle for [LeashKnot]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct BreezeWindChargeMetadataBundle { - _marker: BreezeWindCharge, +pub struct LeashKnotMetadataBundle { + _marker: LeashKnot, parent: AbstractEntityMetadataBundle, } -impl Default for BreezeWindChargeMetadataBundle { +impl Default for LeashKnotMetadataBundle { fn default() -> Self { Self { - _marker: BreezeWindCharge, + _marker: LeashKnot, parent: AbstractEntityMetadataBundle { _marker: AbstractEntity, on_fire: OnFire(false), @@ -1495,573 +1809,543 @@ impl Default for BreezeWindChargeMetadataBundle { } } -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct Tamed(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct Eating(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct AbstractHorseStanding(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct Bred(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct CamelDash(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct LastPoseChangeTick(pub i64); +/// The marker component for entities of type `minecraft:lightning_bolt`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `LightningBolt` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Camel; -impl Camel { +pub struct LightningBolt; +impl LightningBolt { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=17 => AbstractHorse::apply_metadata(entity, d)?, - 18 => { - entity.insert(CamelDash(d.value.into_boolean()?)); - } - 19 => { - entity.insert(LastPoseChangeTick(d.value.into_long()?)); - } + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [LightningBolt]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct CamelMetadataBundle { - _marker: Camel, - parent: AbstractHorseMetadataBundle, - camel_dash: CamelDash, - last_pose_change_tick: LastPoseChangeTick, +pub struct LightningBoltMetadataBundle { + _marker: LightningBolt, + parent: AbstractEntityMetadataBundle, } -impl Default for CamelMetadataBundle { +impl Default for LightningBoltMetadataBundle { fn default() -> Self { Self { - _marker: Camel, - parent: AbstractHorseMetadataBundle { - _marker: AbstractHorse, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - abstract_ageable_baby: AbstractAgeableBaby(false), - }, - }, - tamed: Tamed(false), - eating: Eating(false), - abstract_horse_standing: AbstractHorseStanding(false), - bred: Bred(false), + _marker: LightningBolt, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - camel_dash: CamelDash(false), - last_pose_change_tick: LastPoseChangeTick(0), } } } +/// The marker component for entities of type `minecraft:llama_spit`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `LlamaSpit` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct CamelHusk; -impl CamelHusk { +pub struct LlamaSpit; +impl LlamaSpit { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=19 => Camel::apply_metadata(entity, d)?, + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [LlamaSpit]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct CamelHuskMetadataBundle { - _marker: CamelHusk, - parent: CamelMetadataBundle, +pub struct LlamaSpitMetadataBundle { + _marker: LlamaSpit, + parent: AbstractEntityMetadataBundle, } -impl Default for CamelHuskMetadataBundle { +impl Default for LlamaSpitMetadataBundle { fn default() -> Self { Self { - _marker: CamelHusk, - parent: CamelMetadataBundle { - _marker: Camel, - parent: AbstractHorseMetadataBundle { - _marker: AbstractHorse, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: - AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible( - Default::default(), - ), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - abstract_ageable_baby: AbstractAgeableBaby(false), - }, - }, - tamed: Tamed(false), - eating: Eating(false), - abstract_horse_standing: AbstractHorseStanding(false), - bred: Bred(false), - }, - camel_dash: CamelDash(false), - last_pose_change_tick: LastPoseChangeTick(0), + _marker: LlamaSpit, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, } } } -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct Tame(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct InSittingPose(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Owneruuid(pub Option); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct CatVariant(pub azalea_registry::data::CatVariant); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct IsLying(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct RelaxStateOne(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct CatCollarColor(pub i32); +/// The marker component for entities of type `minecraft:marker`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Marker` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Cat; -impl Cat { +pub struct Marker; +impl Marker { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=18 => AbstractTameable::apply_metadata(entity, d)?, - 19 => { - entity.insert(CatVariant(d.value.into_cat_variant()?)); - } - 20 => { - entity.insert(IsLying(d.value.into_boolean()?)); - } - 21 => { - entity.insert(RelaxStateOne(d.value.into_boolean()?)); - } - 22 => { - entity.insert(CatCollarColor(d.value.into_int()?)); - } + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [Marker]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct CatMetadataBundle { - _marker: Cat, - parent: AbstractTameableMetadataBundle, - cat_variant: CatVariant, - is_lying: IsLying, - relax_state_one: RelaxStateOne, - cat_collar_color: CatCollarColor, +pub struct MarkerMetadataBundle { + _marker: Marker, + parent: AbstractEntityMetadataBundle, } -impl Default for CatMetadataBundle { +impl Default for MarkerMetadataBundle { fn default() -> Self { Self { - _marker: Cat, - parent: AbstractTameableMetadataBundle { - _marker: AbstractTameable, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - abstract_ageable_baby: AbstractAgeableBaby(false), - }, - }, - tame: Tame(false), - in_sitting_pose: InSittingPose(false), - owneruuid: Owneruuid(None), + _marker: Marker, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - cat_variant: CatVariant(azalea_registry::data::CatVariant::new_raw(0)), - is_lying: IsLying(false), - relax_state_one: RelaxStateOne(false), - cat_collar_color: CatCollarColor(Default::default()), } } } -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct Climbing(pub bool); +/// A metadata field for [OminousItemSpawner]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct OminousItemSpawnerItem(pub ItemStack); +/// The marker component for entities of type `minecraft:ominous_item_spawner`. +/// +/// # Metadata +/// +/// These are the metadata components that all `OminousItemSpawner` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [OminousItemSpawnerItem] +/// +/// # Parents +/// +/// Entities with `OminousItemSpawner` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct CaveSpider; -impl CaveSpider { +pub struct OminousItemSpawner; +impl OminousItemSpawner { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => Spider::apply_metadata(entity, d)?, - _ => {} - } - Ok(()) + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 8 => { + entity.insert(OminousItemSpawnerItem(d.value.into_item_stack()?)); + } + _ => {} + } + Ok(()) } } +/// The metadata bundle for [OminousItemSpawner]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct CaveSpiderMetadataBundle { - _marker: CaveSpider, - parent: SpiderMetadataBundle, +pub struct OminousItemSpawnerMetadataBundle { + _marker: OminousItemSpawner, + parent: AbstractEntityMetadataBundle, + ominous_item_spawner_item: OminousItemSpawnerItem, } -impl Default for CaveSpiderMetadataBundle { +impl Default for OminousItemSpawnerMetadataBundle { fn default() -> Self { Self { - _marker: CaveSpider, - parent: SpiderMetadataBundle { - _marker: Spider, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - }, - climbing: Climbing(false), + _marker: OminousItemSpawner, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + ominous_item_spawner_item: OminousItemSpawnerItem(Default::default()), } } } +/// A metadata field for [Painting]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PaintingDirection(pub Direction); +/// A metadata field for [Painting]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PaintingVariant(pub azalea_registry::data::PaintingVariant); +/// The marker component for entities of type `minecraft:painting`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Painting` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [PaintingDirection] +/// - [PaintingVariant] +/// +/// # Parents +/// +/// Entities with `Painting` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct CherryBoat; -impl CherryBoat { +pub struct Painting; +impl Painting { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 8 => { + entity.insert(PaintingDirection(d.value.into_direction()?)); + } + 9 => { + entity.insert(PaintingVariant(d.value.into_painting_variant()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Painting]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct CherryBoatMetadataBundle { - _marker: CherryBoat, - parent: AbstractBoatMetadataBundle, +pub struct PaintingMetadataBundle { + _marker: Painting, + parent: AbstractEntityMetadataBundle, + painting_direction: PaintingDirection, + painting_variant: PaintingVariant, } -impl Default for CherryBoatMetadataBundle { +impl Default for PaintingMetadataBundle { fn default() -> Self { Self { - _marker: CherryBoat, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), - }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), + _marker: Painting, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + painting_direction: PaintingDirection(Default::default()), + painting_variant: PaintingVariant(azalea_registry::data::PaintingVariant::new_raw(0)), } } } +/// The marker component for entities of type `minecraft:shulker_bullet`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `ShulkerBullet` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct CherryChestBoat; -impl CherryChestBoat { +pub struct ShulkerBullet; +impl ShulkerBullet { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [ShulkerBullet]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct CherryChestBoatMetadataBundle { - _marker: CherryChestBoat, - parent: AbstractBoatMetadataBundle, +pub struct ShulkerBulletMetadataBundle { + _marker: ShulkerBullet, + parent: AbstractEntityMetadataBundle, } -impl Default for CherryChestBoatMetadataBundle { +impl Default for ShulkerBulletMetadataBundle { fn default() -> Self { Self { - _marker: CherryChestBoat, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), - }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), + _marker: ShulkerBullet, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct CustomDisplayBlock(pub azalea_block::BlockState); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct DisplayOffset(pub i32); +/// A metadata field for [SmallFireball]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct SmallFireballItemStack(pub ItemStack); +/// The marker component for entities of type `minecraft:small_fireball`. +/// +/// # Metadata +/// +/// These are the metadata components that all `SmallFireball` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [SmallFireballItemStack] +/// +/// # Parents +/// +/// Entities with `SmallFireball` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct ChestMinecart; -impl ChestMinecart { +pub struct SmallFireball; +impl SmallFireball { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=12 => AbstractMinecart::apply_metadata(entity, d)?, + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 8 => { + entity.insert(SmallFireballItemStack(d.value.into_item_stack()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [SmallFireball]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct ChestMinecartMetadataBundle { - _marker: ChestMinecart, - parent: AbstractMinecartMetadataBundle, +pub struct SmallFireballMetadataBundle { + _marker: SmallFireball, + parent: AbstractEntityMetadataBundle, + small_fireball_item_stack: SmallFireballItemStack, } -impl Default for ChestMinecartMetadataBundle { +impl Default for SmallFireballMetadataBundle { fn default() -> Self { Self { - _marker: ChestMinecart, - parent: AbstractMinecartMetadataBundle { - _marker: AbstractMinecart, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), - }, - custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR), - display_offset: DisplayOffset(Default::default()), + _marker: SmallFireball, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + small_fireball_item_stack: SmallFireballItemStack(Default::default()), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ChickenVariant(pub azalea_registry::data::PigVariant); +/// A metadata field for [Tnt]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Fuse(pub i32); +/// A metadata field for [Tnt]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct TntBlockState(pub azalea_block::BlockState); +/// The marker component for entities of type `minecraft:tnt`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Tnt` entities are guaranteed to +/// have, in addition to the metadata components from parent types: +/// +/// - [Fuse] +/// - [TntBlockState] +/// +/// # Parents +/// +/// Entities with `Tnt` will also have the following marker components and their +/// metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Chicken; -impl Chicken { +pub struct Tnt; +impl Tnt { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, - 17 => { - entity.insert(ChickenVariant(d.value.into_pig_variant()?)); + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 8 => { + entity.insert(Fuse(d.value.into_int()?)); + } + 9 => { + entity.insert(TntBlockState(d.value.into_block_state()?)); } _ => {} } @@ -2069,156 +2353,142 @@ impl Chicken { } } +/// The metadata bundle for [Tnt]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct ChickenMetadataBundle { - _marker: Chicken, - parent: AbstractAnimalMetadataBundle, - chicken_variant: ChickenVariant, +pub struct TntMetadataBundle { + _marker: Tnt, + parent: AbstractEntityMetadataBundle, + fuse: Fuse, + tnt_block_state: TntBlockState, } -impl Default for ChickenMetadataBundle { +impl Default for TntMetadataBundle { fn default() -> Self { Self { - _marker: Chicken, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - abstract_ageable_baby: AbstractAgeableBaby(false), - }, + _marker: Tnt, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - chicken_variant: ChickenVariant(azalea_registry::data::PigVariant::new_raw(0)), + fuse: Fuse(80), + tnt_block_state: TntBlockState(Default::default()), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct AbstractFishFromBucket(pub bool); +/// The marker component for entities of type `minecraft:wind_charge`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `WindCharge` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Cod; -impl Cod { +pub struct WindCharge; +impl WindCharge { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractFish::apply_metadata(entity, d)?, + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [WindCharge]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct CodMetadataBundle { - _marker: Cod, - parent: AbstractFishMetadataBundle, +pub struct WindChargeMetadataBundle { + _marker: WindCharge, + parent: AbstractEntityMetadataBundle, } -impl Default for CodMetadataBundle { +impl Default for WindChargeMetadataBundle { fn default() -> Self { Self { - _marker: Cod, - parent: AbstractFishMetadataBundle { - _marker: AbstractFish, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - abstract_fish_from_bucket: AbstractFishFromBucket(false), + _marker: WindCharge, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct CommandName(pub String); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct LastOutput(pub FormattedText); +/// A metadata field for [WitherSkull]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Dangerous(pub bool); +/// The marker component for entities of type `minecraft:wither_skull`. +/// +/// # Metadata +/// +/// These are the metadata components that all `WitherSkull` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [Dangerous] +/// +/// # Parents +/// +/// Entities with `WitherSkull` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct CommandBlockMinecart; -impl CommandBlockMinecart { +pub struct WitherSkull; +impl WitherSkull { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=12 => AbstractMinecart::apply_metadata(entity, d)?, - 13 => { - entity.insert(CommandName(d.value.into_string()?)); - } - 14 => { - entity.insert(LastOutput(d.value.into_formatted_text()?)); + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 8 => { + entity.insert(Dangerous(d.value.into_boolean()?)); } _ => {} } @@ -2226,69 +2496,97 @@ impl CommandBlockMinecart { } } +/// The metadata bundle for [WitherSkull]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct CommandBlockMinecartMetadataBundle { - _marker: CommandBlockMinecart, - parent: AbstractMinecartMetadataBundle, - command_name: CommandName, - last_output: LastOutput, +pub struct WitherSkullMetadataBundle { + _marker: WitherSkull, + parent: AbstractEntityMetadataBundle, + dangerous: Dangerous, } -impl Default for CommandBlockMinecartMetadataBundle { +impl Default for WitherSkullMetadataBundle { fn default() -> Self { Self { - _marker: CommandBlockMinecart, - parent: AbstractMinecartMetadataBundle { - _marker: AbstractMinecart, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), - }, - custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR), - display_offset: DisplayOffset(Default::default()), - }, - command_name: CommandName("".to_owned()), - last_output: LastOutput(Default::default()), - } - } -} - -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct WeatherState(pub WeatheringCopperStateKind); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct CopperGolemState(pub CopperGolemStateKind); -#[derive(Component)] -pub struct CopperGolem; -impl CopperGolem { + _marker: WitherSkull, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + dangerous: Dangerous(false), + } + } +} + +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractArrow]. +pub struct CritArrow(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractArrow]. +pub struct NoPhysics(pub bool); +/// A metadata field for [AbstractArrow]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PierceLevel(pub u8); +/// A metadata field for [AbstractArrow]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct InGround(pub bool); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// These are the metadata components that all `AbstractArrow` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [CritArrow] +/// - [NoPhysics] +/// - [PierceLevel] +/// - [InGround] +/// +/// # Parents +/// +/// Entities with `AbstractArrow` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [Arrow] +/// - [SpectralArrow] +/// - [Trident] +#[derive(Component)] +pub struct AbstractArrow; +impl AbstractArrow { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractCreature::apply_metadata(entity, d)?, - 16 => { - entity.insert(WeatherState(d.value.into_weathering_copper_state()?)); + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 8 => { + let bitfield = d.value.into_byte()?; + entity.insert(CritArrow(bitfield & 0x1 != 0)); + entity.insert(NoPhysics(bitfield & 0x2 != 0)); } - 17 => { - entity.insert(CopperGolemState(d.value.into_copper_golem_state()?)); + 9 => { + entity.insert(PierceLevel(d.value.into_byte()?)); + } + 10 => { + entity.insert(InGround(d.value.into_boolean()?)); } _ => {} } @@ -2296,73 +2594,81 @@ impl CopperGolem { } } +/// The metadata bundle for [AbstractArrow]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct CopperGolemMetadataBundle { - _marker: CopperGolem, - parent: AbstractCreatureMetadataBundle, - weather_state: WeatherState, - copper_golem_state: CopperGolemState, +pub struct AbstractArrowMetadataBundle { + _marker: AbstractArrow, + parent: AbstractEntityMetadataBundle, + crit_arrow: CritArrow, + no_physics: NoPhysics, + pierce_level: PierceLevel, + in_ground: InGround, } -impl Default for CopperGolemMetadataBundle { +impl Default for AbstractArrowMetadataBundle { fn default() -> Self { Self { - _marker: CopperGolem, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, + _marker: AbstractArrow, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - weather_state: WeatherState(Default::default()), - copper_golem_state: CopperGolemState(Default::default()), + crit_arrow: CritArrow(false), + no_physics: NoPhysics(false), + pierce_level: PierceLevel(0), + in_ground: InGround(false), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct CowVariant(pub azalea_registry::data::ChickenVariant); +/// A metadata field for [Arrow]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct EffectColor(pub i32); +/// The marker component for entities of type `minecraft:arrow`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Arrow` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [EffectColor] +/// +/// # Parents +/// +/// Entities with `Arrow` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractArrow] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Cow; -impl Cow { +pub struct Arrow; +impl Arrow { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, - 17 => { - entity.insert(CowVariant(d.value.into_chicken_variant()?)); + 0..=10 => AbstractArrow::apply_metadata(entity, d)?, + 11 => { + entity.insert(EffectColor(d.value.into_int()?)); } _ => {} } @@ -2370,186 +2676,162 @@ impl Cow { } } +/// The metadata bundle for [Arrow]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct CowMetadataBundle { - _marker: Cow, - parent: AbstractAnimalMetadataBundle, - cow_variant: CowVariant, +pub struct ArrowMetadataBundle { + _marker: Arrow, + parent: AbstractArrowMetadataBundle, + effect_color: EffectColor, } -impl Default for CowMetadataBundle { +impl Default for ArrowMetadataBundle { fn default() -> Self { Self { - _marker: Cow, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - abstract_ageable_baby: AbstractAgeableBaby(false), + _marker: Arrow, + parent: AbstractArrowMetadataBundle { + _marker: AbstractArrow, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + crit_arrow: CritArrow(false), + no_physics: NoPhysics(false), + pierce_level: PierceLevel(0), + in_ground: InGround(false), }, - cow_variant: CowVariant(azalea_registry::data::ChickenVariant::new_raw(0)), + effect_color: EffectColor(-1), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct CanMove(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct IsActive(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct IsTearingDown(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct HomePos(pub Option); +/// The marker component for entities of type `minecraft:spectral_arrow`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `SpectralArrow` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractArrow] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Creaking; -impl Creaking { +pub struct SpectralArrow; +impl SpectralArrow { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractMonster::apply_metadata(entity, d)?, - 16 => { - entity.insert(CanMove(d.value.into_boolean()?)); - } - 17 => { - entity.insert(IsActive(d.value.into_boolean()?)); - } - 18 => { - entity.insert(IsTearingDown(d.value.into_boolean()?)); - } - 19 => { - entity.insert(HomePos(d.value.into_optional_block_pos()?)); - } + 0..=10 => AbstractArrow::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [SpectralArrow]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct CreakingMetadataBundle { - _marker: Creaking, - parent: AbstractMonsterMetadataBundle, - can_move: CanMove, - is_active: IsActive, - is_tearing_down: IsTearingDown, - home_pos: HomePos, +pub struct SpectralArrowMetadataBundle { + _marker: SpectralArrow, + parent: AbstractArrowMetadataBundle, } -impl Default for CreakingMetadataBundle { +impl Default for SpectralArrowMetadataBundle { fn default() -> Self { Self { - _marker: Creaking, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, + _marker: SpectralArrow, + parent: AbstractArrowMetadataBundle { + _marker: AbstractArrow, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + crit_arrow: CritArrow(false), + no_physics: NoPhysics(false), + pierce_level: PierceLevel(0), + in_ground: InGround(false), }, - can_move: CanMove(true), - is_active: IsActive(false), - is_tearing_down: IsTearingDown(false), - home_pos: HomePos(None), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct SwellDir(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct IsPowered(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct IsIgnited(pub bool); +/// A metadata field for [Trident]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Loyalty(pub u8); +/// A metadata field for [Trident]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Foil(pub bool); +/// The marker component for entities of type `minecraft:trident`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Trident` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [Loyalty] +/// - [Foil] +/// +/// # Parents +/// +/// Entities with `Trident` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractArrow] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Creeper; -impl Creeper { +pub struct Trident; +impl Trident { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractMonster::apply_metadata(entity, d)?, - 16 => { - entity.insert(SwellDir(d.value.into_int()?)); - } - 17 => { - entity.insert(IsPowered(d.value.into_boolean()?)); + 0..=10 => AbstractArrow::apply_metadata(entity, d)?, + 11 => { + entity.insert(Loyalty(d.value.into_byte()?)); } - 18 => { - entity.insert(IsIgnited(d.value.into_boolean()?)); + 12 => { + entity.insert(Foil(d.value.into_boolean()?)); } _ => {} } @@ -2557,197 +2839,431 @@ impl Creeper { } } +/// The metadata bundle for [Trident]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct CreeperMetadataBundle { - _marker: Creeper, - parent: AbstractMonsterMetadataBundle, - swell_dir: SwellDir, - is_powered: IsPowered, - is_ignited: IsIgnited, +pub struct TridentMetadataBundle { + _marker: Trident, + parent: AbstractArrowMetadataBundle, + loyalty: Loyalty, + foil: Foil, } -impl Default for CreeperMetadataBundle { +impl Default for TridentMetadataBundle { fn default() -> Self { Self { - _marker: Creeper, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, + _marker: Trident, + parent: AbstractArrowMetadataBundle { + _marker: AbstractArrow, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + crit_arrow: CritArrow(false), + no_physics: NoPhysics(false), + pierce_level: PierceLevel(0), + in_ground: InGround(false), }, - swell_dir: SwellDir(-1), - is_powered: IsPowered(false), - is_ignited: IsIgnited(false), + loyalty: Loyalty(0), + foil: Foil(false), } } } +/// A metadata field for [AbstractDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct TransformationInterpolationStartDeltaTicks(pub i32); +/// A metadata field for [AbstractDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct TransformationInterpolationDuration(pub i32); +/// A metadata field for [AbstractDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PosRotInterpolationDuration(pub i32); +/// A metadata field for [AbstractDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Translation(pub Vec3f32); +/// A metadata field for [AbstractDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Scale(pub Vec3f32); +/// A metadata field for [AbstractDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct LeftRotation(pub Quaternion); +/// A metadata field for [AbstractDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct RightRotation(pub Quaternion); +/// A metadata field for [AbstractDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct BillboardRenderConstraints(pub u8); +/// A metadata field for [AbstractDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct BrightnessOverride(pub i32); +/// A metadata field for [AbstractDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ViewRange(pub f32); +/// A metadata field for [AbstractDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ShadowRadius(pub f32); +/// A metadata field for [AbstractDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ShadowStrength(pub f32); +/// A metadata field for [AbstractDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct AbstractDisplayWidth(pub f32); +/// A metadata field for [AbstractDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct AbstractDisplayHeight(pub f32); +/// A metadata field for [AbstractDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct GlowColorOverride(pub i32); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// These are the metadata components that all `AbstractDisplay` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [TransformationInterpolationStartDeltaTicks] +/// - [TransformationInterpolationDuration] +/// - [PosRotInterpolationDuration] +/// - [Translation] +/// - [Scale] +/// - [LeftRotation] +/// - [RightRotation] +/// - [BillboardRenderConstraints] +/// - [BrightnessOverride] +/// - [ViewRange] +/// - [ShadowRadius] +/// - [ShadowStrength] +/// - [AbstractDisplayWidth] +/// - [AbstractDisplayHeight] +/// - [GlowColorOverride] +/// +/// # Parents +/// +/// Entities with `AbstractDisplay` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [BlockDisplay] +/// - [ItemDisplay] +/// - [TextDisplay] #[derive(Component)] -pub struct DarkOakBoat; -impl DarkOakBoat { +pub struct AbstractDisplay; +impl AbstractDisplay { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 8 => { + entity.insert(TransformationInterpolationStartDeltaTicks( + d.value.into_int()?, + )); + } + 9 => { + entity.insert(TransformationInterpolationDuration(d.value.into_int()?)); + } + 10 => { + entity.insert(PosRotInterpolationDuration(d.value.into_int()?)); + } + 11 => { + entity.insert(Translation(d.value.into_vector3()?)); + } + 12 => { + entity.insert(Scale(d.value.into_vector3()?)); + } + 13 => { + entity.insert(LeftRotation(d.value.into_quaternion()?)); + } + 14 => { + entity.insert(RightRotation(d.value.into_quaternion()?)); + } + 15 => { + entity.insert(BillboardRenderConstraints(d.value.into_byte()?)); + } + 16 => { + entity.insert(BrightnessOverride(d.value.into_int()?)); + } + 17 => { + entity.insert(ViewRange(d.value.into_float()?)); + } + 18 => { + entity.insert(ShadowRadius(d.value.into_float()?)); + } + 19 => { + entity.insert(ShadowStrength(d.value.into_float()?)); + } + 20 => { + entity.insert(AbstractDisplayWidth(d.value.into_float()?)); + } + 21 => { + entity.insert(AbstractDisplayHeight(d.value.into_float()?)); + } + 22 => { + entity.insert(GlowColorOverride(d.value.into_int()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [AbstractDisplay]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct DarkOakBoatMetadataBundle { - _marker: DarkOakBoat, - parent: AbstractBoatMetadataBundle, +pub struct AbstractDisplayMetadataBundle { + _marker: AbstractDisplay, + parent: AbstractEntityMetadataBundle, + transformation_interpolation_start_delta_ticks: TransformationInterpolationStartDeltaTicks, + transformation_interpolation_duration: TransformationInterpolationDuration, + pos_rot_interpolation_duration: PosRotInterpolationDuration, + translation: Translation, + scale: Scale, + left_rotation: LeftRotation, + right_rotation: RightRotation, + billboard_render_constraints: BillboardRenderConstraints, + brightness_override: BrightnessOverride, + view_range: ViewRange, + shadow_radius: ShadowRadius, + shadow_strength: ShadowStrength, + abstract_display_width: AbstractDisplayWidth, + abstract_display_height: AbstractDisplayHeight, + glow_color_override: GlowColorOverride, } -impl Default for DarkOakBoatMetadataBundle { +impl Default for AbstractDisplayMetadataBundle { fn default() -> Self { Self { - _marker: DarkOakBoat, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), - }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), + _marker: AbstractDisplay, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + transformation_interpolation_start_delta_ticks: + TransformationInterpolationStartDeltaTicks(0), + transformation_interpolation_duration: TransformationInterpolationDuration(0), + pos_rot_interpolation_duration: PosRotInterpolationDuration(0), + translation: Translation(Vec3f32 { + x: 0.0, + y: 0.0, + z: 0.0, + }), + scale: Scale(Vec3f32 { + x: 1.0, + y: 1.0, + z: 1.0, + }), + left_rotation: LeftRotation(Quaternion { + x: 0.0, + y: 0.0, + z: 0.0, + w: 1.0, + }), + right_rotation: RightRotation(Quaternion { + x: 0.0, + y: 0.0, + z: 0.0, + w: 1.0, + }), + billboard_render_constraints: BillboardRenderConstraints(Default::default()), + brightness_override: BrightnessOverride(-1), + view_range: ViewRange(1.0), + shadow_radius: ShadowRadius(0.0), + shadow_strength: ShadowStrength(1.0), + abstract_display_width: AbstractDisplayWidth(0.0), + abstract_display_height: AbstractDisplayHeight(0.0), + glow_color_override: GlowColorOverride(-1), } } } +/// A metadata field for [BlockDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct BlockDisplayBlockState(pub azalea_block::BlockState); +/// The marker component for entities of type `minecraft:block_display`. +/// +/// # Metadata +/// +/// These are the metadata components that all `BlockDisplay` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [BlockDisplayBlockState] +/// +/// # Parents +/// +/// Entities with `BlockDisplay` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractDisplay] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct DarkOakChestBoat; -impl DarkOakChestBoat { +pub struct BlockDisplay; +impl BlockDisplay { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + 0..=22 => AbstractDisplay::apply_metadata(entity, d)?, + 23 => { + entity.insert(BlockDisplayBlockState(d.value.into_block_state()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [BlockDisplay]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct DarkOakChestBoatMetadataBundle { - _marker: DarkOakChestBoat, - parent: AbstractBoatMetadataBundle, +pub struct BlockDisplayMetadataBundle { + _marker: BlockDisplay, + parent: AbstractDisplayMetadataBundle, + block_display_block_state: BlockDisplayBlockState, } -impl Default for DarkOakChestBoatMetadataBundle { +impl Default for BlockDisplayMetadataBundle { fn default() -> Self { Self { - _marker: DarkOakChestBoat, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), + _marker: BlockDisplay, + parent: AbstractDisplayMetadataBundle { + _marker: AbstractDisplay, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), + transformation_interpolation_start_delta_ticks: + TransformationInterpolationStartDeltaTicks(0), + transformation_interpolation_duration: TransformationInterpolationDuration(0), + pos_rot_interpolation_duration: PosRotInterpolationDuration(0), + translation: Translation(Vec3f32 { + x: 0.0, + y: 0.0, + z: 0.0, + }), + scale: Scale(Vec3f32 { + x: 1.0, + y: 1.0, + z: 1.0, + }), + left_rotation: LeftRotation(Quaternion { + x: 0.0, + y: 0.0, + z: 0.0, + w: 1.0, + }), + right_rotation: RightRotation(Quaternion { + x: 0.0, + y: 0.0, + z: 0.0, + w: 1.0, + }), + billboard_render_constraints: BillboardRenderConstraints(Default::default()), + brightness_override: BrightnessOverride(-1), + view_range: ViewRange(1.0), + shadow_radius: ShadowRadius(0.0), + shadow_strength: ShadowStrength(1.0), + abstract_display_width: AbstractDisplayWidth(0.0), + abstract_display_height: AbstractDisplayHeight(0.0), + glow_color_override: GlowColorOverride(-1), }, + block_display_block_state: BlockDisplayBlockState(Default::default()), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct GotFish(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct MoistnessLevel(pub i32); +/// A metadata field for [ItemDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ItemDisplayItemStack(pub ItemStack); +/// A metadata field for [ItemDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ItemDisplayItemDisplay(pub u8); +/// The marker component for entities of type `minecraft:item_display`. +/// +/// # Metadata +/// +/// These are the metadata components that all `ItemDisplay` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [ItemDisplayItemStack] +/// - [ItemDisplayItemDisplay] +/// +/// # Parents +/// +/// Entities with `ItemDisplay` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractDisplay] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Dolphin; -impl Dolphin { +pub struct ItemDisplay; +impl ItemDisplay { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAgeable::apply_metadata(entity, d)?, - 17 => { - entity.insert(GotFish(d.value.into_boolean()?)); + 0..=22 => AbstractDisplay::apply_metadata(entity, d)?, + 23 => { + entity.insert(ItemDisplayItemStack(d.value.into_item_stack()?)); } - 18 => { - entity.insert(MoistnessLevel(d.value.into_int()?)); + 24 => { + entity.insert(ItemDisplayItemDisplay(d.value.into_byte()?)); } _ => {} } @@ -2755,307 +3271,597 @@ impl Dolphin { } } +/// The metadata bundle for [ItemDisplay]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct DolphinMetadataBundle { - _marker: Dolphin, - parent: AbstractAgeableMetadataBundle, - got_fish: GotFish, - moistness_level: MoistnessLevel, +pub struct ItemDisplayMetadataBundle { + _marker: ItemDisplay, + parent: AbstractDisplayMetadataBundle, + item_display_item_stack: ItemDisplayItemStack, + item_display_item_display: ItemDisplayItemDisplay, } -impl Default for DolphinMetadataBundle { +impl Default for ItemDisplayMetadataBundle { fn default() -> Self { Self { - _marker: Dolphin, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - abstract_ageable_baby: AbstractAgeableBaby(false), - }, - got_fish: GotFish(false), - moistness_level: MoistnessLevel(2400), - } - } -} - -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Chest(pub bool); -#[derive(Component)] -pub struct Donkey; -impl Donkey { - pub fn apply_metadata( - entity: &mut bevy_ecs::system::EntityCommands, - d: EntityDataItem, - ) -> Result<(), UpdateMetadataError> { - match d.index { - 0..=18 => AbstractChestedHorse::apply_metadata(entity, d)?, - _ => {} - } - Ok(()) - } -} - -#[derive(Bundle)] -pub struct DonkeyMetadataBundle { - _marker: Donkey, - parent: AbstractChestedHorseMetadataBundle, -} -impl Default for DonkeyMetadataBundle { - fn default() -> Self { - Self { - _marker: Donkey, - parent: AbstractChestedHorseMetadataBundle { - _marker: AbstractChestedHorse, - parent: AbstractHorseMetadataBundle { - _marker: AbstractHorse, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: - AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible( - Default::default(), - ), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - abstract_ageable_baby: AbstractAgeableBaby(false), - }, - }, - tamed: Tamed(false), - eating: Eating(false), - abstract_horse_standing: AbstractHorseStanding(false), - bred: Bred(false), + _marker: ItemDisplay, + parent: AbstractDisplayMetadataBundle { + _marker: AbstractDisplay, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - chest: Chest(false), + transformation_interpolation_start_delta_ticks: + TransformationInterpolationStartDeltaTicks(0), + transformation_interpolation_duration: TransformationInterpolationDuration(0), + pos_rot_interpolation_duration: PosRotInterpolationDuration(0), + translation: Translation(Vec3f32 { + x: 0.0, + y: 0.0, + z: 0.0, + }), + scale: Scale(Vec3f32 { + x: 1.0, + y: 1.0, + z: 1.0, + }), + left_rotation: LeftRotation(Quaternion { + x: 0.0, + y: 0.0, + z: 0.0, + w: 1.0, + }), + right_rotation: RightRotation(Quaternion { + x: 0.0, + y: 0.0, + z: 0.0, + w: 1.0, + }), + billboard_render_constraints: BillboardRenderConstraints(Default::default()), + brightness_override: BrightnessOverride(-1), + view_range: ViewRange(1.0), + shadow_radius: ShadowRadius(0.0), + shadow_strength: ShadowStrength(1.0), + abstract_display_width: AbstractDisplayWidth(0.0), + abstract_display_height: AbstractDisplayHeight(0.0), + glow_color_override: GlowColorOverride(-1), }, + item_display_item_stack: ItemDisplayItemStack(Default::default()), + item_display_item_display: ItemDisplayItemDisplay(Default::default()), } } } +/// A metadata field for [TextDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Text(pub FormattedText); +/// A metadata field for [TextDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct LineWidth(pub i32); +/// A metadata field for [TextDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct BackgroundColor(pub i32); +/// A metadata field for [TextDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct TextOpacity(pub u8); +/// A metadata field for [TextDisplay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct StyleFlags(pub u8); +/// The marker component for entities of type `minecraft:text_display`. +/// +/// # Metadata +/// +/// These are the metadata components that all `TextDisplay` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [Text] +/// - [LineWidth] +/// - [BackgroundColor] +/// - [TextOpacity] +/// - [StyleFlags] +/// +/// # Parents +/// +/// Entities with `TextDisplay` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractDisplay] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct DragonFireball; -impl DragonFireball { +pub struct TextDisplay; +impl TextDisplay { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 0..=22 => AbstractDisplay::apply_metadata(entity, d)?, + 23 => { + entity.insert(Text(d.value.into_formatted_text()?)); + } + 24 => { + entity.insert(LineWidth(d.value.into_int()?)); + } + 25 => { + entity.insert(BackgroundColor(d.value.into_int()?)); + } + 26 => { + entity.insert(TextOpacity(d.value.into_byte()?)); + } + 27 => { + entity.insert(StyleFlags(d.value.into_byte()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [TextDisplay]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct DragonFireballMetadataBundle { - _marker: DragonFireball, - parent: AbstractEntityMetadataBundle, +pub struct TextDisplayMetadataBundle { + _marker: TextDisplay, + parent: AbstractDisplayMetadataBundle, + text: Text, + line_width: LineWidth, + background_color: BackgroundColor, + text_opacity: TextOpacity, + style_flags: StyleFlags, } -impl Default for DragonFireballMetadataBundle { +impl Default for TextDisplayMetadataBundle { fn default() -> Self { Self { - _marker: DragonFireball, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: TextDisplay, + parent: AbstractDisplayMetadataBundle { + _marker: AbstractDisplay, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + transformation_interpolation_start_delta_ticks: + TransformationInterpolationStartDeltaTicks(0), + transformation_interpolation_duration: TransformationInterpolationDuration(0), + pos_rot_interpolation_duration: PosRotInterpolationDuration(0), + translation: Translation(Vec3f32 { + x: 0.0, + y: 0.0, + z: 0.0, + }), + scale: Scale(Vec3f32 { + x: 1.0, + y: 1.0, + z: 1.0, + }), + left_rotation: LeftRotation(Quaternion { + x: 0.0, + y: 0.0, + z: 0.0, + w: 1.0, + }), + right_rotation: RightRotation(Quaternion { + x: 0.0, + y: 0.0, + z: 0.0, + w: 1.0, + }), + billboard_render_constraints: BillboardRenderConstraints(Default::default()), + brightness_override: BrightnessOverride(-1), + view_range: ViewRange(1.0), + shadow_radius: ShadowRadius(0.0), + shadow_strength: ShadowStrength(1.0), + abstract_display_width: AbstractDisplayWidth(0.0), + abstract_display_height: AbstractDisplayHeight(0.0), + glow_color_override: GlowColorOverride(-1), }, + text: Text(Default::default()), + line_width: LineWidth(200), + background_color: BackgroundColor(1073741824), + text_opacity: TextOpacity(127), + style_flags: StyleFlags(0), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ZombieBaby(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct SpecialType(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct DrownedConversion(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractLiving]. +pub struct AutoSpinAttack(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractLiving]. +pub struct AbstractLivingUsingItem(pub bool); +/// A metadata field for [AbstractLiving]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Health(pub f32); +/// A metadata field for [AbstractLiving]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct EffectParticles(pub Vec); +/// A metadata field for [AbstractLiving]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct EffectAmbience(pub bool); +/// A metadata field for [AbstractLiving]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ArrowCount(pub i32); +/// A metadata field for [AbstractLiving]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct StingerCount(pub i32); +/// A metadata field for [AbstractLiving]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct SleepingPos(pub Option); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// These are the metadata components that all `AbstractLiving` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [AutoSpinAttack] +/// - [AbstractLivingUsingItem] +/// - [Health] +/// - [EffectParticles] +/// - [EffectAmbience] +/// - [ArrowCount] +/// - [StingerCount] +/// - [SleepingPos] +/// +/// # Parents +/// +/// Entities with `AbstractLiving` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [ArmorStand] +/// - [AbstractAvatar] +/// - [Mannequin] +/// - [Player] +/// - [AbstractInsentient] +/// - [Bat] +/// - [EnderDragon] +/// - [Ghast] +/// - [Phantom] +/// - [Slime] +/// - [MagmaCube] +/// - [AbstractCreature] +/// - [Allay] +/// - [CopperGolem] +/// - [IronGolem] +/// - [Pufferfish] +/// - [Shulker] +/// - [SnowGolem] +/// - [Tadpole] +/// - [AbstractAgeable] +/// - [Dolphin] +/// - [Squid] +/// - [GlowSquid] +/// - [AbstractAnimal] +/// - [Armadillo] +/// - [Axolotl] +/// - [Bee] +/// - [Chicken] +/// - [Cow] +/// - [Fox] +/// - [Frog] +/// - [Goat] +/// - [HappyGhast] +/// - [Hoglin] +/// - [Mooshroom] +/// - [Ocelot] +/// - [Panda] +/// - [Pig] +/// - [PolarBear] +/// - [Rabbit] +/// - [Sheep] +/// - [Sniffer] +/// - [Strider] +/// - [Turtle] +/// - [AbstractHorse] +/// - [Camel] +/// - [CamelHusk] +/// - [Horse] +/// - [SkeletonHorse] +/// - [ZombieHorse] +/// - [AbstractChestedHorse] +/// - [Donkey] +/// - [Llama] +/// - [TraderLlama] +/// - [Mule] +/// - [AbstractTameable] +/// - [Cat] +/// - [Nautilus] +/// - [Parrot] +/// - [Wolf] +/// - [ZombieNautilus] +/// - [AbstractVillager] +/// - [Villager] +/// - [WanderingTrader] +/// - [AbstractFish] +/// - [Cod] +/// - [Salmon] +/// - [TropicalFish] +/// - [AbstractMonster] +/// - [Blaze] +/// - [Bogged] +/// - [Breeze] +/// - [Creaking] +/// - [Creeper] +/// - [Enderman] +/// - [Endermite] +/// - [Giant] +/// - [Guardian] +/// - [ElderGuardian] +/// - [Parched] +/// - [Silverfish] +/// - [Skeleton] +/// - [Spider] +/// - [CaveSpider] +/// - [Stray] +/// - [Vex] +/// - [Warden] +/// - [Wither] +/// - [WitherSkeleton] +/// - [Zoglin] +/// - [Zombie] +/// - [Drowned] +/// - [Husk] +/// - [ZombieVillager] +/// - [ZombifiedPiglin] +/// - [AbstractPiglin] +/// - [Piglin] +/// - [PiglinBrute] +/// - [AbstractRaider] +/// - [Pillager] +/// - [Ravager] +/// - [Vindicator] +/// - [Witch] +/// - [AbstractSpellcasterIllager] +/// - [Evoker] +/// - [Illusioner] #[derive(Component)] -pub struct Drowned; -impl Drowned { +pub struct AbstractLiving; +impl AbstractLiving { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=18 => Zombie::apply_metadata(entity, d)?, - _ => {} - } - Ok(()) - } -} - -#[derive(Bundle)] -pub struct DrownedMetadataBundle { - _marker: Drowned, - parent: ZombieMetadataBundle, -} -impl Default for DrownedMetadataBundle { - fn default() -> Self { - Self { - _marker: Drowned, - parent: ZombieMetadataBundle { - _marker: Zombie, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - }, - zombie_baby: ZombieBaby(false), - special_type: SpecialType(0), - drowned_conversion: DrownedConversion(false), + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 8 => { + let bitfield = d.value.into_byte()?; + entity.insert(AutoSpinAttack(bitfield & 0x4 != 0)); + entity.insert(AbstractLivingUsingItem(bitfield & 0x1 != 0)); + } + 9 => { + entity.insert(Health(d.value.into_float()?)); + } + 10 => { + entity.insert(EffectParticles(d.value.into_particles()?)); + } + 11 => { + entity.insert(EffectAmbience(d.value.into_boolean()?)); + } + 12 => { + entity.insert(ArrowCount(d.value.into_int()?)); + } + 13 => { + entity.insert(StingerCount(d.value.into_int()?)); + } + 14 => { + entity.insert(SleepingPos(d.value.into_optional_block_pos()?)); + } + _ => {} + } + Ok(()) + } +} + +/// The metadata bundle for [AbstractLiving]. +/// +/// This type should generally not be used directly. +#[derive(Bundle)] +pub struct AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle, + auto_spin_attack: AutoSpinAttack, + abstract_living_using_item: AbstractLivingUsingItem, + health: Health, + effect_particles: EffectParticles, + effect_ambience: EffectAmbience, + arrow_count: ArrowCount, + stinger_count: StingerCount, + sleeping_pos: SleepingPos, +} +impl Default for AbstractLivingMetadataBundle { + fn default() -> Self { + Self { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct AbstractThrownItemProjectileItemStack(pub ItemStack); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [ArmorStand]. +pub struct Small(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [ArmorStand]. +pub struct ShowArms(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [ArmorStand]. +pub struct ShowBasePlate(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [ArmorStand]. +pub struct ArmorStandMarker(pub bool); +/// A metadata field for [ArmorStand]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct HeadPose(pub Rotations); +/// A metadata field for [ArmorStand]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct BodyPose(pub Rotations); +/// A metadata field for [ArmorStand]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct LeftArmPose(pub Rotations); +/// A metadata field for [ArmorStand]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct RightArmPose(pub Rotations); +/// A metadata field for [ArmorStand]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct LeftLegPose(pub Rotations); +/// A metadata field for [ArmorStand]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct RightLegPose(pub Rotations); +/// The marker component for entities of type `minecraft:armor_stand`. +/// +/// # Metadata +/// +/// These are the metadata components that all `ArmorStand` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [Small] +/// - [ShowArms] +/// - [ShowBasePlate] +/// - [ArmorStandMarker] +/// - [HeadPose] +/// - [BodyPose] +/// - [LeftArmPose] +/// - [RightArmPose] +/// - [LeftLegPose] +/// - [RightLegPose] +/// +/// # Parents +/// +/// Entities with `ArmorStand` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Egg; -impl Egg { +pub struct ArmorStand; +impl ArmorStand { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?, + 0..=14 => AbstractLiving::apply_metadata(entity, d)?, + 15 => { + let bitfield = d.value.into_byte()?; + entity.insert(Small(bitfield & 0x1 != 0)); + entity.insert(ShowArms(bitfield & 0x4 != 0)); + entity.insert(ShowBasePlate(bitfield & 0x8 != 0)); + entity.insert(ArmorStandMarker(bitfield & 0x10 != 0)); + } + 16 => { + entity.insert(HeadPose(d.value.into_rotations()?)); + } + 17 => { + entity.insert(BodyPose(d.value.into_rotations()?)); + } + 18 => { + entity.insert(LeftArmPose(d.value.into_rotations()?)); + } + 19 => { + entity.insert(RightArmPose(d.value.into_rotations()?)); + } + 20 => { + entity.insert(LeftLegPose(d.value.into_rotations()?)); + } + 21 => { + entity.insert(RightLegPose(d.value.into_rotations()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [ArmorStand]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct EggMetadataBundle { - _marker: Egg, - parent: AbstractThrownItemProjectileMetadataBundle, +pub struct ArmorStandMetadataBundle { + _marker: ArmorStand, + parent: AbstractLivingMetadataBundle, + small: Small, + show_arms: ShowArms, + show_base_plate: ShowBasePlate, + armor_stand_marker: ArmorStandMarker, + head_pose: HeadPose, + body_pose: BodyPose, + left_arm_pose: LeftArmPose, + right_arm_pose: RightArmPose, + left_leg_pose: LeftLegPose, + right_leg_pose: RightLegPose, } -impl Default for EggMetadataBundle { +impl Default for ArmorStandMetadataBundle { fn default() -> Self { Self { - _marker: Egg, - parent: AbstractThrownItemProjectileMetadataBundle { - _marker: AbstractThrownItemProjectile, + _marker: ArmorStand, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, parent: AbstractEntityMetadataBundle { _marker: AbstractEntity, on_fire: OnFire(false), @@ -3073,111 +3879,177 @@ impl Default for EggMetadataBundle { pose: Pose::default(), ticks_frozen: TicksFrozen(Default::default()), }, - abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack( - Default::default(), - ), + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, + small: Small(false), + show_arms: ShowArms(false), + show_base_plate: ShowBasePlate(false), + armor_stand_marker: ArmorStandMarker(false), + head_pose: HeadPose(Default::default()), + body_pose: BodyPose(Default::default()), + left_arm_pose: LeftArmPose(Default::default()), + right_arm_pose: RightArmPose(Default::default()), + left_leg_pose: LeftLegPose(Default::default()), + right_leg_pose: RightLegPose(Default::default()), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Moving(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct AttackTarget(pub i32); +/// A metadata field for [AbstractAvatar]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PlayerMainHand(pub HumanoidArm); +/// A metadata field for [AbstractAvatar]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PlayerModeCustomisation(pub u8); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// These are the metadata components that all `AbstractAvatar` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [PlayerMainHand] +/// - [PlayerModeCustomisation] +/// +/// # Parents +/// +/// Entities with `AbstractAvatar` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [Mannequin] +/// - [Player] #[derive(Component)] -pub struct ElderGuardian; -impl ElderGuardian { +pub struct AbstractAvatar; +impl AbstractAvatar { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=17 => Guardian::apply_metadata(entity, d)?, + 0..=14 => AbstractLiving::apply_metadata(entity, d)?, + 15 => { + entity.insert(PlayerMainHand(d.value.into_humanoid_arm()?)); + } + 16 => { + entity.insert(PlayerModeCustomisation(d.value.into_byte()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [AbstractAvatar]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct ElderGuardianMetadataBundle { - _marker: ElderGuardian, - parent: GuardianMetadataBundle, +pub struct AbstractAvatarMetadataBundle { + _marker: AbstractAvatar, + parent: AbstractLivingMetadataBundle, + player_main_hand: PlayerMainHand, + player_mode_customisation: PlayerModeCustomisation, } -impl Default for ElderGuardianMetadataBundle { +impl Default for AbstractAvatarMetadataBundle { fn default() -> Self { Self { - _marker: ElderGuardian, - parent: GuardianMetadataBundle { - _marker: Guardian, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, + _marker: AbstractAvatar, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - moving: Moving(false), - attack_target: AttackTarget(0), + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, + player_main_hand: PlayerMainHand(Default::default()), + player_mode_customisation: PlayerModeCustomisation(0), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct BeamTarget(pub Option); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ShowBottom(pub bool); +/// A metadata field for [Mannequin]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Profile(pub components::Profile); +/// A metadata field for [Mannequin]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Immovable(pub bool); +/// A metadata field for [Mannequin]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Description(pub Option); +/// The marker component for entities of type `minecraft:mannequin`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Mannequin` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [Profile] +/// - [Immovable] +/// - [Description] +/// +/// # Parents +/// +/// Entities with `Mannequin` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractAvatar] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct EndCrystal; -impl EndCrystal { +pub struct Mannequin; +impl Mannequin { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, - ) -> Result<(), UpdateMetadataError> { - match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - 8 => { - entity.insert(BeamTarget(d.value.into_optional_block_pos()?)); + ) -> Result<(), UpdateMetadataError> { + match d.index { + 0..=16 => AbstractAvatar::apply_metadata(entity, d)?, + 17 => { + entity.insert(Profile(d.value.into_resolvable_profile()?)); } - 9 => { - entity.insert(ShowBottom(d.value.into_boolean()?)); + 18 => { + entity.insert(Immovable(d.value.into_boolean()?)); + } + 19 => { + entity.insert(Description(d.value.into_optional_formatted_text()?)); } _ => {} } @@ -3185,53 +4057,117 @@ impl EndCrystal { } } +/// The metadata bundle for [Mannequin]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct EndCrystalMetadataBundle { - _marker: EndCrystal, - parent: AbstractEntityMetadataBundle, - beam_target: BeamTarget, - show_bottom: ShowBottom, +pub struct MannequinMetadataBundle { + _marker: Mannequin, + parent: AbstractAvatarMetadataBundle, + profile: Profile, + immovable: Immovable, + description: Description, } -impl Default for EndCrystalMetadataBundle { +impl Default for MannequinMetadataBundle { fn default() -> Self { Self { - _marker: EndCrystal, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Mannequin, + parent: AbstractAvatarMetadataBundle { + _marker: AbstractAvatar, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + player_main_hand: PlayerMainHand(Default::default()), + player_mode_customisation: PlayerModeCustomisation(0), }, - beam_target: BeamTarget(None), - show_bottom: ShowBottom(true), + profile: Profile(Default::default()), + immovable: Immovable(false), + description: Description(Default::default()), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Phase(pub i32); +/// A metadata field for [Player]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PlayerAbsorption(pub f32); +/// A metadata field for [Player]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Score(pub i32); +/// A metadata field for [Player]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ShoulderParrotLeft(pub OptionalUnsignedInt); +/// A metadata field for [Player]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ShoulderParrotRight(pub OptionalUnsignedInt); +/// The marker component for entities of type `minecraft:player`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Player` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [PlayerAbsorption] +/// - [Score] +/// - [ShoulderParrotLeft] +/// - [ShoulderParrotRight] +/// +/// # Parents +/// +/// Entities with `Player` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractAvatar] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct EnderDragon; -impl EnderDragon { +pub struct Player; +impl Player { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractInsentient::apply_metadata(entity, d)?, - 16 => { - entity.insert(Phase(d.value.into_int()?)); + 0..=16 => AbstractAvatar::apply_metadata(entity, d)?, + 17 => { + entity.insert(PlayerAbsorption(d.value.into_float()?)); + } + 18 => { + entity.insert(Score(d.value.into_int()?)); + } + 19 => { + entity.insert(ShoulderParrotLeft(d.value.into_optional_unsigned_int()?)); + } + 20 => { + entity.insert(ShoulderParrotRight(d.value.into_optional_unsigned_int()?)); } _ => {} } @@ -3239,18 +4175,24 @@ impl EnderDragon { } } +/// The metadata bundle for [Player]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct EnderDragonMetadataBundle { - _marker: EnderDragon, - parent: AbstractInsentientMetadataBundle, - phase: Phase, +pub struct PlayerMetadataBundle { + _marker: Player, + parent: AbstractAvatarMetadataBundle, + player_absorption: PlayerAbsorption, + score: Score, + shoulder_parrot_left: ShoulderParrotLeft, + shoulder_parrot_right: ShoulderParrotRight, } -impl Default for EnderDragonMetadataBundle { +impl Default for PlayerMetadataBundle { fn default() -> Self { Self { - _marker: EnderDragon, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, + _marker: Player, + parent: AbstractAvatarMetadataBundle { + _marker: AbstractAvatar, parent: AbstractLivingMetadataBundle { _marker: AbstractLiving, parent: AbstractEntityMetadataBundle { @@ -3279,41 +4221,187 @@ impl Default for EnderDragonMetadataBundle { stinger_count: StingerCount(0), sleeping_pos: SleepingPos(None), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + player_main_hand: PlayerMainHand(Default::default()), + player_mode_customisation: PlayerModeCustomisation(0), }, - phase: Phase(Default::default()), + player_absorption: PlayerAbsorption(0.0), + score: Score(0), + shoulder_parrot_left: ShoulderParrotLeft(OptionalUnsignedInt(None)), + shoulder_parrot_right: ShoulderParrotRight(OptionalUnsignedInt(None)), } } } +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractInsentient]. +pub struct NoAi(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractInsentient]. +pub struct LeftHanded(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractInsentient]. +pub struct Aggressive(pub bool); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// These are the metadata components that all `AbstractInsentient` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [NoAi] +/// - [LeftHanded] +/// - [Aggressive] +/// +/// # Parents +/// +/// Entities with `AbstractInsentient` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [Bat] +/// - [EnderDragon] +/// - [Ghast] +/// - [Phantom] +/// - [Slime] +/// - [MagmaCube] +/// - [AbstractCreature] +/// - [Allay] +/// - [CopperGolem] +/// - [IronGolem] +/// - [Pufferfish] +/// - [Shulker] +/// - [SnowGolem] +/// - [Tadpole] +/// - [AbstractAgeable] +/// - [Dolphin] +/// - [Squid] +/// - [GlowSquid] +/// - [AbstractAnimal] +/// - [Armadillo] +/// - [Axolotl] +/// - [Bee] +/// - [Chicken] +/// - [Cow] +/// - [Fox] +/// - [Frog] +/// - [Goat] +/// - [HappyGhast] +/// - [Hoglin] +/// - [Mooshroom] +/// - [Ocelot] +/// - [Panda] +/// - [Pig] +/// - [PolarBear] +/// - [Rabbit] +/// - [Sheep] +/// - [Sniffer] +/// - [Strider] +/// - [Turtle] +/// - [AbstractHorse] +/// - [Camel] +/// - [CamelHusk] +/// - [Horse] +/// - [SkeletonHorse] +/// - [ZombieHorse] +/// - [AbstractChestedHorse] +/// - [Donkey] +/// - [Llama] +/// - [TraderLlama] +/// - [Mule] +/// - [AbstractTameable] +/// - [Cat] +/// - [Nautilus] +/// - [Parrot] +/// - [Wolf] +/// - [ZombieNautilus] +/// - [AbstractVillager] +/// - [Villager] +/// - [WanderingTrader] +/// - [AbstractFish] +/// - [Cod] +/// - [Salmon] +/// - [TropicalFish] +/// - [AbstractMonster] +/// - [Blaze] +/// - [Bogged] +/// - [Breeze] +/// - [Creaking] +/// - [Creeper] +/// - [Enderman] +/// - [Endermite] +/// - [Giant] +/// - [Guardian] +/// - [ElderGuardian] +/// - [Parched] +/// - [Silverfish] +/// - [Skeleton] +/// - [Spider] +/// - [CaveSpider] +/// - [Stray] +/// - [Vex] +/// - [Warden] +/// - [Wither] +/// - [WitherSkeleton] +/// - [Zoglin] +/// - [Zombie] +/// - [Drowned] +/// - [Husk] +/// - [ZombieVillager] +/// - [ZombifiedPiglin] +/// - [AbstractPiglin] +/// - [Piglin] +/// - [PiglinBrute] +/// - [AbstractRaider] +/// - [Pillager] +/// - [Ravager] +/// - [Vindicator] +/// - [Witch] +/// - [AbstractSpellcasterIllager] +/// - [Evoker] +/// - [Illusioner] #[derive(Component)] -pub struct EnderPearl; -impl EnderPearl { +pub struct AbstractInsentient; +impl AbstractInsentient { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?, + 0..=14 => AbstractLiving::apply_metadata(entity, d)?, + 15 => { + let bitfield = d.value.into_byte()?; + entity.insert(NoAi(bitfield & 0x1 != 0)); + entity.insert(LeftHanded(bitfield & 0x2 != 0)); + entity.insert(Aggressive(bitfield & 0x4 != 0)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [AbstractInsentient]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct EnderPearlMetadataBundle { - _marker: EnderPearl, - parent: AbstractThrownItemProjectileMetadataBundle, +pub struct AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle, + no_ai: NoAi, + left_handed: LeftHanded, + aggressive: Aggressive, } -impl Default for EnderPearlMetadataBundle { +impl Default for AbstractInsentientMetadataBundle { fn default() -> Self { Self { - _marker: EnderPearl, - parent: AbstractThrownItemProjectileMetadataBundle { - _marker: AbstractThrownItemProjectile, + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, parent: AbstractEntityMetadataBundle { _marker: AbstractEntity, on_fire: OnFire(false), @@ -3331,466 +4419,803 @@ impl Default for EnderPearlMetadataBundle { pose: Pose::default(), ticks_frozen: TicksFrozen(Default::default()), }, - abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack( - Default::default(), - ), + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct CarryState(pub azalea_block::BlockState); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Creepy(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct StaredAt(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [Bat]. +pub struct Resting(pub bool); +/// The marker component for entities of type `minecraft:bat`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Bat` entities are guaranteed to +/// have, in addition to the metadata components from parent types: +/// +/// - [Resting] +/// +/// # Parents +/// +/// Entities with `Bat` will also have the following marker components and their +/// metadata fields: +/// +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Enderman; -impl Enderman { +pub struct Bat; +impl Bat { pub fn apply_metadata( - entity: &mut bevy_ecs::system::EntityCommands, - d: EntityDataItem, - ) -> Result<(), UpdateMetadataError> { - match d.index { - 0..=15 => AbstractMonster::apply_metadata(entity, d)?, - 16 => { - entity.insert(CarryState(d.value.into_optional_block_state()?)); - } - 17 => { - entity.insert(Creepy(d.value.into_boolean()?)); - } - 18 => { - entity.insert(StaredAt(d.value.into_boolean()?)); - } - _ => {} - } - Ok(()) - } -} - -#[derive(Bundle)] -pub struct EndermanMetadataBundle { - _marker: Enderman, - parent: AbstractMonsterMetadataBundle, - carry_state: CarryState, - creepy: Creepy, - stared_at: StaredAt, -} -impl Default for EndermanMetadataBundle { - fn default() -> Self { - Self { - _marker: Enderman, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + entity: &mut bevy_ecs::system::EntityCommands, + d: EntityDataItem, + ) -> Result<(), UpdateMetadataError> { + match d.index { + 0..=15 => AbstractInsentient::apply_metadata(entity, d)?, + 16 => { + let bitfield = d.value.into_byte()?; + entity.insert(Resting(bitfield & 0x1 != 0)); + } + _ => {} + } + Ok(()) + } +} + +/// The metadata bundle for [Bat]. +/// +/// This type should generally not be used directly. +#[derive(Bundle)] +pub struct BatMetadataBundle { + _marker: Bat, + parent: AbstractInsentientMetadataBundle, + resting: Resting, +} +impl Default for BatMetadataBundle { + fn default() -> Self { + Self { + _marker: Bat, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - carry_state: CarryState(azalea_block::BlockState::AIR), - creepy: Creepy(false), - stared_at: StaredAt(false), + resting: Resting(false), } } } +/// A metadata field for [EnderDragon]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Phase(pub i32); +/// The marker component for entities of type `minecraft:ender_dragon`. +/// +/// # Metadata +/// +/// These are the metadata components that all `EnderDragon` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [Phase] +/// +/// # Parents +/// +/// Entities with `EnderDragon` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Endermite; -impl Endermite { +pub struct EnderDragon; +impl EnderDragon { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractMonster::apply_metadata(entity, d)?, + 0..=15 => AbstractInsentient::apply_metadata(entity, d)?, + 16 => { + entity.insert(Phase(d.value.into_int()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [EnderDragon]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct EndermiteMetadataBundle { - _marker: Endermite, - parent: AbstractMonsterMetadataBundle, +pub struct EnderDragonMetadataBundle { + _marker: EnderDragon, + parent: AbstractInsentientMetadataBundle, + phase: Phase, } -impl Default for EndermiteMetadataBundle { +impl Default for EnderDragonMetadataBundle { fn default() -> Self { Self { - _marker: Endermite, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + _marker: EnderDragon, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, + phase: Phase(Default::default()), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct IsCelebrating(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct SpellCasting(pub u8); +/// A metadata field for [Ghast]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct IsCharging(pub bool); +/// The marker component for entities of type `minecraft:ghast`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Ghast` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [IsCharging] +/// +/// # Parents +/// +/// Entities with `Ghast` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Evoker; -impl Evoker { +pub struct Ghast; +impl Ghast { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=17 => AbstractSpellcasterIllager::apply_metadata(entity, d)?, + 0..=15 => AbstractInsentient::apply_metadata(entity, d)?, + 16 => { + entity.insert(IsCharging(d.value.into_boolean()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Ghast]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct EvokerMetadataBundle { - _marker: Evoker, - parent: AbstractSpellcasterIllagerMetadataBundle, +pub struct GhastMetadataBundle { + _marker: Ghast, + parent: AbstractInsentientMetadataBundle, + is_charging: IsCharging, } -impl Default for EvokerMetadataBundle { +impl Default for GhastMetadataBundle { fn default() -> Self { Self { - _marker: Evoker, - parent: AbstractSpellcasterIllagerMetadataBundle { - _marker: AbstractSpellcasterIllager, - parent: AbstractRaiderMetadataBundle { - _marker: AbstractRaider, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, + _marker: Ghast, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - is_celebrating: IsCelebrating(false), + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, - spell_casting: SpellCasting(0), + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, + is_charging: IsCharging(false), } } } -#[derive(Component)] -pub struct EvokerFangs; -impl EvokerFangs { +/// A metadata field for [Phantom]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PhantomSize(pub i32); +/// The marker component for entities of type `minecraft:phantom`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Phantom` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [PhantomSize] +/// +/// # Parents +/// +/// Entities with `Phantom` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. +#[derive(Component)] +pub struct Phantom; +impl Phantom { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 0..=15 => AbstractInsentient::apply_metadata(entity, d)?, + 16 => { + entity.insert(PhantomSize(d.value.into_int()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Phantom]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct EvokerFangsMetadataBundle { - _marker: EvokerFangs, - parent: AbstractEntityMetadataBundle, +pub struct PhantomMetadataBundle { + _marker: Phantom, + parent: AbstractInsentientMetadataBundle, + phantom_size: PhantomSize, } -impl Default for EvokerFangsMetadataBundle { +impl Default for PhantomMetadataBundle { fn default() -> Self { Self { - _marker: EvokerFangs, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Phantom, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, + phantom_size: PhantomSize(0), } } } +/// A metadata field for [Slime]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct SlimeSize(pub i32); +/// The marker component for entities of type `minecraft:slime`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Slime` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [SlimeSize] +/// +/// # Parents +/// +/// Entities with `Slime` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [MagmaCube] #[derive(Component)] -pub struct ExperienceBottle; -impl ExperienceBottle { +pub struct Slime; +impl Slime { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?, + 0..=15 => AbstractInsentient::apply_metadata(entity, d)?, + 16 => { + entity.insert(SlimeSize(d.value.into_int()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Slime]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct ExperienceBottleMetadataBundle { - _marker: ExperienceBottle, - parent: AbstractThrownItemProjectileMetadataBundle, +pub struct SlimeMetadataBundle { + _marker: Slime, + parent: AbstractInsentientMetadataBundle, + slime_size: SlimeSize, } -impl Default for ExperienceBottleMetadataBundle { +impl Default for SlimeMetadataBundle { fn default() -> Self { Self { - _marker: ExperienceBottle, - parent: AbstractThrownItemProjectileMetadataBundle { - _marker: AbstractThrownItemProjectile, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Slime, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, - abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack( - Default::default(), - ), + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, + slime_size: SlimeSize(1), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Value(pub i32); +/// The marker component for entities of type `minecraft:magma_cube`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `MagmaCube` will also have the following marker components and +/// their metadata fields: +/// +/// - [Slime] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct ExperienceOrb; -impl ExperienceOrb { +pub struct MagmaCube; +impl MagmaCube { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - 8 => { - entity.insert(Value(d.value.into_int()?)); - } + 0..=16 => Slime::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [MagmaCube]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct ExperienceOrbMetadataBundle { - _marker: ExperienceOrb, - parent: AbstractEntityMetadataBundle, - value: Value, +pub struct MagmaCubeMetadataBundle { + _marker: MagmaCube, + parent: SlimeMetadataBundle, } -impl Default for ExperienceOrbMetadataBundle { +impl Default for MagmaCubeMetadataBundle { fn default() -> Self { Self { - _marker: ExperienceOrb, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: MagmaCube, + parent: SlimeMetadataBundle { + _marker: Slime, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + slime_size: SlimeSize(1), }, - value: Value(0), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct EyeOfEnderItemStack(pub ItemStack); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `AbstractCreature` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [Allay] +/// - [CopperGolem] +/// - [IronGolem] +/// - [Pufferfish] +/// - [Shulker] +/// - [SnowGolem] +/// - [Tadpole] +/// - [AbstractAgeable] +/// - [Dolphin] +/// - [Squid] +/// - [GlowSquid] +/// - [AbstractAnimal] +/// - [Armadillo] +/// - [Axolotl] +/// - [Bee] +/// - [Chicken] +/// - [Cow] +/// - [Fox] +/// - [Frog] +/// - [Goat] +/// - [HappyGhast] +/// - [Hoglin] +/// - [Mooshroom] +/// - [Ocelot] +/// - [Panda] +/// - [Pig] +/// - [PolarBear] +/// - [Rabbit] +/// - [Sheep] +/// - [Sniffer] +/// - [Strider] +/// - [Turtle] +/// - [AbstractHorse] +/// - [Camel] +/// - [CamelHusk] +/// - [Horse] +/// - [SkeletonHorse] +/// - [ZombieHorse] +/// - [AbstractChestedHorse] +/// - [Donkey] +/// - [Llama] +/// - [TraderLlama] +/// - [Mule] +/// - [AbstractTameable] +/// - [Cat] +/// - [Nautilus] +/// - [Parrot] +/// - [Wolf] +/// - [ZombieNautilus] +/// - [AbstractVillager] +/// - [Villager] +/// - [WanderingTrader] +/// - [AbstractFish] +/// - [Cod] +/// - [Salmon] +/// - [TropicalFish] +/// - [AbstractMonster] +/// - [Blaze] +/// - [Bogged] +/// - [Breeze] +/// - [Creaking] +/// - [Creeper] +/// - [Enderman] +/// - [Endermite] +/// - [Giant] +/// - [Guardian] +/// - [ElderGuardian] +/// - [Parched] +/// - [Silverfish] +/// - [Skeleton] +/// - [Spider] +/// - [CaveSpider] +/// - [Stray] +/// - [Vex] +/// - [Warden] +/// - [Wither] +/// - [WitherSkeleton] +/// - [Zoglin] +/// - [Zombie] +/// - [Drowned] +/// - [Husk] +/// - [ZombieVillager] +/// - [ZombifiedPiglin] +/// - [AbstractPiglin] +/// - [Piglin] +/// - [PiglinBrute] +/// - [AbstractRaider] +/// - [Pillager] +/// - [Ravager] +/// - [Vindicator] +/// - [Witch] +/// - [AbstractSpellcasterIllager] +/// - [Evoker] +/// - [Illusioner] #[derive(Component)] -pub struct EyeOfEnder; -impl EyeOfEnder { +pub struct AbstractCreature; +impl AbstractCreature { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - 8 => { - entity.insert(EyeOfEnderItemStack(d.value.into_item_stack()?)); - } + 0..=15 => AbstractInsentient::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [AbstractCreature]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct EyeOfEnderMetadataBundle { - _marker: EyeOfEnder, - parent: AbstractEntityMetadataBundle, - eye_of_ender_item_stack: EyeOfEnderItemStack, +pub struct AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle, } -impl Default for EyeOfEnderMetadataBundle { +impl Default for AbstractCreatureMetadataBundle { fn default() -> Self { - Self { - _marker: EyeOfEnder, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + Self { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - eye_of_ender_item_stack: EyeOfEnderItemStack(Default::default()), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct StartPos(pub BlockPos); +/// A metadata field for [Allay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Dancing(pub bool); +/// A metadata field for [Allay]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct CanDuplicate(pub bool); +/// The marker component for entities of type `minecraft:allay`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Allay` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [Dancing] +/// - [CanDuplicate] +/// +/// # Parents +/// +/// Entities with `Allay` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct FallingBlock; -impl FallingBlock { +pub struct Allay; +impl Allay { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - 8 => { - entity.insert(StartPos(d.value.into_block_pos()?)); + 0..=15 => AbstractCreature::apply_metadata(entity, d)?, + 16 => { + entity.insert(Dancing(d.value.into_boolean()?)); + } + 17 => { + entity.insert(CanDuplicate(d.value.into_boolean()?)); } _ => {} } @@ -3798,51 +5223,107 @@ impl FallingBlock { } } +/// The metadata bundle for [Allay]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct FallingBlockMetadataBundle { - _marker: FallingBlock, - parent: AbstractEntityMetadataBundle, - start_pos: StartPos, +pub struct AllayMetadataBundle { + _marker: Allay, + parent: AbstractCreatureMetadataBundle, + dancing: Dancing, + can_duplicate: CanDuplicate, } -impl Default for FallingBlockMetadataBundle { +impl Default for AllayMetadataBundle { fn default() -> Self { Self { - _marker: FallingBlock, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Allay, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, }, - start_pos: StartPos(BlockPos::new(0, 0, 0)), + dancing: Dancing(false), + can_duplicate: CanDuplicate(true), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct FireballItemStack(pub ItemStack); +/// A metadata field for [CopperGolem]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct WeatherState(pub WeatheringCopperStateKind); +/// A metadata field for [CopperGolem]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct CopperGolemState(pub CopperGolemStateKind); +/// The marker component for entities of type `minecraft:copper_golem`. +/// +/// # Metadata +/// +/// These are the metadata components that all `CopperGolem` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [WeatherState] +/// - [CopperGolemState] +/// +/// # Parents +/// +/// Entities with `CopperGolem` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Fireball; -impl Fireball { +pub struct CopperGolem; +impl CopperGolem { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - 8 => { - entity.insert(FireballItemStack(d.value.into_item_stack()?)); + 0..=15 => AbstractCreature::apply_metadata(entity, d)?, + 16 => { + entity.insert(WeatherState(d.value.into_weathering_copper_state()?)); + } + 17 => { + entity.insert(CopperGolemState(d.value.into_copper_golem_state()?)); } _ => {} } @@ -3850,61 +5331,101 @@ impl Fireball { } } +/// The metadata bundle for [CopperGolem]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct FireballMetadataBundle { - _marker: Fireball, - parent: AbstractEntityMetadataBundle, - fireball_item_stack: FireballItemStack, +pub struct CopperGolemMetadataBundle { + _marker: CopperGolem, + parent: AbstractCreatureMetadataBundle, + weather_state: WeatherState, + copper_golem_state: CopperGolemState, } -impl Default for FireballMetadataBundle { +impl Default for CopperGolemMetadataBundle { fn default() -> Self { Self { - _marker: Fireball, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: CopperGolem, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, }, - fireball_item_stack: FireballItemStack(Default::default()), + weather_state: WeatherState(Default::default()), + copper_golem_state: CopperGolemState(Default::default()), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct FireworksItem(pub ItemStack); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct AttachedToTarget(pub OptionalUnsignedInt); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ShotAtAngle(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [IronGolem]. +pub struct PlayerCreated(pub bool); +/// The marker component for entities of type `minecraft:iron_golem`. +/// +/// # Metadata +/// +/// These are the metadata components that all `IronGolem` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [PlayerCreated] +/// +/// # Parents +/// +/// Entities with `IronGolem` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct FireworkRocket; -impl FireworkRocket { +pub struct IronGolem; +impl IronGolem { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - 8 => { - entity.insert(FireworksItem(d.value.into_item_stack()?)); - } - 9 => { - entity.insert(AttachedToTarget(d.value.into_optional_unsigned_int()?)); - } - 10 => { - entity.insert(ShotAtAngle(d.value.into_boolean()?)); + 0..=15 => AbstractCreature::apply_metadata(entity, d)?, + 16 => { + let bitfield = d.value.into_byte()?; + entity.insert(PlayerCreated(bitfield & 0x1 != 0)); } _ => {} } @@ -3912,60 +5433,105 @@ impl FireworkRocket { } } +/// The metadata bundle for [IronGolem]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct FireworkRocketMetadataBundle { - _marker: FireworkRocket, - parent: AbstractEntityMetadataBundle, - fireworks_item: FireworksItem, - attached_to_target: AttachedToTarget, - shot_at_angle: ShotAtAngle, +pub struct IronGolemMetadataBundle { + _marker: IronGolem, + parent: AbstractCreatureMetadataBundle, + player_created: PlayerCreated, } -impl Default for FireworkRocketMetadataBundle { +impl Default for IronGolemMetadataBundle { fn default() -> Self { Self { - _marker: FireworkRocket, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: IronGolem, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, }, - fireworks_item: FireworksItem(Default::default()), - attached_to_target: AttachedToTarget(OptionalUnsignedInt(None)), - shot_at_angle: ShotAtAngle(false), + player_created: PlayerCreated(false), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct HookedEntity(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Biting(pub bool); +/// A metadata field for [Pufferfish]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PufferfishFromBucket(pub bool); +/// A metadata field for [Pufferfish]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PuffState(pub i32); +/// The marker component for entities of type `minecraft:pufferfish`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Pufferfish` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [PufferfishFromBucket] +/// - [PuffState] +/// +/// # Parents +/// +/// Entities with `Pufferfish` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct FishingBobber; -impl FishingBobber { +pub struct Pufferfish; +impl Pufferfish { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - 8 => { - entity.insert(HookedEntity(d.value.into_int()?)); + 0..=15 => AbstractCreature::apply_metadata(entity, d)?, + 16 => { + entity.insert(PufferfishFromBucket(d.value.into_boolean()?)); } - 9 => { - entity.insert(Biting(d.value.into_boolean()?)); + 17 => { + entity.insert(PuffState(d.value.into_int()?)); } _ => {} } @@ -3973,87 +5539,113 @@ impl FishingBobber { } } +/// The metadata bundle for [Pufferfish]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct FishingBobberMetadataBundle { - _marker: FishingBobber, - parent: AbstractEntityMetadataBundle, - hooked_entity: HookedEntity, - biting: Biting, +pub struct PufferfishMetadataBundle { + _marker: Pufferfish, + parent: AbstractCreatureMetadataBundle, + pufferfish_from_bucket: PufferfishFromBucket, + puff_state: PuffState, } -impl Default for FishingBobberMetadataBundle { +impl Default for PufferfishMetadataBundle { fn default() -> Self { Self { - _marker: FishingBobber, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Pufferfish, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, }, - hooked_entity: HookedEntity(0), - biting: Biting(false), + pufferfish_from_bucket: PufferfishFromBucket(false), + puff_state: PuffState(0), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct FoxKind(pub i32); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct FoxSitting(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct Faceplanted(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct Defending(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct Sleeping(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct Pouncing(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct FoxCrouching(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct FoxInterested(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct TrustedId0(pub Option); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct TrustedId1(pub Option); +/// A metadata field for [Shulker]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct AttachFace(pub Direction); +/// A metadata field for [Shulker]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Peek(pub u8); +/// A metadata field for [Shulker]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Color(pub u8); +/// The marker component for entities of type `minecraft:shulker`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Shulker` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [AttachFace] +/// - [Peek] +/// - [Color] +/// +/// # Parents +/// +/// Entities with `Shulker` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Fox; -impl Fox { +pub struct Shulker; +impl Shulker { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, + 0..=15 => AbstractCreature::apply_metadata(entity, d)?, + 16 => { + entity.insert(AttachFace(d.value.into_direction()?)); + } 17 => { - entity.insert(FoxKind(d.value.into_int()?)); + entity.insert(Peek(d.value.into_byte()?)); } 18 => { - let bitfield = d.value.into_byte()?; - entity.insert(FoxSitting(bitfield & 0x1 != 0)); - entity.insert(Faceplanted(bitfield & 0x40 != 0)); - entity.insert(Defending(bitfield & 0x80 != 0)); - entity.insert(Sleeping(bitfield & 0x20 != 0)); - entity.insert(Pouncing(bitfield & 0x10 != 0)); - entity.insert(FoxCrouching(bitfield & 0x4 != 0)); - entity.insert(FoxInterested(bitfield & 0x8 != 0)); - } - 19 => { - entity.insert(TrustedId0(d.value.into_optional_living_entity_reference()?)); - } - 20 => { - entity.insert(TrustedId1(d.value.into_optional_living_entity_reference()?)); + entity.insert(Color(d.value.into_byte()?)); } _ => {} } @@ -4061,103 +5653,103 @@ impl Fox { } } +/// The metadata bundle for [Shulker]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct FoxMetadataBundle { - _marker: Fox, - parent: AbstractAnimalMetadataBundle, - fox_kind: FoxKind, - fox_sitting: FoxSitting, - faceplanted: Faceplanted, - defending: Defending, - sleeping: Sleeping, - pouncing: Pouncing, - fox_crouching: FoxCrouching, - fox_interested: FoxInterested, - trusted_id_0: TrustedId0, - trusted_id_1: TrustedId1, +pub struct ShulkerMetadataBundle { + _marker: Shulker, + parent: AbstractCreatureMetadataBundle, + attach_face: AttachFace, + peek: Peek, + color: Color, } -impl Default for FoxMetadataBundle { +impl Default for ShulkerMetadataBundle { fn default() -> Self { Self { - _marker: Fox, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + _marker: Shulker, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, - abstract_ageable_baby: AbstractAgeableBaby(false), + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, }, - fox_kind: FoxKind(Default::default()), - fox_sitting: FoxSitting(false), - faceplanted: Faceplanted(false), - defending: Defending(false), - sleeping: Sleeping(false), - pouncing: Pouncing(false), - fox_crouching: FoxCrouching(false), - fox_interested: FoxInterested(false), - trusted_id_0: TrustedId0(None), - trusted_id_1: TrustedId1(None), + attach_face: AttachFace(Default::default()), + peek: Peek(0), + color: Color(16), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct FrogVariant(pub azalea_registry::data::WolfSoundVariant); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct TongueTarget(pub OptionalUnsignedInt); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [SnowGolem]. +pub struct HasPumpkin(pub bool); +/// The marker component for entities of type `minecraft:snow_golem`. +/// +/// # Metadata +/// +/// These are the metadata components that all `SnowGolem` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [HasPumpkin] +/// +/// # Parents +/// +/// Entities with `SnowGolem` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Frog; -impl Frog { +pub struct SnowGolem; +impl SnowGolem { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, - 17 => { - entity.insert(FrogVariant(d.value.into_wolf_sound_variant()?)); - } - 18 => { - entity.insert(TongueTarget(d.value.into_optional_unsigned_int()?)); + 0..=15 => AbstractCreature::apply_metadata(entity, d)?, + 16 => { + let bitfield = d.value.into_byte()?; + entity.insert(HasPumpkin(bitfield & 0x10 != 0)); } _ => {} } @@ -4165,82 +5757,97 @@ impl Frog { } } +/// The metadata bundle for [SnowGolem]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct FrogMetadataBundle { - _marker: Frog, - parent: AbstractAnimalMetadataBundle, - frog_variant: FrogVariant, - tongue_target: TongueTarget, +pub struct SnowGolemMetadataBundle { + _marker: SnowGolem, + parent: AbstractCreatureMetadataBundle, + has_pumpkin: HasPumpkin, } -impl Default for FrogMetadataBundle { +impl Default for SnowGolemMetadataBundle { fn default() -> Self { Self { - _marker: Frog, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + _marker: SnowGolem, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, - abstract_ageable_baby: AbstractAgeableBaby(false), + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, }, - frog_variant: FrogVariant(azalea_registry::data::WolfSoundVariant::new_raw(0)), - tongue_target: TongueTarget(OptionalUnsignedInt(None)), + has_pumpkin: HasPumpkin(true), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Fuel(pub bool); +/// A metadata field for [Tadpole]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct TadpoleFromBucket(pub bool); +/// The marker component for entities of type `minecraft:tadpole`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Tadpole` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [TadpoleFromBucket] +/// +/// # Parents +/// +/// Entities with `Tadpole` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct FurnaceMinecart; -impl FurnaceMinecart { +pub struct Tadpole; +impl Tadpole { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=12 => AbstractMinecart::apply_metadata(entity, d)?, - 13 => { - entity.insert(Fuel(d.value.into_boolean()?)); + 0..=15 => AbstractCreature::apply_metadata(entity, d)?, + 16 => { + entity.insert(TadpoleFromBucket(d.value.into_boolean()?)); } _ => {} } @@ -4248,62 +5855,141 @@ impl FurnaceMinecart { } } +/// The metadata bundle for [Tadpole]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct FurnaceMinecartMetadataBundle { - _marker: FurnaceMinecart, - parent: AbstractMinecartMetadataBundle, - fuel: Fuel, +pub struct TadpoleMetadataBundle { + _marker: Tadpole, + parent: AbstractCreatureMetadataBundle, + tadpole_from_bucket: TadpoleFromBucket, } -impl Default for FurnaceMinecartMetadataBundle { +impl Default for TadpoleMetadataBundle { fn default() -> Self { Self { - _marker: FurnaceMinecart, - parent: AbstractMinecartMetadataBundle { - _marker: AbstractMinecart, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Tadpole, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR), - display_offset: DisplayOffset(Default::default()), }, - fuel: Fuel(false), + tadpole_from_bucket: TadpoleFromBucket(false), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct IsCharging(pub bool); +/// A metadata field for [AbstractAgeable]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct AbstractAgeableBaby(pub bool); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// These are the metadata components that all `AbstractAgeable` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [AbstractAgeableBaby] +/// +/// # Parents +/// +/// Entities with `AbstractAgeable` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [Dolphin] +/// - [Squid] +/// - [GlowSquid] +/// - [AbstractAnimal] +/// - [Armadillo] +/// - [Axolotl] +/// - [Bee] +/// - [Chicken] +/// - [Cow] +/// - [Fox] +/// - [Frog] +/// - [Goat] +/// - [HappyGhast] +/// - [Hoglin] +/// - [Mooshroom] +/// - [Ocelot] +/// - [Panda] +/// - [Pig] +/// - [PolarBear] +/// - [Rabbit] +/// - [Sheep] +/// - [Sniffer] +/// - [Strider] +/// - [Turtle] +/// - [AbstractHorse] +/// - [Camel] +/// - [CamelHusk] +/// - [Horse] +/// - [SkeletonHorse] +/// - [ZombieHorse] +/// - [AbstractChestedHorse] +/// - [Donkey] +/// - [Llama] +/// - [TraderLlama] +/// - [Mule] +/// - [AbstractTameable] +/// - [Cat] +/// - [Nautilus] +/// - [Parrot] +/// - [Wolf] +/// - [ZombieNautilus] +/// - [AbstractVillager] +/// - [Villager] +/// - [WanderingTrader] #[derive(Component)] -pub struct Ghast; -impl Ghast { +pub struct AbstractAgeable; +impl AbstractAgeable { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractInsentient::apply_metadata(entity, d)?, + 0..=15 => AbstractCreature::apply_metadata(entity, d)?, 16 => { - entity.insert(IsCharging(d.value.into_boolean()?)); + entity.insert(AbstractAgeableBaby(d.value.into_boolean()?)); } _ => {} } @@ -4311,81 +5997,128 @@ impl Ghast { } } +/// The metadata bundle for [AbstractAgeable]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct GhastMetadataBundle { - _marker: Ghast, - parent: AbstractInsentientMetadataBundle, - is_charging: IsCharging, -} -impl Default for GhastMetadataBundle { - fn default() -> Self { - Self { - _marker: Ghast, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), +pub struct AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle, + abstract_ageable_baby: AbstractAgeableBaby, +} +impl Default for AbstractAgeableMetadataBundle { + fn default() -> Self { + Self { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), }, - is_charging: IsCharging(false), + abstract_ageable_baby: AbstractAgeableBaby(false), } } } +/// A metadata field for [Dolphin]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct GotFish(pub bool); +/// A metadata field for [Dolphin]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct MoistnessLevel(pub i32); +/// The marker component for entities of type `minecraft:dolphin`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Dolphin` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [GotFish] +/// - [MoistnessLevel] +/// +/// # Parents +/// +/// Entities with `Dolphin` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Giant; -impl Giant { +pub struct Dolphin; +impl Dolphin { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractMonster::apply_metadata(entity, d)?, + 0..=16 => AbstractAgeable::apply_metadata(entity, d)?, + 17 => { + entity.insert(GotFish(d.value.into_boolean()?)); + } + 18 => { + entity.insert(MoistnessLevel(d.value.into_int()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Dolphin]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct GiantMetadataBundle { - _marker: Giant, - parent: AbstractMonsterMetadataBundle, +pub struct DolphinMetadataBundle { + _marker: Dolphin, + parent: AbstractAgeableMetadataBundle, + got_fish: GotFish, + moistness_level: MoistnessLevel, } -impl Default for GiantMetadataBundle { +impl Default for DolphinMetadataBundle { fn default() -> Self { Self { - _marker: Giant, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, + _marker: Dolphin, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, parent: AbstractCreatureMetadataBundle { _marker: AbstractCreature, parent: AbstractInsentientMetadataBundle { @@ -4423,70 +6156,135 @@ impl Default for GiantMetadataBundle { aggressive: Aggressive(false), }, }, + abstract_ageable_baby: AbstractAgeableBaby(false), }, + got_fish: GotFish(false), + moistness_level: MoistnessLevel(2400), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ItemFrameDirection(pub Direction); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ItemFrameItem(pub ItemStack); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Rotation(pub i32); +/// The marker component for entities of type `minecraft:squid`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Squid` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [GlowSquid] #[derive(Component)] -pub struct GlowItemFrame; -impl GlowItemFrame { +pub struct Squid; +impl Squid { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=10 => ItemFrame::apply_metadata(entity, d)?, + 0..=16 => AbstractAgeable::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [Squid]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct GlowItemFrameMetadataBundle { - _marker: GlowItemFrame, - parent: ItemFrameMetadataBundle, +pub struct SquidMetadataBundle { + _marker: Squid, + parent: AbstractAgeableMetadataBundle, } -impl Default for GlowItemFrameMetadataBundle { +impl Default for SquidMetadataBundle { fn default() -> Self { Self { - _marker: GlowItemFrame, - parent: ItemFrameMetadataBundle { - _marker: ItemFrame, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Squid, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, }, - item_frame_direction: ItemFrameDirection(Default::default()), - item_frame_item: ItemFrameItem(Default::default()), - rotation: Rotation(0), + abstract_ageable_baby: AbstractAgeableBaby(false), }, } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] +/// A metadata field for [GlowSquid]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] pub struct DarkTicksRemaining(pub i32); +/// The marker component for entities of type `minecraft:glow_squid`. +/// +/// # Metadata +/// +/// These are the metadata components that all `GlowSquid` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [DarkTicksRemaining] +/// +/// # Parents +/// +/// Entities with `GlowSquid` will also have the following marker components and +/// their metadata fields: +/// +/// - [Squid] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] pub struct GlowSquid; impl GlowSquid { @@ -4505,111 +6303,21 @@ impl GlowSquid { } } +/// The metadata bundle for [GlowSquid]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] pub struct GlowSquidMetadataBundle { _marker: GlowSquid, parent: SquidMetadataBundle, dark_ticks_remaining: DarkTicksRemaining, } -impl Default for GlowSquidMetadataBundle { - fn default() -> Self { - Self { - _marker: GlowSquid, - parent: SquidMetadataBundle { - _marker: Squid, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - abstract_ageable_baby: AbstractAgeableBaby(false), - }, - }, - dark_ticks_remaining: DarkTicksRemaining(0), - } - } -} - -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct IsScreamingGoat(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct HasLeftHorn(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct HasRightHorn(pub bool); -#[derive(Component)] -pub struct Goat; -impl Goat { - pub fn apply_metadata( - entity: &mut bevy_ecs::system::EntityCommands, - d: EntityDataItem, - ) -> Result<(), UpdateMetadataError> { - match d.index { - 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, - 17 => { - entity.insert(IsScreamingGoat(d.value.into_boolean()?)); - } - 18 => { - entity.insert(HasLeftHorn(d.value.into_boolean()?)); - } - 19 => { - entity.insert(HasRightHorn(d.value.into_boolean()?)); - } - _ => {} - } - Ok(()) - } -} - -#[derive(Bundle)] -pub struct GoatMetadataBundle { - _marker: Goat, - parent: AbstractAnimalMetadataBundle, - is_screaming_goat: IsScreamingGoat, - has_left_horn: HasLeftHorn, - has_right_horn: HasRightHorn, -} -impl Default for GoatMetadataBundle { +impl Default for GlowSquidMetadataBundle { fn default() -> Self { Self { - _marker: Goat, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, + _marker: GlowSquid, + parent: SquidMetadataBundle { + _marker: Squid, parent: AbstractAgeableMetadataBundle { _marker: AbstractAgeable, parent: AbstractCreatureMetadataBundle { @@ -4654,47 +6362,97 @@ impl Default for GoatMetadataBundle { abstract_ageable_baby: AbstractAgeableBaby(false), }, }, - is_screaming_goat: IsScreamingGoat(false), - has_left_horn: HasLeftHorn(true), - has_right_horn: HasRightHorn(true), + dark_ticks_remaining: DarkTicksRemaining(0), } } } +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `AbstractAnimal` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [Armadillo] +/// - [Axolotl] +/// - [Bee] +/// - [Chicken] +/// - [Cow] +/// - [Fox] +/// - [Frog] +/// - [Goat] +/// - [HappyGhast] +/// - [Hoglin] +/// - [Mooshroom] +/// - [Ocelot] +/// - [Panda] +/// - [Pig] +/// - [PolarBear] +/// - [Rabbit] +/// - [Sheep] +/// - [Sniffer] +/// - [Strider] +/// - [Turtle] +/// - [AbstractHorse] +/// - [Camel] +/// - [CamelHusk] +/// - [Horse] +/// - [SkeletonHorse] +/// - [ZombieHorse] +/// - [AbstractChestedHorse] +/// - [Donkey] +/// - [Llama] +/// - [TraderLlama] +/// - [Mule] +/// - [AbstractTameable] +/// - [Cat] +/// - [Nautilus] +/// - [Parrot] +/// - [Wolf] +/// - [ZombieNautilus] #[derive(Component)] -pub struct Guardian; -impl Guardian { +pub struct AbstractAnimal; +impl AbstractAnimal { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractMonster::apply_metadata(entity, d)?, - 16 => { - entity.insert(Moving(d.value.into_boolean()?)); - } - 17 => { - entity.insert(AttackTarget(d.value.into_int()?)); - } + 0..=16 => AbstractAgeable::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [AbstractAnimal]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct GuardianMetadataBundle { - _marker: Guardian, - parent: AbstractMonsterMetadataBundle, - moving: Moving, - attack_target: AttackTarget, +pub struct AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle, } -impl Default for GuardianMetadataBundle { +impl Default for AbstractAnimalMetadataBundle { fn default() -> Self { Self { - _marker: Guardian, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, parent: AbstractCreatureMetadataBundle { _marker: AbstractCreature, parent: AbstractInsentientMetadataBundle { @@ -4732,20 +6490,43 @@ impl Default for GuardianMetadataBundle { aggressive: Aggressive(false), }, }, + abstract_ageable_baby: AbstractAgeableBaby(false), }, - moving: Moving(false), - attack_target: AttackTarget(0), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct IsLeashHolder(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct StaysStill(pub bool); +/// A metadata field for [Armadillo]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ArmadilloState(pub ArmadilloStateKind); +/// The marker component for entities of type `minecraft:armadillo`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Armadillo` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [ArmadilloState] +/// +/// # Parents +/// +/// Entities with `Armadillo` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct HappyGhast; -impl HappyGhast { +pub struct Armadillo; +impl Armadillo { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, @@ -4753,10 +6534,7 @@ impl HappyGhast { match d.index { 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, 17 => { - entity.insert(IsLeashHolder(d.value.into_boolean()?)); - } - 18 => { - entity.insert(StaysStill(d.value.into_boolean()?)); + entity.insert(ArmadilloState(d.value.into_armadillo_state()?)); } _ => {} } @@ -4764,17 +6542,19 @@ impl HappyGhast { } } +/// The metadata bundle for [Armadillo]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct HappyGhastMetadataBundle { - _marker: HappyGhast, +pub struct ArmadilloMetadataBundle { + _marker: Armadillo, parent: AbstractAnimalMetadataBundle, - is_leash_holder: IsLeashHolder, - stays_still: StaysStill, + armadillo_state: ArmadilloState, } -impl Default for HappyGhastMetadataBundle { +impl Default for ArmadilloMetadataBundle { fn default() -> Self { Self { - _marker: HappyGhast, + _marker: Armadillo, parent: AbstractAnimalMetadataBundle { _marker: AbstractAnimal, parent: AbstractAgeableMetadataBundle { @@ -4821,17 +6601,49 @@ impl Default for HappyGhastMetadataBundle { abstract_ageable_baby: AbstractAgeableBaby(false), }, }, - is_leash_holder: IsLeashHolder(false), - stays_still: StaysStill(false), + armadillo_state: ArmadilloState(Default::default()), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct HoglinImmuneToZombification(pub bool); +/// A metadata field for [Axolotl]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct AxolotlVariant(pub i32); +/// A metadata field for [Axolotl]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PlayingDead(pub bool); +/// A metadata field for [Axolotl]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct AxolotlFromBucket(pub bool); +/// The marker component for entities of type `minecraft:axolotl`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Axolotl` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [AxolotlVariant] +/// - [PlayingDead] +/// - [AxolotlFromBucket] +/// +/// # Parents +/// +/// Entities with `Axolotl` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Hoglin; -impl Hoglin { +pub struct Axolotl; +impl Axolotl { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, @@ -4839,7 +6651,13 @@ impl Hoglin { match d.index { 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, 17 => { - entity.insert(HoglinImmuneToZombification(d.value.into_boolean()?)); + entity.insert(AxolotlVariant(d.value.into_int()?)); + } + 18 => { + entity.insert(PlayingDead(d.value.into_boolean()?)); + } + 19 => { + entity.insert(AxolotlFromBucket(d.value.into_boolean()?)); } _ => {} } @@ -4847,16 +6665,21 @@ impl Hoglin { } } +/// The metadata bundle for [Axolotl]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct HoglinMetadataBundle { - _marker: Hoglin, +pub struct AxolotlMetadataBundle { + _marker: Axolotl, parent: AbstractAnimalMetadataBundle, - hoglin_immune_to_zombification: HoglinImmuneToZombification, + axolotl_variant: AxolotlVariant, + playing_dead: PlayingDead, + axolotl_from_bucket: AxolotlFromBucket, } -impl Default for HoglinMetadataBundle { +impl Default for AxolotlMetadataBundle { fn default() -> Self { Self { - _marker: Hoglin, + _marker: Axolotl, parent: AbstractAnimalMetadataBundle { _marker: AbstractAnimal, parent: AbstractAgeableMetadataBundle { @@ -4903,183 +6726,96 @@ impl Default for HoglinMetadataBundle { abstract_ageable_baby: AbstractAgeableBaby(false), }, }, - hoglin_immune_to_zombification: HoglinImmuneToZombification(false), - } - } -} - -#[derive(Component)] -pub struct HopperMinecart; -impl HopperMinecart { - pub fn apply_metadata( - entity: &mut bevy_ecs::system::EntityCommands, - d: EntityDataItem, - ) -> Result<(), UpdateMetadataError> { - match d.index { - 0..=12 => AbstractMinecart::apply_metadata(entity, d)?, - _ => {} - } - Ok(()) - } -} - -#[derive(Bundle)] -pub struct HopperMinecartMetadataBundle { - _marker: HopperMinecart, - parent: AbstractMinecartMetadataBundle, -} -impl Default for HopperMinecartMetadataBundle { - fn default() -> Self { - Self { - _marker: HopperMinecart, - parent: AbstractMinecartMetadataBundle { - _marker: AbstractMinecart, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), - }, - custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR), - display_offset: DisplayOffset(Default::default()), - }, - } - } -} - -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct HorseTypeVariant(pub i32); -#[derive(Component)] -pub struct Horse; -impl Horse { - pub fn apply_metadata( - entity: &mut bevy_ecs::system::EntityCommands, - d: EntityDataItem, - ) -> Result<(), UpdateMetadataError> { - match d.index { - 0..=17 => AbstractHorse::apply_metadata(entity, d)?, - 18 => { - entity.insert(HorseTypeVariant(d.value.into_int()?)); - } - _ => {} - } - Ok(()) - } -} - -#[derive(Bundle)] -pub struct HorseMetadataBundle { - _marker: Horse, - parent: AbstractHorseMetadataBundle, - horse_type_variant: HorseTypeVariant, -} -impl Default for HorseMetadataBundle { - fn default() -> Self { - Self { - _marker: Horse, - parent: AbstractHorseMetadataBundle { - _marker: AbstractHorse, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - abstract_ageable_baby: AbstractAgeableBaby(false), - }, - }, - tamed: Tamed(false), - eating: Eating(false), - abstract_horse_standing: AbstractHorseStanding(false), - bred: Bred(false), - }, - horse_type_variant: HorseTypeVariant(0), + axolotl_variant: AxolotlVariant(0), + playing_dead: PlayingDead(false), + axolotl_from_bucket: AxolotlFromBucket(false), } } } +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [Bee]. +pub struct HasNectar(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [Bee]. +pub struct HasStung(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [Bee]. +pub struct BeeRolling(pub bool); +/// A metadata field for [Bee]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct BeeAngerEndTime(pub i64); +/// The marker component for entities of type `minecraft:bee`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Bee` entities are guaranteed to +/// have, in addition to the metadata components from parent types: +/// +/// - [HasNectar] +/// - [HasStung] +/// - [BeeRolling] +/// - [BeeAngerEndTime] +/// +/// # Parents +/// +/// Entities with `Bee` will also have the following marker components and their +/// metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Husk; -impl Husk { +pub struct Bee; +impl Bee { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=18 => Zombie::apply_metadata(entity, d)?, + 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, + 17 => { + let bitfield = d.value.into_byte()?; + entity.insert(HasNectar(bitfield & 0x8 != 0)); + entity.insert(HasStung(bitfield & 0x4 != 0)); + entity.insert(BeeRolling(bitfield & 0x2 != 0)); + } + 18 => { + entity.insert(BeeAngerEndTime(d.value.into_long()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Bee]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct HuskMetadataBundle { - _marker: Husk, - parent: ZombieMetadataBundle, +pub struct BeeMetadataBundle { + _marker: Bee, + parent: AbstractAnimalMetadataBundle, + has_nectar: HasNectar, + has_stung: HasStung, + bee_rolling: BeeRolling, + bee_anger_end_time: BeeAngerEndTime, } -impl Default for HuskMetadataBundle { +impl Default for BeeMetadataBundle { fn default() -> Self { Self { - _marker: Husk, - parent: ZombieMetadataBundle { - _marker: Zombie, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, + _marker: Bee, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, parent: AbstractCreatureMetadataBundle { _marker: AbstractCreature, parent: AbstractInsentientMetadataBundle { @@ -5119,173 +6855,164 @@ impl Default for HuskMetadataBundle { aggressive: Aggressive(false), }, }, + abstract_ageable_baby: AbstractAgeableBaby(false), }, - zombie_baby: ZombieBaby(false), - special_type: SpecialType(0), - drowned_conversion: DrownedConversion(false), }, + has_nectar: HasNectar(false), + has_stung: HasStung(false), + bee_rolling: BeeRolling(false), + bee_anger_end_time: BeeAngerEndTime(-1), } } } +/// A metadata field for [Chicken]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ChickenVariant(pub azalea_registry::data::PigVariant); +/// The marker component for entities of type `minecraft:chicken`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Chicken` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [ChickenVariant] +/// +/// # Parents +/// +/// Entities with `Chicken` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Illusioner; -impl Illusioner { +pub struct Chicken; +impl Chicken { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=17 => AbstractSpellcasterIllager::apply_metadata(entity, d)?, + 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, + 17 => { + entity.insert(ChickenVariant(d.value.into_pig_variant()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Chicken]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct IllusionerMetadataBundle { - _marker: Illusioner, - parent: AbstractSpellcasterIllagerMetadataBundle, +pub struct ChickenMetadataBundle { + _marker: Chicken, + parent: AbstractAnimalMetadataBundle, + chicken_variant: ChickenVariant, } -impl Default for IllusionerMetadataBundle { +impl Default for ChickenMetadataBundle { fn default() -> Self { Self { - _marker: Illusioner, - parent: AbstractSpellcasterIllagerMetadataBundle { - _marker: AbstractSpellcasterIllager, - parent: AbstractRaiderMetadataBundle { - _marker: AbstractRaider, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + _marker: Chicken, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, }, - is_celebrating: IsCelebrating(false), + abstract_ageable_baby: AbstractAgeableBaby(false), }, - spell_casting: SpellCasting(0), - }, - } - } -} - -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct InteractionWidth(pub f32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct InteractionHeight(pub f32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Response(pub bool); -#[derive(Component)] -pub struct Interaction; -impl Interaction { - pub fn apply_metadata( - entity: &mut bevy_ecs::system::EntityCommands, - d: EntityDataItem, - ) -> Result<(), UpdateMetadataError> { - match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - 8 => { - entity.insert(InteractionWidth(d.value.into_float()?)); - } - 9 => { - entity.insert(InteractionHeight(d.value.into_float()?)); - } - 10 => { - entity.insert(Response(d.value.into_boolean()?)); - } - _ => {} - } - Ok(()) - } -} - -#[derive(Bundle)] -pub struct InteractionMetadataBundle { - _marker: Interaction, - parent: AbstractEntityMetadataBundle, - interaction_width: InteractionWidth, - interaction_height: InteractionHeight, - response: Response, -} -impl Default for InteractionMetadataBundle { - fn default() -> Self { - Self { - _marker: Interaction, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), }, - interaction_width: InteractionWidth(1.0), - interaction_height: InteractionHeight(1.0), - response: Response(false), + chicken_variant: ChickenVariant(azalea_registry::data::PigVariant::new_raw(0)), } } } -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct PlayerCreated(pub bool); +/// A metadata field for [Cow]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct CowVariant(pub azalea_registry::data::ChickenVariant); +/// The marker component for entities of type `minecraft:cow`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Cow` entities are guaranteed to +/// have, in addition to the metadata components from parent types: +/// +/// - [CowVariant] +/// +/// # Parents +/// +/// Entities with `Cow` will also have the following marker components and their +/// metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct IronGolem; -impl IronGolem { +pub struct Cow; +impl Cow { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractCreature::apply_metadata(entity, d)?, - 16 => { - let bitfield = d.value.into_byte()?; - entity.insert(PlayerCreated(bitfield & 0x1 != 0)); + 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, + 17 => { + entity.insert(CowVariant(d.value.into_chicken_variant()?)); } _ => {} } @@ -5293,71 +7020,160 @@ impl IronGolem { } } +/// The metadata bundle for [Cow]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct IronGolemMetadataBundle { - _marker: IronGolem, - parent: AbstractCreatureMetadataBundle, - player_created: PlayerCreated, +pub struct CowMetadataBundle { + _marker: Cow, + parent: AbstractAnimalMetadataBundle, + cow_variant: CowVariant, } -impl Default for IronGolemMetadataBundle { +impl Default for CowMetadataBundle { fn default() -> Self { Self { - _marker: IronGolem, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Cow, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + abstract_ageable_baby: AbstractAgeableBaby(false), }, }, - player_created: PlayerCreated(false), + cow_variant: CowVariant(azalea_registry::data::ChickenVariant::new_raw(0)), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ItemItem(pub ItemStack); +/// A metadata field for [Fox]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct FoxKind(pub i32); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [Fox]. +pub struct FoxSitting(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [Fox]. +pub struct Faceplanted(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [Fox]. +pub struct Defending(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [Fox]. +pub struct Sleeping(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [Fox]. +pub struct Pouncing(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [Fox]. +pub struct FoxCrouching(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [Fox]. +pub struct FoxInterested(pub bool); +/// A metadata field for [Fox]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct TrustedId0(pub Option); +/// A metadata field for [Fox]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct TrustedId1(pub Option); +/// The marker component for entities of type `minecraft:fox`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Fox` entities are guaranteed to +/// have, in addition to the metadata components from parent types: +/// +/// - [FoxKind] +/// - [FoxSitting] +/// - [Faceplanted] +/// - [Defending] +/// - [Sleeping] +/// - [Pouncing] +/// - [FoxCrouching] +/// - [FoxInterested] +/// - [TrustedId0] +/// - [TrustedId1] +/// +/// # Parents +/// +/// Entities with `Fox` will also have the following marker components and their +/// metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Item; -impl Item { +pub struct Fox; +impl Fox { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - 8 => { - entity.insert(ItemItem(d.value.into_item_stack()?)); + 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, + 17 => { + entity.insert(FoxKind(d.value.into_int()?)); + } + 18 => { + let bitfield = d.value.into_byte()?; + entity.insert(FoxSitting(bitfield & 0x1 != 0)); + entity.insert(Faceplanted(bitfield & 0x40 != 0)); + entity.insert(Defending(bitfield & 0x80 != 0)); + entity.insert(Sleeping(bitfield & 0x20 != 0)); + entity.insert(Pouncing(bitfield & 0x10 != 0)); + entity.insert(FoxCrouching(bitfield & 0x4 != 0)); + entity.insert(FoxInterested(bitfield & 0x8 != 0)); + } + 19 => { + entity.insert(TrustedId0(d.value.into_optional_living_entity_reference()?)); + } + 20 => { + entity.insert(TrustedId1(d.value.into_optional_living_entity_reference()?)); } _ => {} } @@ -5365,56 +7181,133 @@ impl Item { } } +/// The metadata bundle for [Fox]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct ItemMetadataBundle { - _marker: Item, - parent: AbstractEntityMetadataBundle, - item_item: ItemItem, +pub struct FoxMetadataBundle { + _marker: Fox, + parent: AbstractAnimalMetadataBundle, + fox_kind: FoxKind, + fox_sitting: FoxSitting, + faceplanted: Faceplanted, + defending: Defending, + sleeping: Sleeping, + pouncing: Pouncing, + fox_crouching: FoxCrouching, + fox_interested: FoxInterested, + trusted_id_0: TrustedId0, + trusted_id_1: TrustedId1, } -impl Default for ItemMetadataBundle { +impl Default for FoxMetadataBundle { fn default() -> Self { Self { - _marker: Item, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Fox, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + abstract_ageable_baby: AbstractAgeableBaby(false), + }, }, - item_item: ItemItem(Default::default()), + fox_kind: FoxKind(Default::default()), + fox_sitting: FoxSitting(false), + faceplanted: Faceplanted(false), + defending: Defending(false), + sleeping: Sleeping(false), + pouncing: Pouncing(false), + fox_crouching: FoxCrouching(false), + fox_interested: FoxInterested(false), + trusted_id_0: TrustedId0(None), + trusted_id_1: TrustedId1(None), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ItemDisplayItemStack(pub ItemStack); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ItemDisplayItemDisplay(pub u8); +/// A metadata field for [Frog]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct FrogVariant(pub azalea_registry::data::WolfSoundVariant); +/// A metadata field for [Frog]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct TongueTarget(pub OptionalUnsignedInt); +/// The marker component for entities of type `minecraft:frog`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Frog` entities are guaranteed to +/// have, in addition to the metadata components from parent types: +/// +/// - [FrogVariant] +/// - [TongueTarget] +/// +/// # Parents +/// +/// Entities with `Frog` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct ItemDisplay; -impl ItemDisplay { +pub struct Frog; +impl Frog { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=22 => AbstractDisplay::apply_metadata(entity, d)?, - 23 => { - entity.insert(ItemDisplayItemStack(d.value.into_item_stack()?)); + 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, + 17 => { + entity.insert(FrogVariant(d.value.into_wolf_sound_variant()?)); } - 24 => { - entity.insert(ItemDisplayItemDisplay(d.value.into_byte()?)); + 18 => { + entity.insert(TongueTarget(d.value.into_optional_unsigned_int()?)); } _ => {} } @@ -5422,94 +7315,124 @@ impl ItemDisplay { } } +/// The metadata bundle for [Frog]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct ItemDisplayMetadataBundle { - _marker: ItemDisplay, - parent: AbstractDisplayMetadataBundle, - item_display_item_stack: ItemDisplayItemStack, - item_display_item_display: ItemDisplayItemDisplay, +pub struct FrogMetadataBundle { + _marker: Frog, + parent: AbstractAnimalMetadataBundle, + frog_variant: FrogVariant, + tongue_target: TongueTarget, } -impl Default for ItemDisplayMetadataBundle { +impl Default for FrogMetadataBundle { fn default() -> Self { Self { - _marker: ItemDisplay, - parent: AbstractDisplayMetadataBundle { - _marker: AbstractDisplay, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Frog, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + abstract_ageable_baby: AbstractAgeableBaby(false), }, - transformation_interpolation_start_delta_ticks: - TransformationInterpolationStartDeltaTicks(0), - transformation_interpolation_duration: TransformationInterpolationDuration(0), - pos_rot_interpolation_duration: PosRotInterpolationDuration(0), - translation: Translation(Vec3f32 { - x: 0.0, - y: 0.0, - z: 0.0, - }), - scale: Scale(Vec3f32 { - x: 1.0, - y: 1.0, - z: 1.0, - }), - left_rotation: LeftRotation(Quaternion { - x: 0.0, - y: 0.0, - z: 0.0, - w: 1.0, - }), - right_rotation: RightRotation(Quaternion { - x: 0.0, - y: 0.0, - z: 0.0, - w: 1.0, - }), - billboard_render_constraints: BillboardRenderConstraints(Default::default()), - brightness_override: BrightnessOverride(-1), - view_range: ViewRange(1.0), - shadow_radius: ShadowRadius(0.0), - shadow_strength: ShadowStrength(1.0), - abstract_display_width: AbstractDisplayWidth(0.0), - abstract_display_height: AbstractDisplayHeight(0.0), - glow_color_override: GlowColorOverride(-1), }, - item_display_item_stack: ItemDisplayItemStack(Default::default()), - item_display_item_display: ItemDisplayItemDisplay(Default::default()), + frog_variant: FrogVariant(azalea_registry::data::WolfSoundVariant::new_raw(0)), + tongue_target: TongueTarget(OptionalUnsignedInt(None)), } } } +/// A metadata field for [Goat]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct IsScreamingGoat(pub bool); +/// A metadata field for [Goat]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct HasLeftHorn(pub bool); +/// A metadata field for [Goat]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct HasRightHorn(pub bool); +/// The marker component for entities of type `minecraft:goat`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Goat` entities are guaranteed to +/// have, in addition to the metadata components from parent types: +/// +/// - [IsScreamingGoat] +/// - [HasLeftHorn] +/// - [HasRightHorn] +/// +/// # Parents +/// +/// Entities with `Goat` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct ItemFrame; -impl ItemFrame { +pub struct Goat; +impl Goat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - 8 => { - entity.insert(ItemFrameDirection(d.value.into_direction()?)); + 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, + 17 => { + entity.insert(IsScreamingGoat(d.value.into_boolean()?)); } - 9 => { - entity.insert(ItemFrameItem(d.value.into_item_stack()?)); + 18 => { + entity.insert(HasLeftHorn(d.value.into_boolean()?)); } - 10 => { - entity.insert(Rotation(d.value.into_int()?)); + 19 => { + entity.insert(HasRightHorn(d.value.into_boolean()?)); } _ => {} } @@ -5517,315 +7440,742 @@ impl ItemFrame { } } +/// The metadata bundle for [Goat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct ItemFrameMetadataBundle { - _marker: ItemFrame, - parent: AbstractEntityMetadataBundle, - item_frame_direction: ItemFrameDirection, - item_frame_item: ItemFrameItem, - rotation: Rotation, +pub struct GoatMetadataBundle { + _marker: Goat, + parent: AbstractAnimalMetadataBundle, + is_screaming_goat: IsScreamingGoat, + has_left_horn: HasLeftHorn, + has_right_horn: HasRightHorn, } -impl Default for ItemFrameMetadataBundle { +impl Default for GoatMetadataBundle { fn default() -> Self { Self { - _marker: ItemFrame, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Goat, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + abstract_ageable_baby: AbstractAgeableBaby(false), + }, }, - item_frame_direction: ItemFrameDirection(Default::default()), - item_frame_item: ItemFrameItem(Default::default()), - rotation: Rotation(0), + is_screaming_goat: IsScreamingGoat(false), + has_left_horn: HasLeftHorn(true), + has_right_horn: HasRightHorn(true), } } } +/// A metadata field for [HappyGhast]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct IsLeashHolder(pub bool); +/// A metadata field for [HappyGhast]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct StaysStill(pub bool); +/// The marker component for entities of type `minecraft:happy_ghast`. +/// +/// # Metadata +/// +/// These are the metadata components that all `HappyGhast` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [IsLeashHolder] +/// - [StaysStill] +/// +/// # Parents +/// +/// Entities with `HappyGhast` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct JungleBoat; -impl JungleBoat { +pub struct HappyGhast; +impl HappyGhast { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, + 17 => { + entity.insert(IsLeashHolder(d.value.into_boolean()?)); + } + 18 => { + entity.insert(StaysStill(d.value.into_boolean()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [HappyGhast]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct JungleBoatMetadataBundle { - _marker: JungleBoat, - parent: AbstractBoatMetadataBundle, +pub struct HappyGhastMetadataBundle { + _marker: HappyGhast, + parent: AbstractAnimalMetadataBundle, + is_leash_holder: IsLeashHolder, + stays_still: StaysStill, } -impl Default for JungleBoatMetadataBundle { +impl Default for HappyGhastMetadataBundle { fn default() -> Self { Self { - _marker: JungleBoat, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: HappyGhast, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), + abstract_ageable_baby: AbstractAgeableBaby(false), }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), }, + is_leash_holder: IsLeashHolder(false), + stays_still: StaysStill(false), } } } +/// A metadata field for [Hoglin]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct HoglinImmuneToZombification(pub bool); +/// The marker component for entities of type `minecraft:hoglin`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Hoglin` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [HoglinImmuneToZombification] +/// +/// # Parents +/// +/// Entities with `Hoglin` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct JungleChestBoat; -impl JungleChestBoat { +pub struct Hoglin; +impl Hoglin { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, + 17 => { + entity.insert(HoglinImmuneToZombification(d.value.into_boolean()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Hoglin]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct JungleChestBoatMetadataBundle { - _marker: JungleChestBoat, - parent: AbstractBoatMetadataBundle, +pub struct HoglinMetadataBundle { + _marker: Hoglin, + parent: AbstractAnimalMetadataBundle, + hoglin_immune_to_zombification: HoglinImmuneToZombification, } -impl Default for JungleChestBoatMetadataBundle { +impl Default for HoglinMetadataBundle { fn default() -> Self { Self { - _marker: JungleChestBoat, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Hoglin, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), + abstract_ageable_baby: AbstractAgeableBaby(false), }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), }, + hoglin_immune_to_zombification: HoglinImmuneToZombification(false), } } } +/// A metadata field for [Mooshroom]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct MooshroomKind(pub i32); +/// The marker component for entities of type `minecraft:mooshroom`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Mooshroom` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [MooshroomKind] +/// +/// # Parents +/// +/// Entities with `Mooshroom` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct LeashKnot; -impl LeashKnot { +pub struct Mooshroom; +impl Mooshroom { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, + 17 => { + entity.insert(MooshroomKind(d.value.into_int()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Mooshroom]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct LeashKnotMetadataBundle { - _marker: LeashKnot, - parent: AbstractEntityMetadataBundle, +pub struct MooshroomMetadataBundle { + _marker: Mooshroom, + parent: AbstractAnimalMetadataBundle, + mooshroom_kind: MooshroomKind, } -impl Default for LeashKnotMetadataBundle { +impl Default for MooshroomMetadataBundle { fn default() -> Self { Self { - _marker: LeashKnot, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Mooshroom, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + abstract_ageable_baby: AbstractAgeableBaby(false), + }, }, + mooshroom_kind: MooshroomKind(Default::default()), } } } +/// A metadata field for [Ocelot]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Trusting(pub bool); +/// The marker component for entities of type `minecraft:ocelot`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Ocelot` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [Trusting] +/// +/// # Parents +/// +/// Entities with `Ocelot` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct LightningBolt; -impl LightningBolt { +pub struct Ocelot; +impl Ocelot { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, + 17 => { + entity.insert(Trusting(d.value.into_boolean()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Ocelot]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct LightningBoltMetadataBundle { - _marker: LightningBolt, - parent: AbstractEntityMetadataBundle, +pub struct OcelotMetadataBundle { + _marker: Ocelot, + parent: AbstractAnimalMetadataBundle, + trusting: Trusting, } -impl Default for LightningBoltMetadataBundle { +impl Default for OcelotMetadataBundle { fn default() -> Self { Self { - _marker: LightningBolt, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Ocelot, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + abstract_ageable_baby: AbstractAgeableBaby(false), + }, }, + trusting: Trusting(false), } } } +/// A metadata field for [Panda]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PandaUnhappyCounter(pub i32); +/// A metadata field for [Panda]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct SneezeCounter(pub i32); +/// A metadata field for [Panda]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct EatCounter(pub i32); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [Panda]. +pub struct Sneezing(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [Panda]. +pub struct PandaSitting(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [Panda]. +pub struct OnBack(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [Panda]. +pub struct PandaRolling(pub bool); +/// A metadata field for [Panda]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct HiddenGene(pub u8); +/// A metadata field for [Panda]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PandaFlags(pub u8); +/// The marker component for entities of type `minecraft:panda`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Panda` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [PandaUnhappyCounter] +/// - [SneezeCounter] +/// - [EatCounter] +/// - [Sneezing] +/// - [PandaSitting] +/// - [OnBack] +/// - [PandaRolling] +/// - [HiddenGene] +/// - [PandaFlags] +/// +/// # Parents +/// +/// Entities with `Panda` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct LingeringPotion; -impl LingeringPotion { +pub struct Panda; +impl Panda { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?, + 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, + 17 => { + entity.insert(PandaUnhappyCounter(d.value.into_int()?)); + } + 18 => { + entity.insert(SneezeCounter(d.value.into_int()?)); + } + 19 => { + entity.insert(EatCounter(d.value.into_int()?)); + } + 20 => { + let bitfield = d.value.into_byte()?; + entity.insert(Sneezing(bitfield & 0x2 != 0)); + entity.insert(PandaSitting(bitfield & 0x8 != 0)); + entity.insert(OnBack(bitfield & 0x10 != 0)); + entity.insert(PandaRolling(bitfield & 0x4 != 0)); + } + 21 => { + entity.insert(HiddenGene(d.value.into_byte()?)); + } + 22 => { + entity.insert(PandaFlags(d.value.into_byte()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Panda]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct LingeringPotionMetadataBundle { - _marker: LingeringPotion, - parent: AbstractThrownItemProjectileMetadataBundle, +pub struct PandaMetadataBundle { + _marker: Panda, + parent: AbstractAnimalMetadataBundle, + panda_unhappy_counter: PandaUnhappyCounter, + sneeze_counter: SneezeCounter, + eat_counter: EatCounter, + sneezing: Sneezing, + panda_sitting: PandaSitting, + on_back: OnBack, + panda_rolling: PandaRolling, + hidden_gene: HiddenGene, + panda_flags: PandaFlags, } -impl Default for LingeringPotionMetadataBundle { +impl Default for PandaMetadataBundle { fn default() -> Self { Self { - _marker: LingeringPotion, - parent: AbstractThrownItemProjectileMetadataBundle { - _marker: AbstractThrownItemProjectile, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Panda, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + abstract_ageable_baby: AbstractAgeableBaby(false), }, - abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack( - Default::default(), - ), }, + panda_unhappy_counter: PandaUnhappyCounter(0), + sneeze_counter: SneezeCounter(0), + eat_counter: EatCounter(0), + sneezing: Sneezing(false), + panda_sitting: PandaSitting(false), + on_back: OnBack(false), + panda_rolling: PandaRolling(false), + hidden_gene: HiddenGene(0), + panda_flags: PandaFlags(0), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Strength(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct LlamaVariant(pub i32); +/// A metadata field for [Pig]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PigBoostTime(pub i32); +/// A metadata field for [Pig]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PigVariant(pub azalea_registry::data::FrogVariant); +/// The marker component for entities of type `minecraft:pig`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Pig` entities are guaranteed to +/// have, in addition to the metadata components from parent types: +/// +/// - [PigBoostTime] +/// - [PigVariant] +/// +/// # Parents +/// +/// Entities with `Pig` will also have the following marker components and their +/// metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Llama; -impl Llama { +pub struct Pig; +impl Pig { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=18 => AbstractChestedHorse::apply_metadata(entity, d)?, - 19 => { - entity.insert(Strength(d.value.into_int()?)); + 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, + 17 => { + entity.insert(PigBoostTime(d.value.into_int()?)); } - 20 => { - entity.insert(LlamaVariant(d.value.into_int()?)); + 18 => { + entity.insert(PigVariant(d.value.into_frog_variant()?)); } _ => {} } @@ -5833,335 +8183,446 @@ impl Llama { } } +/// The metadata bundle for [Pig]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct LlamaMetadataBundle { - _marker: Llama, - parent: AbstractChestedHorseMetadataBundle, - strength: Strength, - llama_variant: LlamaVariant, +pub struct PigMetadataBundle { + _marker: Pig, + parent: AbstractAnimalMetadataBundle, + pig_boost_time: PigBoostTime, + pig_variant: PigVariant, } -impl Default for LlamaMetadataBundle { +impl Default for PigMetadataBundle { fn default() -> Self { Self { - _marker: Llama, - parent: AbstractChestedHorseMetadataBundle { - _marker: AbstractChestedHorse, - parent: AbstractHorseMetadataBundle { - _marker: AbstractHorse, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: - AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible( - Default::default(), - ), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + _marker: Pig, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, - abstract_ageable_baby: AbstractAgeableBaby(false), + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - }, - tamed: Tamed(false), - eating: Eating(false), - abstract_horse_standing: AbstractHorseStanding(false), - bred: Bred(false), + }, + abstract_ageable_baby: AbstractAgeableBaby(false), }, - chest: Chest(false), - }, - strength: Strength(0), - llama_variant: LlamaVariant(0), - } - } -} - -#[derive(Component)] -pub struct LlamaSpit; -impl LlamaSpit { - pub fn apply_metadata( - entity: &mut bevy_ecs::system::EntityCommands, - d: EntityDataItem, - ) -> Result<(), UpdateMetadataError> { - match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - _ => {} - } - Ok(()) - } -} - -#[derive(Bundle)] -pub struct LlamaSpitMetadataBundle { - _marker: LlamaSpit, - parent: AbstractEntityMetadataBundle, -} -impl Default for LlamaSpitMetadataBundle { - fn default() -> Self { - Self { - _marker: LlamaSpit, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), }, + pig_boost_time: PigBoostTime(0), + pig_variant: PigVariant(azalea_registry::data::FrogVariant::new_raw(0)), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct SlimeSize(pub i32); +/// A metadata field for [PolarBear]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PolarBearStanding(pub bool); +/// The marker component for entities of type `minecraft:polar_bear`. +/// +/// # Metadata +/// +/// These are the metadata components that all `PolarBear` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [PolarBearStanding] +/// +/// # Parents +/// +/// Entities with `PolarBear` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct MagmaCube; -impl MagmaCube { +pub struct PolarBear; +impl PolarBear { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => Slime::apply_metadata(entity, d)?, + 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, + 17 => { + entity.insert(PolarBearStanding(d.value.into_boolean()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [PolarBear]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct MagmaCubeMetadataBundle { - _marker: MagmaCube, - parent: SlimeMetadataBundle, +pub struct PolarBearMetadataBundle { + _marker: PolarBear, + parent: AbstractAnimalMetadataBundle, + polar_bear_standing: PolarBearStanding, } -impl Default for MagmaCubeMetadataBundle { +impl Default for PolarBearMetadataBundle { fn default() -> Self { Self { - _marker: MagmaCube, - parent: SlimeMetadataBundle { - _marker: Slime, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: PolarBear, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + abstract_ageable_baby: AbstractAgeableBaby(false), }, - slime_size: SlimeSize(1), }, + polar_bear_standing: PolarBearStanding(false), } } } +/// A metadata field for [Rabbit]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct RabbitKind(pub i32); +/// The marker component for entities of type `minecraft:rabbit`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Rabbit` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [RabbitKind] +/// +/// # Parents +/// +/// Entities with `Rabbit` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct MangroveBoat; -impl MangroveBoat { +pub struct Rabbit; +impl Rabbit { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, + 17 => { + entity.insert(RabbitKind(d.value.into_int()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Rabbit]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct MangroveBoatMetadataBundle { - _marker: MangroveBoat, - parent: AbstractBoatMetadataBundle, +pub struct RabbitMetadataBundle { + _marker: Rabbit, + parent: AbstractAnimalMetadataBundle, + rabbit_kind: RabbitKind, } -impl Default for MangroveBoatMetadataBundle { +impl Default for RabbitMetadataBundle { fn default() -> Self { Self { - _marker: MangroveBoat, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Rabbit, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), + abstract_ageable_baby: AbstractAgeableBaby(false), }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), }, + rabbit_kind: RabbitKind(Default::default()), } } } +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [Sheep]. +pub struct SheepSheared(pub bool); +/// The marker component for entities of type `minecraft:sheep`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Sheep` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [SheepSheared] +/// +/// # Parents +/// +/// Entities with `Sheep` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct MangroveChestBoat; -impl MangroveChestBoat { +pub struct Sheep; +impl Sheep { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, + 17 => { + let bitfield = d.value.into_byte()?; + entity.insert(SheepSheared(bitfield & 0x10 != 0)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Sheep]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct MangroveChestBoatMetadataBundle { - _marker: MangroveChestBoat, - parent: AbstractBoatMetadataBundle, +pub struct SheepMetadataBundle { + _marker: Sheep, + parent: AbstractAnimalMetadataBundle, + sheep_sheared: SheepSheared, } -impl Default for MangroveChestBoatMetadataBundle { +impl Default for SheepMetadataBundle { fn default() -> Self { Self { - _marker: MangroveChestBoat, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Sheep, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), + abstract_ageable_baby: AbstractAgeableBaby(false), }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), }, + sheep_sheared: SheepSheared(false), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PlayerMainHand(pub HumanoidArm); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PlayerModeCustomisation(pub u8); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Profile(pub components::Profile); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Immovable(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Description(pub Option); +/// A metadata field for [Sniffer]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct SnifferState(pub SnifferStateKind); +/// A metadata field for [Sniffer]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct DropSeedAtTick(pub i32); +/// The marker component for entities of type `minecraft:sniffer`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Sniffer` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [SnifferState] +/// - [DropSeedAtTick] +/// +/// # Parents +/// +/// Entities with `Sniffer` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Mannequin; -impl Mannequin { +pub struct Sniffer; +impl Sniffer { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAvatar::apply_metadata(entity, d)?, + 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, 17 => { - entity.insert(Profile(d.value.into_resolvable_profile()?)); + entity.insert(SnifferState(d.value.into_sniffer_state()?)); } 18 => { - entity.insert(Immovable(d.value.into_boolean()?)); - } - 19 => { - entity.insert(Description(d.value.into_optional_formatted_text()?)); + entity.insert(DropSeedAtTick(d.value.into_int()?)); } _ => {} } @@ -6169,164 +8630,360 @@ impl Mannequin { } } +/// The metadata bundle for [Sniffer]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct MannequinMetadataBundle { - _marker: Mannequin, - parent: AbstractAvatarMetadataBundle, - profile: Profile, - immovable: Immovable, - description: Description, +pub struct SnifferMetadataBundle { + _marker: Sniffer, + parent: AbstractAnimalMetadataBundle, + sniffer_state: SnifferState, + drop_seed_at_tick: DropSeedAtTick, } -impl Default for MannequinMetadataBundle { +impl Default for SnifferMetadataBundle { fn default() -> Self { Self { - _marker: Mannequin, - parent: AbstractAvatarMetadataBundle { - _marker: AbstractAvatar, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Sniffer, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + abstract_ageable_baby: AbstractAgeableBaby(false), }, - player_main_hand: PlayerMainHand(Default::default()), - player_mode_customisation: PlayerModeCustomisation(0), }, - profile: Profile(Default::default()), - immovable: Immovable(false), - description: Description(Default::default()), + sniffer_state: SnifferState(Default::default()), + drop_seed_at_tick: DropSeedAtTick(0), } } } +/// A metadata field for [Strider]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct StriderBoostTime(pub i32); +/// A metadata field for [Strider]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Suffocating(pub bool); +/// The marker component for entities of type `minecraft:strider`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Strider` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [StriderBoostTime] +/// - [Suffocating] +/// +/// # Parents +/// +/// Entities with `Strider` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Marker; -impl Marker { +pub struct Strider; +impl Strider { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, + 17 => { + entity.insert(StriderBoostTime(d.value.into_int()?)); + } + 18 => { + entity.insert(Suffocating(d.value.into_boolean()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Strider]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct MarkerMetadataBundle { - _marker: Marker, - parent: AbstractEntityMetadataBundle, +pub struct StriderMetadataBundle { + _marker: Strider, + parent: AbstractAnimalMetadataBundle, + strider_boost_time: StriderBoostTime, + suffocating: Suffocating, } -impl Default for MarkerMetadataBundle { +impl Default for StriderMetadataBundle { fn default() -> Self { Self { - _marker: Marker, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Strider, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + abstract_ageable_baby: AbstractAgeableBaby(false), + }, }, + strider_boost_time: StriderBoostTime(0), + suffocating: Suffocating(false), } } } +/// A metadata field for [Turtle]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct HasEgg(pub bool); +/// A metadata field for [Turtle]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct LayingEgg(pub bool); +/// The marker component for entities of type `minecraft:turtle`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Turtle` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [HasEgg] +/// - [LayingEgg] +/// +/// # Parents +/// +/// Entities with `Turtle` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Minecart; -impl Minecart { +pub struct Turtle; +impl Turtle { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=12 => AbstractMinecart::apply_metadata(entity, d)?, + 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, + 17 => { + entity.insert(HasEgg(d.value.into_boolean()?)); + } + 18 => { + entity.insert(LayingEgg(d.value.into_boolean()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Turtle]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct MinecartMetadataBundle { - _marker: Minecart, - parent: AbstractMinecartMetadataBundle, +pub struct TurtleMetadataBundle { + _marker: Turtle, + parent: AbstractAnimalMetadataBundle, + has_egg: HasEgg, + laying_egg: LayingEgg, } -impl Default for MinecartMetadataBundle { +impl Default for TurtleMetadataBundle { fn default() -> Self { Self { - _marker: Minecart, - parent: AbstractMinecartMetadataBundle { - _marker: AbstractMinecart, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Turtle, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), + abstract_ageable_baby: AbstractAgeableBaby(false), }, - custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR), - display_offset: DisplayOffset(Default::default()), }, + has_egg: HasEgg(false), + laying_egg: LayingEgg(false), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct MooshroomKind(pub i32); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractHorse]. +pub struct Tamed(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractHorse]. +pub struct Eating(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractHorse]. +pub struct AbstractHorseStanding(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractHorse]. +pub struct Bred(pub bool); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// These are the metadata components that all `AbstractHorse` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [Tamed] +/// - [Eating] +/// - [AbstractHorseStanding] +/// - [Bred] +/// +/// # Parents +/// +/// Entities with `AbstractHorse` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [Camel] +/// - [CamelHusk] +/// - [Horse] +/// - [SkeletonHorse] +/// - [ZombieHorse] +/// - [AbstractChestedHorse] +/// - [Donkey] +/// - [Llama] +/// - [TraderLlama] +/// - [Mule] #[derive(Component)] -pub struct Mooshroom; -impl Mooshroom { +pub struct AbstractHorse; +impl AbstractHorse { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, @@ -6334,7 +8991,11 @@ impl Mooshroom { match d.index { 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, 17 => { - entity.insert(MooshroomKind(d.value.into_int()?)); + let bitfield = d.value.into_byte()?; + entity.insert(Tamed(bitfield & 0x2 != 0)); + entity.insert(Eating(bitfield & 0x10 != 0)); + entity.insert(AbstractHorseStanding(bitfield & 0x20 != 0)); + entity.insert(Bred(bitfield & 0x8 != 0)); } _ => {} } @@ -6342,16 +9003,22 @@ impl Mooshroom { } } +/// The metadata bundle for [AbstractHorse]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct MooshroomMetadataBundle { - _marker: Mooshroom, +pub struct AbstractHorseMetadataBundle { + _marker: AbstractHorse, parent: AbstractAnimalMetadataBundle, - mooshroom_kind: MooshroomKind, + tamed: Tamed, + eating: Eating, + abstract_horse_standing: AbstractHorseStanding, + bred: Bred, } -impl Default for MooshroomMetadataBundle { +impl Default for AbstractHorseMetadataBundle { fn default() -> Self { Self { - _marker: Mooshroom, + _marker: AbstractHorse, parent: AbstractAnimalMetadataBundle { _marker: AbstractAnimal, parent: AbstractAgeableMetadataBundle { @@ -6398,37 +9065,193 @@ impl Default for MooshroomMetadataBundle { abstract_ageable_baby: AbstractAgeableBaby(false), }, }, - mooshroom_kind: MooshroomKind(Default::default()), + tamed: Tamed(false), + eating: Eating(false), + abstract_horse_standing: AbstractHorseStanding(false), + bred: Bred(false), } } } +/// A metadata field for [Camel]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct CamelDash(pub bool); +/// A metadata field for [Camel]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct LastPoseChangeTick(pub i64); +/// The marker component for entities of type `minecraft:camel`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Camel` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [CamelDash] +/// - [LastPoseChangeTick] +/// +/// # Parents +/// +/// Entities with `Camel` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractHorse] +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [CamelHusk] #[derive(Component)] -pub struct Mule; -impl Mule { +pub struct Camel; +impl Camel { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=18 => AbstractChestedHorse::apply_metadata(entity, d)?, + 0..=17 => AbstractHorse::apply_metadata(entity, d)?, + 18 => { + entity.insert(CamelDash(d.value.into_boolean()?)); + } + 19 => { + entity.insert(LastPoseChangeTick(d.value.into_long()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Camel]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct MuleMetadataBundle { - _marker: Mule, - parent: AbstractChestedHorseMetadataBundle, +pub struct CamelMetadataBundle { + _marker: Camel, + parent: AbstractHorseMetadataBundle, + camel_dash: CamelDash, + last_pose_change_tick: LastPoseChangeTick, +} +impl Default for CamelMetadataBundle { + fn default() -> Self { + Self { + _marker: Camel, + parent: AbstractHorseMetadataBundle { + _marker: AbstractHorse, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + abstract_ageable_baby: AbstractAgeableBaby(false), + }, + }, + tamed: Tamed(false), + eating: Eating(false), + abstract_horse_standing: AbstractHorseStanding(false), + bred: Bred(false), + }, + camel_dash: CamelDash(false), + last_pose_change_tick: LastPoseChangeTick(0), + } + } +} + +/// The marker component for entities of type `minecraft:camel_husk`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `CamelHusk` will also have the following marker components and +/// their metadata fields: +/// +/// - [Camel] +/// - [AbstractHorse] +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. +#[derive(Component)] +pub struct CamelHusk; +impl CamelHusk { + pub fn apply_metadata( + entity: &mut bevy_ecs::system::EntityCommands, + d: EntityDataItem, + ) -> Result<(), UpdateMetadataError> { + match d.index { + 0..=19 => Camel::apply_metadata(entity, d)?, + _ => {} + } + Ok(()) + } +} + +/// The metadata bundle for [CamelHusk]. +/// +/// This type should generally not be used directly. +#[derive(Bundle)] +pub struct CamelHuskMetadataBundle { + _marker: CamelHusk, + parent: CamelMetadataBundle, } -impl Default for MuleMetadataBundle { +impl Default for CamelHuskMetadataBundle { fn default() -> Self { Self { - _marker: Mule, - parent: AbstractChestedHorseMetadataBundle { - _marker: AbstractChestedHorse, + _marker: CamelHusk, + parent: CamelMetadataBundle { + _marker: Camel, parent: AbstractHorseMetadataBundle { _marker: AbstractHorse, parent: AbstractAnimalMetadataBundle { @@ -6483,25 +9306,52 @@ impl Default for MuleMetadataBundle { abstract_horse_standing: AbstractHorseStanding(false), bred: Bred(false), }, - chest: Chest(false), + camel_dash: CamelDash(false), + last_pose_change_tick: LastPoseChangeTick(0), }, } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct NautilusDash(pub bool); +/// A metadata field for [Horse]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct HorseTypeVariant(pub i32); +/// The marker component for entities of type `minecraft:horse`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Horse` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [HorseTypeVariant] +/// +/// # Parents +/// +/// Entities with `Horse` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractHorse] +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Nautilus; -impl Nautilus { +pub struct Horse; +impl Horse { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=18 => AbstractTameable::apply_metadata(entity, d)?, - 19 => { - entity.insert(NautilusDash(d.value.into_boolean()?)); + 0..=17 => AbstractHorse::apply_metadata(entity, d)?, + 18 => { + entity.insert(HorseTypeVariant(d.value.into_int()?)); } _ => {} } @@ -6509,18 +9359,21 @@ impl Nautilus { } } +/// The metadata bundle for [Horse]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct NautilusMetadataBundle { - _marker: Nautilus, - parent: AbstractTameableMetadataBundle, - nautilus_dash: NautilusDash, +pub struct HorseMetadataBundle { + _marker: Horse, + parent: AbstractHorseMetadataBundle, + horse_type_variant: HorseTypeVariant, } -impl Default for NautilusMetadataBundle { +impl Default for HorseMetadataBundle { fn default() -> Self { Self { - _marker: Nautilus, - parent: AbstractTameableMetadataBundle { - _marker: AbstractTameable, + _marker: Horse, + parent: AbstractHorseMetadataBundle { + _marker: AbstractHorse, parent: AbstractAnimalMetadataBundle { _marker: AbstractAnimal, parent: AbstractAgeableMetadataBundle { @@ -6567,142 +9420,273 @@ impl Default for NautilusMetadataBundle { abstract_ageable_baby: AbstractAgeableBaby(false), }, }, - tame: Tame(false), - in_sitting_pose: InSittingPose(false), - owneruuid: Owneruuid(None), + tamed: Tamed(false), + eating: Eating(false), + abstract_horse_standing: AbstractHorseStanding(false), + bred: Bred(false), }, - nautilus_dash: NautilusDash(false), + horse_type_variant: HorseTypeVariant(0), } } } +/// The marker component for entities of type `minecraft:skeleton_horse`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `SkeletonHorse` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractHorse] +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct OakBoat; -impl OakBoat { +pub struct SkeletonHorse; +impl SkeletonHorse { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + 0..=17 => AbstractHorse::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [SkeletonHorse]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct OakBoatMetadataBundle { - _marker: OakBoat, - parent: AbstractBoatMetadataBundle, +pub struct SkeletonHorseMetadataBundle { + _marker: SkeletonHorse, + parent: AbstractHorseMetadataBundle, } -impl Default for OakBoatMetadataBundle { +impl Default for SkeletonHorseMetadataBundle { fn default() -> Self { Self { - _marker: OakBoat, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: SkeletonHorse, + parent: AbstractHorseMetadataBundle { + _marker: AbstractHorse, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + abstract_ageable_baby: AbstractAgeableBaby(false), }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), + tamed: Tamed(false), + eating: Eating(false), + abstract_horse_standing: AbstractHorseStanding(false), + bred: Bred(false), }, } } } +/// The marker component for entities of type `minecraft:zombie_horse`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `ZombieHorse` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractHorse] +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct OakChestBoat; -impl OakChestBoat { +pub struct ZombieHorse; +impl ZombieHorse { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + 0..=17 => AbstractHorse::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [ZombieHorse]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct OakChestBoatMetadataBundle { - _marker: OakChestBoat, - parent: AbstractBoatMetadataBundle, +pub struct ZombieHorseMetadataBundle { + _marker: ZombieHorse, + parent: AbstractHorseMetadataBundle, } -impl Default for OakChestBoatMetadataBundle { +impl Default for ZombieHorseMetadataBundle { fn default() -> Self { Self { - _marker: OakChestBoat, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: ZombieHorse, + parent: AbstractHorseMetadataBundle { + _marker: AbstractHorse, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + abstract_ageable_baby: AbstractAgeableBaby(false), }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), + tamed: Tamed(false), + eating: Eating(false), + abstract_horse_standing: AbstractHorseStanding(false), + bred: Bred(false), }, } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Trusting(pub bool); +/// A metadata field for [AbstractChestedHorse]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Chest(pub bool); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// These are the metadata components that all `AbstractChestedHorse` entities +/// are guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [Chest] +/// +/// # Parents +/// +/// Entities with `AbstractChestedHorse` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractHorse] +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [Donkey] +/// - [Llama] +/// - [TraderLlama] +/// - [Mule] #[derive(Component)] -pub struct Ocelot; -impl Ocelot { +pub struct AbstractChestedHorse; +impl AbstractChestedHorse { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, - 17 => { - entity.insert(Trusting(d.value.into_boolean()?)); + 0..=17 => AbstractHorse::apply_metadata(entity, d)?, + 18 => { + entity.insert(Chest(d.value.into_boolean()?)); } _ => {} } @@ -6710,137 +9694,237 @@ impl Ocelot { } } +/// The metadata bundle for [AbstractChestedHorse]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct OcelotMetadataBundle { - _marker: Ocelot, - parent: AbstractAnimalMetadataBundle, - trusting: Trusting, +pub struct AbstractChestedHorseMetadataBundle { + _marker: AbstractChestedHorse, + parent: AbstractHorseMetadataBundle, + chest: Chest, } -impl Default for OcelotMetadataBundle { +impl Default for AbstractChestedHorseMetadataBundle { fn default() -> Self { Self { - _marker: Ocelot, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: AbstractChestedHorse, + parent: AbstractHorseMetadataBundle { + _marker: AbstractHorse, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), }, + abstract_ageable_baby: AbstractAgeableBaby(false), }, - abstract_ageable_baby: AbstractAgeableBaby(false), }, + tamed: Tamed(false), + eating: Eating(false), + abstract_horse_standing: AbstractHorseStanding(false), + bred: Bred(false), }, - trusting: Trusting(false), + chest: Chest(false), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct OminousItemSpawnerItem(pub ItemStack); +/// The marker component for entities of type `minecraft:donkey`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Donkey` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractChestedHorse] +/// - [AbstractHorse] +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct OminousItemSpawner; -impl OminousItemSpawner { +pub struct Donkey; +impl Donkey { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - 8 => { - entity.insert(OminousItemSpawnerItem(d.value.into_item_stack()?)); - } + 0..=18 => AbstractChestedHorse::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [Donkey]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct OminousItemSpawnerMetadataBundle { - _marker: OminousItemSpawner, - parent: AbstractEntityMetadataBundle, - ominous_item_spawner_item: OminousItemSpawnerItem, +pub struct DonkeyMetadataBundle { + _marker: Donkey, + parent: AbstractChestedHorseMetadataBundle, } -impl Default for OminousItemSpawnerMetadataBundle { +impl Default for DonkeyMetadataBundle { fn default() -> Self { Self { - _marker: OminousItemSpawner, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Donkey, + parent: AbstractChestedHorseMetadataBundle { + _marker: AbstractChestedHorse, + parent: AbstractHorseMetadataBundle { + _marker: AbstractHorse, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: + AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible( + Default::default(), + ), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + abstract_ageable_baby: AbstractAgeableBaby(false), + }, + }, + tamed: Tamed(false), + eating: Eating(false), + abstract_horse_standing: AbstractHorseStanding(false), + bred: Bred(false), + }, + chest: Chest(false), }, - ominous_item_spawner_item: OminousItemSpawnerItem(Default::default()), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PaintingDirection(pub Direction); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PaintingVariant(pub azalea_registry::data::PaintingVariant); +/// A metadata field for [Llama]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Strength(pub i32); +/// A metadata field for [Llama]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct LlamaVariant(pub i32); +/// The marker component for entities of type `minecraft:llama`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Llama` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [Strength] +/// - [LlamaVariant] +/// +/// # Parents +/// +/// Entities with `Llama` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractChestedHorse] +/// - [AbstractHorse] +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [TraderLlama] #[derive(Component)] -pub struct Painting; -impl Painting { +pub struct Llama; +impl Llama { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - 8 => { - entity.insert(PaintingDirection(d.value.into_direction()?)); + 0..=18 => AbstractChestedHorse::apply_metadata(entity, d)?, + 19 => { + entity.insert(Strength(d.value.into_int()?)); } - 9 => { - entity.insert(PaintingVariant(d.value.into_painting_variant()?)); + 20 => { + entity.insert(LlamaVariant(d.value.into_int()?)); } _ => {} } @@ -6848,175 +9932,361 @@ impl Painting { } } +/// The metadata bundle for [Llama]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct PaintingMetadataBundle { - _marker: Painting, - parent: AbstractEntityMetadataBundle, - painting_direction: PaintingDirection, - painting_variant: PaintingVariant, +pub struct LlamaMetadataBundle { + _marker: Llama, + parent: AbstractChestedHorseMetadataBundle, + strength: Strength, + llama_variant: LlamaVariant, } -impl Default for PaintingMetadataBundle { +impl Default for LlamaMetadataBundle { fn default() -> Self { Self { - _marker: Painting, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Llama, + parent: AbstractChestedHorseMetadataBundle { + _marker: AbstractChestedHorse, + parent: AbstractHorseMetadataBundle { + _marker: AbstractHorse, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: + AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible( + Default::default(), + ), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + abstract_ageable_baby: AbstractAgeableBaby(false), + }, + }, + tamed: Tamed(false), + eating: Eating(false), + abstract_horse_standing: AbstractHorseStanding(false), + bred: Bred(false), + }, + chest: Chest(false), }, - painting_direction: PaintingDirection(Default::default()), - painting_variant: PaintingVariant(azalea_registry::data::PaintingVariant::new_raw(0)), + strength: Strength(0), + llama_variant: LlamaVariant(0), } } } +/// The marker component for entities of type `minecraft:trader_llama`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `TraderLlama` will also have the following marker components +/// and their metadata fields: +/// +/// - [Llama] +/// - [AbstractChestedHorse] +/// - [AbstractHorse] +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct PaleOakBoat; -impl PaleOakBoat { +pub struct TraderLlama; +impl TraderLlama { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + 0..=20 => Llama::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [TraderLlama]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct PaleOakBoatMetadataBundle { - _marker: PaleOakBoat, - parent: AbstractBoatMetadataBundle, +pub struct TraderLlamaMetadataBundle { + _marker: TraderLlama, + parent: LlamaMetadataBundle, } -impl Default for PaleOakBoatMetadataBundle { +impl Default for TraderLlamaMetadataBundle { fn default() -> Self { Self { - _marker: PaleOakBoat, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: TraderLlama, + parent: LlamaMetadataBundle { + _marker: Llama, + parent: AbstractChestedHorseMetadataBundle { + _marker: AbstractChestedHorse, + parent: AbstractHorseMetadataBundle { + _marker: AbstractHorse, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: + AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible( + Default::default(), + ), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem( + false, + ), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + abstract_ageable_baby: AbstractAgeableBaby(false), + }, + }, + tamed: Tamed(false), + eating: Eating(false), + abstract_horse_standing: AbstractHorseStanding(false), + bred: Bred(false), }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), + chest: Chest(false), }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), + strength: Strength(0), + llama_variant: LlamaVariant(0), }, } } } +/// The marker component for entities of type `minecraft:mule`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Mule` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractChestedHorse] +/// - [AbstractHorse] +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct PaleOakChestBoat; -impl PaleOakChestBoat { +pub struct Mule; +impl Mule { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + 0..=18 => AbstractChestedHorse::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [Mule]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct PaleOakChestBoatMetadataBundle { - _marker: PaleOakChestBoat, - parent: AbstractBoatMetadataBundle, +pub struct MuleMetadataBundle { + _marker: Mule, + parent: AbstractChestedHorseMetadataBundle, } -impl Default for PaleOakChestBoatMetadataBundle { +impl Default for MuleMetadataBundle { fn default() -> Self { Self { - _marker: PaleOakChestBoat, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Mule, + parent: AbstractChestedHorseMetadataBundle { + _marker: AbstractChestedHorse, + parent: AbstractHorseMetadataBundle { + _marker: AbstractHorse, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: + AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible( + Default::default(), + ), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + abstract_ageable_baby: AbstractAgeableBaby(false), + }, }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), + tamed: Tamed(false), + eating: Eating(false), + abstract_horse_standing: AbstractHorseStanding(false), + bred: Bred(false), }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), + chest: Chest(false), }, } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PandaUnhappyCounter(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct SneezeCounter(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct EatCounter(pub i32); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct Sneezing(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct PandaSitting(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct OnBack(pub bool); -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct PandaRolling(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct HiddenGene(pub u8); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PandaFlags(pub u8); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractTameable]. +pub struct Tame(pub bool); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [AbstractTameable]. +pub struct InSittingPose(pub bool); +/// A metadata field for [AbstractTameable]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Owneruuid(pub Option); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// These are the metadata components that all `AbstractTameable` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [Tame] +/// - [InSittingPose] +/// - [Owneruuid] +/// +/// # Parents +/// +/// Entities with `AbstractTameable` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [Cat] +/// - [Nautilus] +/// - [Parrot] +/// - [Wolf] +/// - [ZombieNautilus] #[derive(Component)] -pub struct Panda; -impl Panda { +pub struct AbstractTameable; +impl AbstractTameable { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, @@ -7024,26 +10294,12 @@ impl Panda { match d.index { 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, 17 => { - entity.insert(PandaUnhappyCounter(d.value.into_int()?)); - } - 18 => { - entity.insert(SneezeCounter(d.value.into_int()?)); - } - 19 => { - entity.insert(EatCounter(d.value.into_int()?)); - } - 20 => { let bitfield = d.value.into_byte()?; - entity.insert(Sneezing(bitfield & 0x2 != 0)); - entity.insert(PandaSitting(bitfield & 0x8 != 0)); - entity.insert(OnBack(bitfield & 0x10 != 0)); - entity.insert(PandaRolling(bitfield & 0x4 != 0)); - } - 21 => { - entity.insert(HiddenGene(d.value.into_byte()?)); + entity.insert(Tame(bitfield & 0x4 != 0)); + entity.insert(InSittingPose(bitfield & 0x1 != 0)); } - 22 => { - entity.insert(PandaFlags(d.value.into_byte()?)); + 18 => { + entity.insert(Owneruuid(d.value.into_optional_living_entity_reference()?)); } _ => {} } @@ -7051,24 +10307,21 @@ impl Panda { } } +/// The metadata bundle for [AbstractTameable]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct PandaMetadataBundle { - _marker: Panda, +pub struct AbstractTameableMetadataBundle { + _marker: AbstractTameable, parent: AbstractAnimalMetadataBundle, - panda_unhappy_counter: PandaUnhappyCounter, - sneeze_counter: SneezeCounter, - eat_counter: EatCounter, - sneezing: Sneezing, - panda_sitting: PandaSitting, - on_back: OnBack, - panda_rolling: PandaRolling, - hidden_gene: HiddenGene, - panda_flags: PandaFlags, + tame: Tame, + in_sitting_pose: InSittingPose, + owneruuid: Owneruuid, } -impl Default for PandaMetadataBundle { +impl Default for AbstractTameableMetadataBundle { fn default() -> Self { Self { - _marker: Panda, + _marker: AbstractTameable, parent: AbstractAnimalMetadataBundle { _marker: AbstractAnimal, parent: AbstractAgeableMetadataBundle { @@ -7115,89 +10368,301 @@ impl Default for PandaMetadataBundle { abstract_ageable_baby: AbstractAgeableBaby(false), }, }, - panda_unhappy_counter: PandaUnhappyCounter(0), - sneeze_counter: SneezeCounter(0), - eat_counter: EatCounter(0), - sneezing: Sneezing(false), - panda_sitting: PandaSitting(false), - on_back: OnBack(false), - panda_rolling: PandaRolling(false), - hidden_gene: HiddenGene(0), - panda_flags: PandaFlags(0), + tame: Tame(false), + in_sitting_pose: InSittingPose(false), + owneruuid: Owneruuid(None), } } } +/// A metadata field for [Cat]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct CatVariant(pub azalea_registry::data::CatVariant); +/// A metadata field for [Cat]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct IsLying(pub bool); +/// A metadata field for [Cat]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct RelaxStateOne(pub bool); +/// A metadata field for [Cat]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct CatCollarColor(pub i32); +/// The marker component for entities of type `minecraft:cat`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Cat` entities are guaranteed to +/// have, in addition to the metadata components from parent types: +/// +/// - [CatVariant] +/// - [IsLying] +/// - [RelaxStateOne] +/// - [CatCollarColor] +/// +/// # Parents +/// +/// Entities with `Cat` will also have the following marker components and their +/// metadata fields: +/// +/// - [AbstractTameable] +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Parched; -impl Parched { +pub struct Cat; +impl Cat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractMonster::apply_metadata(entity, d)?, + 0..=18 => AbstractTameable::apply_metadata(entity, d)?, + 19 => { + entity.insert(CatVariant(d.value.into_cat_variant()?)); + } + 20 => { + entity.insert(IsLying(d.value.into_boolean()?)); + } + 21 => { + entity.insert(RelaxStateOne(d.value.into_boolean()?)); + } + 22 => { + entity.insert(CatCollarColor(d.value.into_int()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Cat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct ParchedMetadataBundle { - _marker: Parched, - parent: AbstractMonsterMetadataBundle, +pub struct CatMetadataBundle { + _marker: Cat, + parent: AbstractTameableMetadataBundle, + cat_variant: CatVariant, + is_lying: IsLying, + relax_state_one: RelaxStateOne, + cat_collar_color: CatCollarColor, } -impl Default for ParchedMetadataBundle { +impl Default for CatMetadataBundle { fn default() -> Self { Self { - _marker: Parched, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Cat, + parent: AbstractTameableMetadataBundle { + _marker: AbstractTameable, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + abstract_ageable_baby: AbstractAgeableBaby(false), + }, + }, + tame: Tame(false), + in_sitting_pose: InSittingPose(false), + owneruuid: Owneruuid(None), + }, + cat_variant: CatVariant(azalea_registry::data::CatVariant::new_raw(0)), + is_lying: IsLying(false), + relax_state_one: RelaxStateOne(false), + cat_collar_color: CatCollarColor(Default::default()), + } + } +} + +/// A metadata field for [Nautilus]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct NautilusDash(pub bool); +/// The marker component for entities of type `minecraft:nautilus`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Nautilus` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [NautilusDash] +/// +/// # Parents +/// +/// Entities with `Nautilus` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractTameable] +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. +#[derive(Component)] +pub struct Nautilus; +impl Nautilus { + pub fn apply_metadata( + entity: &mut bevy_ecs::system::EntityCommands, + d: EntityDataItem, + ) -> Result<(), UpdateMetadataError> { + match d.index { + 0..=18 => AbstractTameable::apply_metadata(entity, d)?, + 19 => { + entity.insert(NautilusDash(d.value.into_boolean()?)); + } + _ => {} + } + Ok(()) + } +} + +/// The metadata bundle for [Nautilus]. +/// +/// This type should generally not be used directly. +#[derive(Bundle)] +pub struct NautilusMetadataBundle { + _marker: Nautilus, + parent: AbstractTameableMetadataBundle, + nautilus_dash: NautilusDash, +} +impl Default for NautilusMetadataBundle { + fn default() -> Self { + Self { + _marker: Nautilus, + parent: AbstractTameableMetadataBundle { + _marker: AbstractTameable, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + abstract_ageable_baby: AbstractAgeableBaby(false), }, }, + tame: Tame(false), + in_sitting_pose: InSittingPose(false), + owneruuid: Owneruuid(None), }, + nautilus_dash: NautilusDash(false), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] +/// A metadata field for [Parrot]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] pub struct ParrotVariant(pub i32); +/// The marker component for entities of type `minecraft:parrot`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Parrot` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [ParrotVariant] +/// +/// # Parents +/// +/// Entities with `Parrot` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractTameable] +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] pub struct Parrot; impl Parrot { @@ -7216,6 +10681,9 @@ impl Parrot { } } +/// The metadata bundle for [Parrot]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] pub struct ParrotMetadataBundle { _marker: Parrot, @@ -7283,19 +10751,73 @@ impl Default for ParrotMetadataBundle { } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PhantomSize(pub i32); +/// A metadata field for [Wolf]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct WolfInterested(pub bool); +/// A metadata field for [Wolf]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct WolfCollarColor(pub i32); +/// A metadata field for [Wolf]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct WolfAngerEndTime(pub i64); +/// A metadata field for [Wolf]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct WolfVariant(pub azalea_registry::data::CowVariant); +/// A metadata field for [Wolf]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct SoundVariant(pub azalea_registry::data::WolfVariant); +/// The marker component for entities of type `minecraft:wolf`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Wolf` entities are guaranteed to +/// have, in addition to the metadata components from parent types: +/// +/// - [WolfInterested] +/// - [WolfCollarColor] +/// - [WolfAngerEndTime] +/// - [WolfVariant] +/// - [SoundVariant] +/// +/// # Parents +/// +/// Entities with `Wolf` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractTameable] +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Phantom; -impl Phantom { +pub struct Wolf; +impl Wolf { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractInsentient::apply_metadata(entity, d)?, - 16 => { - entity.insert(PhantomSize(d.value.into_int()?)); + 0..=18 => AbstractTameable::apply_metadata(entity, d)?, + 19 => { + entity.insert(WolfInterested(d.value.into_boolean()?)); + } + 20 => { + entity.insert(WolfCollarColor(d.value.into_int()?)); + } + 21 => { + entity.insert(WolfAngerEndTime(d.value.into_long()?)); + } + 22 => { + entity.insert(WolfVariant(d.value.into_cow_variant()?)); + } + 23 => { + entity.insert(SoundVariant(d.value.into_wolf_variant()?)); } _ => {} } @@ -7303,73 +10825,133 @@ impl Phantom { } } +/// The metadata bundle for [Wolf]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct PhantomMetadataBundle { - _marker: Phantom, - parent: AbstractInsentientMetadataBundle, - phantom_size: PhantomSize, +pub struct WolfMetadataBundle { + _marker: Wolf, + parent: AbstractTameableMetadataBundle, + wolf_interested: WolfInterested, + wolf_collar_color: WolfCollarColor, + wolf_anger_end_time: WolfAngerEndTime, + wolf_variant: WolfVariant, + sound_variant: SoundVariant, } -impl Default for PhantomMetadataBundle { +impl Default for WolfMetadataBundle { fn default() -> Self { Self { - _marker: Phantom, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Wolf, + parent: AbstractTameableMetadataBundle { + _marker: AbstractTameable, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + abstract_ageable_baby: AbstractAgeableBaby(false), }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + tame: Tame(false), + in_sitting_pose: InSittingPose(false), + owneruuid: Owneruuid(None), }, - phantom_size: PhantomSize(0), + wolf_interested: WolfInterested(false), + wolf_collar_color: WolfCollarColor(Default::default()), + wolf_anger_end_time: WolfAngerEndTime(-1), + wolf_variant: WolfVariant(azalea_registry::data::CowVariant::new_raw(0)), + sound_variant: SoundVariant(azalea_registry::data::WolfVariant::new_raw(0)), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PigBoostTime(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PigVariant(pub azalea_registry::data::FrogVariant); +/// A metadata field for [ZombieNautilus]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ZombieNautilusDash(pub bool); +/// A metadata field for [ZombieNautilus]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ZombieNautilusVariant(pub azalea_registry::data::ZombieNautilusVariant); +/// The marker component for entities of type `minecraft:zombie_nautilus`. +/// +/// # Metadata +/// +/// These are the metadata components that all `ZombieNautilus` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [ZombieNautilusDash] +/// - [ZombieNautilusVariant] +/// +/// # Parents +/// +/// Entities with `ZombieNautilus` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractTameable] +/// - [AbstractAnimal] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Pig; -impl Pig { +pub struct ZombieNautilus; +impl ZombieNautilus { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, - 17 => { - entity.insert(PigBoostTime(d.value.into_int()?)); + 0..=18 => AbstractTameable::apply_metadata(entity, d)?, + 19 => { + entity.insert(ZombieNautilusDash(d.value.into_boolean()?)); } - 18 => { - entity.insert(PigVariant(d.value.into_frog_variant()?)); + 20 => { + entity.insert(ZombieNautilusVariant( + d.value.into_zombie_nautilus_variant()?, + )); } _ => {} } @@ -7377,94 +10959,224 @@ impl Pig { } } +/// The metadata bundle for [ZombieNautilus]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct PigMetadataBundle { - _marker: Pig, - parent: AbstractAnimalMetadataBundle, - pig_boost_time: PigBoostTime, - pig_variant: PigVariant, +pub struct ZombieNautilusMetadataBundle { + _marker: ZombieNautilus, + parent: AbstractTameableMetadataBundle, + zombie_nautilus_dash: ZombieNautilusDash, + zombie_nautilus_variant: ZombieNautilusVariant, } -impl Default for PigMetadataBundle { +impl Default for ZombieNautilusMetadataBundle { + fn default() -> Self { + Self { + _marker: ZombieNautilus, + parent: AbstractTameableMetadataBundle { + _marker: AbstractTameable, + parent: AbstractAnimalMetadataBundle { + _marker: AbstractAnimal, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + abstract_ageable_baby: AbstractAgeableBaby(false), + }, + }, + tame: Tame(false), + in_sitting_pose: InSittingPose(false), + owneruuid: Owneruuid(None), + }, + zombie_nautilus_dash: ZombieNautilusDash(false), + zombie_nautilus_variant: ZombieNautilusVariant( + azalea_registry::data::ZombieNautilusVariant::new_raw(0), + ), + } + } +} + +/// A metadata field for [AbstractVillager]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct AbstractVillagerUnhappyCounter(pub i32); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// These are the metadata components that all `AbstractVillager` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [AbstractVillagerUnhappyCounter] +/// +/// # Parents +/// +/// Entities with `AbstractVillager` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [Villager] +/// - [WanderingTrader] +#[derive(Component)] +pub struct AbstractVillager; +impl AbstractVillager { + pub fn apply_metadata( + entity: &mut bevy_ecs::system::EntityCommands, + d: EntityDataItem, + ) -> Result<(), UpdateMetadataError> { + match d.index { + 0..=16 => AbstractAgeable::apply_metadata(entity, d)?, + 17 => { + entity.insert(AbstractVillagerUnhappyCounter(d.value.into_int()?)); + } + _ => {} + } + Ok(()) + } +} + +/// The metadata bundle for [AbstractVillager]. +/// +/// This type should generally not be used directly. +#[derive(Bundle)] +pub struct AbstractVillagerMetadataBundle { + _marker: AbstractVillager, + parent: AbstractAgeableMetadataBundle, + abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter, +} +impl Default for AbstractVillagerMetadataBundle { fn default() -> Self { Self { - _marker: Pig, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + _marker: AbstractVillager, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - abstract_ageable_baby: AbstractAgeableBaby(false), }, + abstract_ageable_baby: AbstractAgeableBaby(false), }, - pig_boost_time: PigBoostTime(0), - pig_variant: PigVariant(azalea_registry::data::FrogVariant::new_raw(0)), + abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter(0), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct AbstractPiglinImmuneToZombification(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PiglinBaby(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PiglinIsChargingCrossbow(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct IsDancing(pub bool); +/// A metadata field for [Villager]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct VillagerVillagerData(pub VillagerData); +/// The marker component for entities of type `minecraft:villager`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Villager` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [VillagerVillagerData] +/// +/// # Parents +/// +/// Entities with `Villager` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractVillager] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Piglin; -impl Piglin { +pub struct Villager; +impl Villager { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractPiglin::apply_metadata(entity, d)?, - 17 => { - entity.insert(PiglinBaby(d.value.into_boolean()?)); - } + 0..=17 => AbstractVillager::apply_metadata(entity, d)?, 18 => { - entity.insert(PiglinIsChargingCrossbow(d.value.into_boolean()?)); - } - 19 => { - entity.insert(IsDancing(d.value.into_boolean()?)); + entity.insert(VillagerVillagerData(d.value.into_villager_data()?)); } _ => {} } @@ -7472,22 +11184,23 @@ impl Piglin { } } +/// The metadata bundle for [Villager]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct PiglinMetadataBundle { - _marker: Piglin, - parent: AbstractPiglinMetadataBundle, - piglin_baby: PiglinBaby, - piglin_is_charging_crossbow: PiglinIsChargingCrossbow, - is_dancing: IsDancing, +pub struct VillagerMetadataBundle { + _marker: Villager, + parent: AbstractVillagerMetadataBundle, + villager_villager_data: VillagerVillagerData, } -impl Default for PiglinMetadataBundle { +impl Default for VillagerMetadataBundle { fn default() -> Self { Self { - _marker: Piglin, - parent: AbstractPiglinMetadataBundle { - _marker: AbstractPiglin, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, + _marker: Villager, + parent: AbstractVillagerMetadataBundle { + _marker: AbstractVillager, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, parent: AbstractCreatureMetadataBundle { _marker: AbstractCreature, parent: AbstractInsentientMetadataBundle { @@ -7527,44 +11240,72 @@ impl Default for PiglinMetadataBundle { aggressive: Aggressive(false), }, }, + abstract_ageable_baby: AbstractAgeableBaby(false), }, - abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification(false), + abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter(0), }, - piglin_baby: PiglinBaby(false), - piglin_is_charging_crossbow: PiglinIsChargingCrossbow(false), - is_dancing: IsDancing(false), + villager_villager_data: VillagerVillagerData(VillagerData { + kind: azalea_registry::builtin::VillagerKind::Plains, + profession: azalea_registry::builtin::VillagerProfession::None, + level: 0, + }), } } } +/// The marker component for entities of type `minecraft:wandering_trader`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `WanderingTrader` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractVillager] +/// - [AbstractAgeable] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct PiglinBrute; -impl PiglinBrute { +pub struct WanderingTrader; +impl WanderingTrader { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractPiglin::apply_metadata(entity, d)?, + 0..=17 => AbstractVillager::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [WanderingTrader]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct PiglinBruteMetadataBundle { - _marker: PiglinBrute, - parent: AbstractPiglinMetadataBundle, +pub struct WanderingTraderMetadataBundle { + _marker: WanderingTrader, + parent: AbstractVillagerMetadataBundle, } -impl Default for PiglinBruteMetadataBundle { +impl Default for WanderingTraderMetadataBundle { fn default() -> Self { Self { - _marker: PiglinBrute, - parent: AbstractPiglinMetadataBundle { - _marker: AbstractPiglin, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, + _marker: WanderingTrader, + parent: AbstractVillagerMetadataBundle { + _marker: AbstractVillager, + parent: AbstractAgeableMetadataBundle { + _marker: AbstractAgeable, parent: AbstractCreatureMetadataBundle { _marker: AbstractCreature, parent: AbstractInsentientMetadataBundle { @@ -7604,26 +11345,53 @@ impl Default for PiglinBruteMetadataBundle { aggressive: Aggressive(false), }, }, + abstract_ageable_baby: AbstractAgeableBaby(false), }, - abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification(false), + abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter(0), }, } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PillagerIsChargingCrossbow(pub bool); +/// A metadata field for [AbstractFish]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct AbstractFishFromBucket(pub bool); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// These are the metadata components that all `AbstractFish` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [AbstractFishFromBucket] +/// +/// # Parents +/// +/// Entities with `AbstractFish` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [Cod] +/// - [Salmon] +/// - [TropicalFish] #[derive(Component)] -pub struct Pillager; -impl Pillager { +pub struct AbstractFish; +impl AbstractFish { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractRaider::apply_metadata(entity, d)?, - 17 => { - entity.insert(PillagerIsChargingCrossbow(d.value.into_boolean()?)); + 0..=15 => AbstractCreature::apply_metadata(entity, d)?, + 16 => { + entity.insert(AbstractFishFromBucket(d.value.into_boolean()?)); } _ => {} } @@ -7631,95 +11399,191 @@ impl Pillager { } } +/// The metadata bundle for [AbstractFish]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct PillagerMetadataBundle { - _marker: Pillager, - parent: AbstractRaiderMetadataBundle, - pillager_is_charging_crossbow: PillagerIsChargingCrossbow, +pub struct AbstractFishMetadataBundle { + _marker: AbstractFish, + parent: AbstractCreatureMetadataBundle, + abstract_fish_from_bucket: AbstractFishFromBucket, } -impl Default for PillagerMetadataBundle { +impl Default for AbstractFishMetadataBundle { fn default() -> Self { Self { - _marker: Pillager, - parent: AbstractRaiderMetadataBundle { - _marker: AbstractRaider, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + _marker: AbstractFish, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + abstract_fish_from_bucket: AbstractFishFromBucket(false), + } + } +} + +/// The marker component for entities of type `minecraft:cod`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Cod` will also have the following marker components and their +/// metadata fields: +/// +/// - [AbstractFish] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. +#[derive(Component)] +pub struct Cod; +impl Cod { + pub fn apply_metadata( + entity: &mut bevy_ecs::system::EntityCommands, + d: EntityDataItem, + ) -> Result<(), UpdateMetadataError> { + match d.index { + 0..=16 => AbstractFish::apply_metadata(entity, d)?, + _ => {} + } + Ok(()) + } +} + +/// The metadata bundle for [Cod]. +/// +/// This type should generally not be used directly. +#[derive(Bundle)] +pub struct CodMetadataBundle { + _marker: Cod, + parent: AbstractFishMetadataBundle, +} +impl Default for CodMetadataBundle { + fn default() -> Self { + Self { + _marker: Cod, + parent: AbstractFishMetadataBundle { + _marker: AbstractFish, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, }, - is_celebrating: IsCelebrating(false), + abstract_fish_from_bucket: AbstractFishFromBucket(false), }, - pillager_is_charging_crossbow: PillagerIsChargingCrossbow(false), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PlayerAbsorption(pub f32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Score(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ShoulderParrotLeft(pub OptionalUnsignedInt); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ShoulderParrotRight(pub OptionalUnsignedInt); +/// A metadata field for [Salmon]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct SalmonKind(pub i32); +/// The marker component for entities of type `minecraft:salmon`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Salmon` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [SalmonKind] +/// +/// # Parents +/// +/// Entities with `Salmon` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractFish] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Player; -impl Player { +pub struct Salmon; +impl Salmon { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAvatar::apply_metadata(entity, d)?, + 0..=16 => AbstractFish::apply_metadata(entity, d)?, 17 => { - entity.insert(PlayerAbsorption(d.value.into_float()?)); - } - 18 => { - entity.insert(Score(d.value.into_int()?)); - } - 19 => { - entity.insert(ShoulderParrotLeft(d.value.into_optional_unsigned_int()?)); - } - 20 => { - entity.insert(ShoulderParrotRight(d.value.into_optional_unsigned_int()?)); + entity.insert(SalmonKind(d.value.into_int()?)); } _ => {} } @@ -7727,73 +11591,103 @@ impl Player { } } +/// The metadata bundle for [Salmon]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct PlayerMetadataBundle { - _marker: Player, - parent: AbstractAvatarMetadataBundle, - player_absorption: PlayerAbsorption, - score: Score, - shoulder_parrot_left: ShoulderParrotLeft, - shoulder_parrot_right: ShoulderParrotRight, +pub struct SalmonMetadataBundle { + _marker: Salmon, + parent: AbstractFishMetadataBundle, + salmon_kind: SalmonKind, } -impl Default for PlayerMetadataBundle { +impl Default for SalmonMetadataBundle { fn default() -> Self { Self { - _marker: Player, - parent: AbstractAvatarMetadataBundle { - _marker: AbstractAvatar, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Salmon, + parent: AbstractFishMetadataBundle { + _marker: AbstractFish, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), }, - player_main_hand: PlayerMainHand(Default::default()), - player_mode_customisation: PlayerModeCustomisation(0), + abstract_fish_from_bucket: AbstractFishFromBucket(false), }, - player_absorption: PlayerAbsorption(0.0), - score: Score(0), - shoulder_parrot_left: ShoulderParrotLeft(OptionalUnsignedInt(None)), - shoulder_parrot_right: ShoulderParrotRight(OptionalUnsignedInt(None)), + salmon_kind: SalmonKind(Default::default()), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PolarBearStanding(pub bool); +/// A metadata field for [TropicalFish]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct TropicalFishTypeVariant(pub i32); +/// The marker component for entities of type `minecraft:tropical_fish`. +/// +/// # Metadata +/// +/// These are the metadata components that all `TropicalFish` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [TropicalFishTypeVariant] +/// +/// # Parents +/// +/// Entities with `TropicalFish` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractFish] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct PolarBear; -impl PolarBear { +pub struct TropicalFish; +impl TropicalFish { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, + 0..=16 => AbstractFish::apply_metadata(entity, d)?, 17 => { - entity.insert(PolarBearStanding(d.value.into_boolean()?)); + entity.insert(TropicalFishTypeVariant(d.value.into_int()?)); } _ => {} } @@ -7801,103 +11695,148 @@ impl PolarBear { } } +/// The metadata bundle for [TropicalFish]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct PolarBearMetadataBundle { - _marker: PolarBear, - parent: AbstractAnimalMetadataBundle, - polar_bear_standing: PolarBearStanding, +pub struct TropicalFishMetadataBundle { + _marker: TropicalFish, + parent: AbstractFishMetadataBundle, + tropical_fish_type_variant: TropicalFishTypeVariant, } -impl Default for PolarBearMetadataBundle { +impl Default for TropicalFishMetadataBundle { fn default() -> Self { Self { - _marker: PolarBear, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + _marker: TropicalFish, + parent: AbstractFishMetadataBundle { + _marker: AbstractFish, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - abstract_ageable_baby: AbstractAgeableBaby(false), }, + abstract_fish_from_bucket: AbstractFishFromBucket(false), }, - polar_bear_standing: PolarBearStanding(false), + tropical_fish_type_variant: TropicalFishTypeVariant(Default::default()), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PufferfishFromBucket(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct PuffState(pub i32); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `AbstractMonster` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [Blaze] +/// - [Bogged] +/// - [Breeze] +/// - [Creaking] +/// - [Creeper] +/// - [Enderman] +/// - [Endermite] +/// - [Giant] +/// - [Guardian] +/// - [ElderGuardian] +/// - [Parched] +/// - [Silverfish] +/// - [Skeleton] +/// - [Spider] +/// - [CaveSpider] +/// - [Stray] +/// - [Vex] +/// - [Warden] +/// - [Wither] +/// - [WitherSkeleton] +/// - [Zoglin] +/// - [Zombie] +/// - [Drowned] +/// - [Husk] +/// - [ZombieVillager] +/// - [ZombifiedPiglin] +/// - [AbstractPiglin] +/// - [Piglin] +/// - [PiglinBrute] +/// - [AbstractRaider] +/// - [Pillager] +/// - [Ravager] +/// - [Vindicator] +/// - [Witch] +/// - [AbstractSpellcasterIllager] +/// - [Evoker] +/// - [Illusioner] #[derive(Component)] -pub struct Pufferfish; -impl Pufferfish { +pub struct AbstractMonster; +impl AbstractMonster { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { 0..=15 => AbstractCreature::apply_metadata(entity, d)?, - 16 => { - entity.insert(PufferfishFromBucket(d.value.into_boolean()?)); - } - 17 => { - entity.insert(PuffState(d.value.into_int()?)); - } _ => {} } Ok(()) } } +/// The metadata bundle for [AbstractMonster]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct PufferfishMetadataBundle { - _marker: Pufferfish, +pub struct AbstractMonsterMetadataBundle { + _marker: AbstractMonster, parent: AbstractCreatureMetadataBundle, - pufferfish_from_bucket: PufferfishFromBucket, - puff_state: PuffState, } -impl Default for PufferfishMetadataBundle { +impl Default for AbstractMonsterMetadataBundle { fn default() -> Self { Self { - _marker: Pufferfish, + _marker: AbstractMonster, parent: AbstractCreatureMetadataBundle { _marker: AbstractCreature, parent: AbstractInsentientMetadataBundle { @@ -7935,25 +11874,48 @@ impl Default for PufferfishMetadataBundle { aggressive: Aggressive(false), }, }, - pufferfish_from_bucket: PufferfishFromBucket(false), - puff_state: PuffState(0), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct RabbitKind(pub i32); +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [Blaze]. +pub struct Charged(pub bool); +/// The marker component for entities of type `minecraft:blaze`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Blaze` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [Charged] +/// +/// # Parents +/// +/// Entities with `Blaze` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Rabbit; -impl Rabbit { +pub struct Blaze; +impl Blaze { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, - 17 => { - entity.insert(RabbitKind(d.value.into_int()?)); + 0..=15 => AbstractMonster::apply_metadata(entity, d)?, + 16 => { + let bitfield = d.value.into_byte()?; + entity.insert(Charged(bitfield & 0x1 != 0)); } _ => {} } @@ -7961,154 +11923,101 @@ impl Rabbit { } } +/// The metadata bundle for [Blaze]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct RabbitMetadataBundle { - _marker: Rabbit, - parent: AbstractAnimalMetadataBundle, - rabbit_kind: RabbitKind, -} -impl Default for RabbitMetadataBundle { - fn default() -> Self { - Self { - _marker: Rabbit, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - abstract_ageable_baby: AbstractAgeableBaby(false), - }, - }, - rabbit_kind: RabbitKind(Default::default()), - } - } -} - -#[derive(Component)] -pub struct Ravager; -impl Ravager { - pub fn apply_metadata( - entity: &mut bevy_ecs::system::EntityCommands, - d: EntityDataItem, - ) -> Result<(), UpdateMetadataError> { - match d.index { - 0..=16 => AbstractRaider::apply_metadata(entity, d)?, - _ => {} - } - Ok(()) - } -} - -#[derive(Bundle)] -pub struct RavagerMetadataBundle { - _marker: Ravager, - parent: AbstractRaiderMetadataBundle, +pub struct BlazeMetadataBundle { + _marker: Blaze, + parent: AbstractMonsterMetadataBundle, + charged: Charged, } -impl Default for RavagerMetadataBundle { +impl Default for BlazeMetadataBundle { fn default() -> Self { Self { - _marker: Ravager, - parent: AbstractRaiderMetadataBundle { - _marker: AbstractRaider, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + _marker: Blaze, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, }, - is_celebrating: IsCelebrating(false), }, + charged: Charged(false), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct SalmonKind(pub i32); +/// A metadata field for [Bogged]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct BoggedSheared(pub bool); +/// The marker component for entities of type `minecraft:bogged`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Bogged` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [BoggedSheared] +/// +/// # Parents +/// +/// Entities with `Bogged` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Salmon; -impl Salmon { +pub struct Bogged; +impl Bogged { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractFish::apply_metadata(entity, d)?, - 17 => { - entity.insert(SalmonKind(d.value.into_int()?)); + 0..=15 => AbstractMonster::apply_metadata(entity, d)?, + 16 => { + entity.insert(BoggedSheared(d.value.into_boolean()?)); } _ => {} } @@ -8116,18 +12025,21 @@ impl Salmon { } } +/// The metadata bundle for [Bogged]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct SalmonMetadataBundle { - _marker: Salmon, - parent: AbstractFishMetadataBundle, - salmon_kind: SalmonKind, +pub struct BoggedMetadataBundle { + _marker: Bogged, + parent: AbstractMonsterMetadataBundle, + bogged_sheared: BoggedSheared, } -impl Default for SalmonMetadataBundle { +impl Default for BoggedMetadataBundle { fn default() -> Self { Self { - _marker: Salmon, - parent: AbstractFishMetadataBundle { - _marker: AbstractFish, + _marker: Bogged, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, parent: AbstractCreatureMetadataBundle { _marker: AbstractCreature, parent: AbstractInsentientMetadataBundle { @@ -8165,118 +12077,163 @@ impl Default for SalmonMetadataBundle { aggressive: Aggressive(false), }, }, - abstract_fish_from_bucket: AbstractFishFromBucket(false), }, - salmon_kind: SalmonKind(Default::default()), + bogged_sheared: BoggedSheared(false), } } } -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct SheepSheared(pub bool); +/// The marker component for entities of type `minecraft:breeze`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Breeze` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Sheep; -impl Sheep { +pub struct Breeze; +impl Breeze { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, - 17 => { - let bitfield = d.value.into_byte()?; - entity.insert(SheepSheared(bitfield & 0x10 != 0)); - } + 0..=15 => AbstractMonster::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [Breeze]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct SheepMetadataBundle { - _marker: Sheep, - parent: AbstractAnimalMetadataBundle, - sheep_sheared: SheepSheared, +pub struct BreezeMetadataBundle { + _marker: Breeze, + parent: AbstractMonsterMetadataBundle, } -impl Default for SheepMetadataBundle { +impl Default for BreezeMetadataBundle { fn default() -> Self { Self { - _marker: Sheep, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + _marker: Breeze, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - abstract_ageable_baby: AbstractAgeableBaby(false), }, }, - sheep_sheared: SheepSheared(false), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct AttachFace(pub Direction); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Peek(pub u8); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Color(pub u8); +/// A metadata field for [Creaking]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct CanMove(pub bool); +/// A metadata field for [Creaking]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct IsActive(pub bool); +/// A metadata field for [Creaking]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct IsTearingDown(pub bool); +/// A metadata field for [Creaking]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct HomePos(pub Option); +/// The marker component for entities of type `minecraft:creaking`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Creaking` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [CanMove] +/// - [IsActive] +/// - [IsTearingDown] +/// - [HomePos] +/// +/// # Parents +/// +/// Entities with `Creaking` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Shulker; -impl Shulker { +pub struct Creaking; +impl Creaking { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractCreature::apply_metadata(entity, d)?, + 0..=15 => AbstractMonster::apply_metadata(entity, d)?, 16 => { - entity.insert(AttachFace(d.value.into_direction()?)); + entity.insert(CanMove(d.value.into_boolean()?)); } 17 => { - entity.insert(Peek(d.value.into_byte()?)); + entity.insert(IsActive(d.value.into_boolean()?)); } 18 => { - entity.insert(Color(d.value.into_byte()?)); + entity.insert(IsTearingDown(d.value.into_boolean()?)); + } + 19 => { + entity.insert(HomePos(d.value.into_optional_block_pos()?)); } _ => {} } @@ -8284,131 +12241,143 @@ impl Shulker { } } +/// The metadata bundle for [Creaking]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct ShulkerMetadataBundle { - _marker: Shulker, - parent: AbstractCreatureMetadataBundle, - attach_face: AttachFace, - peek: Peek, - color: Color, -} -impl Default for ShulkerMetadataBundle { - fn default() -> Self { - Self { - _marker: Shulker, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - attach_face: AttachFace(Default::default()), - peek: Peek(0), - color: Color(16), - } - } -} - -#[derive(Component)] -pub struct ShulkerBullet; -impl ShulkerBullet { - pub fn apply_metadata( - entity: &mut bevy_ecs::system::EntityCommands, - d: EntityDataItem, - ) -> Result<(), UpdateMetadataError> { - match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - _ => {} - } - Ok(()) - } -} - -#[derive(Bundle)] -pub struct ShulkerBulletMetadataBundle { - _marker: ShulkerBullet, - parent: AbstractEntityMetadataBundle, +pub struct CreakingMetadataBundle { + _marker: Creaking, + parent: AbstractMonsterMetadataBundle, + can_move: CanMove, + is_active: IsActive, + is_tearing_down: IsTearingDown, + home_pos: HomePos, } -impl Default for ShulkerBulletMetadataBundle { +impl Default for CreakingMetadataBundle { fn default() -> Self { Self { - _marker: ShulkerBullet, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Creaking, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, }, + can_move: CanMove(true), + is_active: IsActive(false), + is_tearing_down: IsTearingDown(false), + home_pos: HomePos(None), } } } +/// A metadata field for [Creeper]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct SwellDir(pub i32); +/// A metadata field for [Creeper]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct IsPowered(pub bool); +/// A metadata field for [Creeper]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct IsIgnited(pub bool); +/// The marker component for entities of type `minecraft:creeper`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Creeper` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [SwellDir] +/// - [IsPowered] +/// - [IsIgnited] +/// +/// # Parents +/// +/// Entities with `Creeper` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Silverfish; -impl Silverfish { +pub struct Creeper; +impl Creeper { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { 0..=15 => AbstractMonster::apply_metadata(entity, d)?, + 16 => { + entity.insert(SwellDir(d.value.into_int()?)); + } + 17 => { + entity.insert(IsPowered(d.value.into_boolean()?)); + } + 18 => { + entity.insert(IsIgnited(d.value.into_boolean()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Creeper]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct SilverfishMetadataBundle { - _marker: Silverfish, +pub struct CreeperMetadataBundle { + _marker: Creeper, parent: AbstractMonsterMetadataBundle, + swell_dir: SwellDir, + is_powered: IsPowered, + is_ignited: IsIgnited, } -impl Default for SilverfishMetadataBundle { +impl Default for CreeperMetadataBundle { fn default() -> Self { Self { - _marker: Silverfish, + _marker: Creeper, parent: AbstractMonsterMetadataBundle { _marker: AbstractMonster, parent: AbstractCreatureMetadataBundle { @@ -8449,15 +12418,51 @@ impl Default for SilverfishMetadataBundle { }, }, }, + swell_dir: SwellDir(-1), + is_powered: IsPowered(false), + is_ignited: IsIgnited(false), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct StrayConversion(pub bool); +/// A metadata field for [Enderman]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct CarryState(pub azalea_block::BlockState); +/// A metadata field for [Enderman]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Creepy(pub bool); +/// A metadata field for [Enderman]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct StaredAt(pub bool); +/// The marker component for entities of type `minecraft:enderman`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Enderman` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [CarryState] +/// - [Creepy] +/// - [StaredAt] +/// +/// # Parents +/// +/// Entities with `Enderman` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Skeleton; -impl Skeleton { +pub struct Enderman; +impl Enderman { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, @@ -8465,7 +12470,13 @@ impl Skeleton { match d.index { 0..=15 => AbstractMonster::apply_metadata(entity, d)?, 16 => { - entity.insert(StrayConversion(d.value.into_boolean()?)); + entity.insert(CarryState(d.value.into_optional_block_state()?)); + } + 17 => { + entity.insert(Creepy(d.value.into_boolean()?)); + } + 18 => { + entity.insert(StaredAt(d.value.into_boolean()?)); } _ => {} } @@ -8473,16 +12484,21 @@ impl Skeleton { } } +/// The metadata bundle for [Enderman]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct SkeletonMetadataBundle { - _marker: Skeleton, +pub struct EndermanMetadataBundle { + _marker: Enderman, parent: AbstractMonsterMetadataBundle, - stray_conversion: StrayConversion, + carry_state: CarryState, + creepy: Creepy, + stared_at: StaredAt, } -impl Default for SkeletonMetadataBundle { +impl Default for EndermanMetadataBundle { fn default() -> Self { Self { - _marker: Skeleton, + _marker: Enderman, parent: AbstractMonsterMetadataBundle { _marker: AbstractMonster, parent: AbstractCreatureMetadataBundle { @@ -8523,172 +12539,242 @@ impl Default for SkeletonMetadataBundle { }, }, }, - stray_conversion: StrayConversion(false), + carry_state: CarryState(azalea_block::BlockState::AIR), + creepy: Creepy(false), + stared_at: StaredAt(false), } } } +/// The marker component for entities of type `minecraft:endermite`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Endermite` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct SkeletonHorse; -impl SkeletonHorse { +pub struct Endermite; +impl Endermite { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=17 => AbstractHorse::apply_metadata(entity, d)?, + 0..=15 => AbstractMonster::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [Endermite]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct SkeletonHorseMetadataBundle { - _marker: SkeletonHorse, - parent: AbstractHorseMetadataBundle, +pub struct EndermiteMetadataBundle { + _marker: Endermite, + parent: AbstractMonsterMetadataBundle, } -impl Default for SkeletonHorseMetadataBundle { +impl Default for EndermiteMetadataBundle { fn default() -> Self { Self { - _marker: SkeletonHorse, - parent: AbstractHorseMetadataBundle { - _marker: AbstractHorse, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + _marker: Endermite, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, - abstract_ageable_baby: AbstractAgeableBaby(false), + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, }, - tamed: Tamed(false), - eating: Eating(false), - abstract_horse_standing: AbstractHorseStanding(false), - bred: Bred(false), }, } } } +/// The marker component for entities of type `minecraft:giant`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Giant` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Slime; -impl Slime { +pub struct Giant; +impl Giant { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractInsentient::apply_metadata(entity, d)?, - 16 => { - entity.insert(SlimeSize(d.value.into_int()?)); - } + 0..=15 => AbstractMonster::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [Giant]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct SlimeMetadataBundle { - _marker: Slime, - parent: AbstractInsentientMetadataBundle, - slime_size: SlimeSize, +pub struct GiantMetadataBundle { + _marker: Giant, + parent: AbstractMonsterMetadataBundle, } -impl Default for SlimeMetadataBundle { +impl Default for GiantMetadataBundle { fn default() -> Self { Self { - _marker: Slime, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + _marker: Giant, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), }, - slime_size: SlimeSize(1), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct SmallFireballItemStack(pub ItemStack); +/// A metadata field for [Guardian]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Moving(pub bool); +/// A metadata field for [Guardian]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct AttackTarget(pub i32); +/// The marker component for entities of type `minecraft:guardian`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Guardian` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [Moving] +/// - [AttackTarget] +/// +/// # Parents +/// +/// Entities with `Guardian` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [ElderGuardian] #[derive(Component)] -pub struct SmallFireball; -impl SmallFireball { +pub struct Guardian; +impl Guardian { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - 8 => { - entity.insert(SmallFireballItemStack(d.value.into_item_stack()?)); + 0..=15 => AbstractMonster::apply_metadata(entity, d)?, + 16 => { + entity.insert(Moving(d.value.into_boolean()?)); + } + 17 => { + entity.insert(AttackTarget(d.value.into_int()?)); } _ => {} } @@ -8696,78 +12782,119 @@ impl SmallFireball { } } +/// The metadata bundle for [Guardian]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct SmallFireballMetadataBundle { - _marker: SmallFireball, - parent: AbstractEntityMetadataBundle, - small_fireball_item_stack: SmallFireballItemStack, +pub struct GuardianMetadataBundle { + _marker: Guardian, + parent: AbstractMonsterMetadataBundle, + moving: Moving, + attack_target: AttackTarget, } -impl Default for SmallFireballMetadataBundle { +impl Default for GuardianMetadataBundle { fn default() -> Self { Self { - _marker: SmallFireball, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Guardian, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, }, - small_fireball_item_stack: SmallFireballItemStack(Default::default()), + moving: Moving(false), + attack_target: AttackTarget(0), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct SnifferState(pub SnifferStateKind); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct DropSeedAtTick(pub i32); +/// The marker component for entities of type `minecraft:elder_guardian`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `ElderGuardian` will also have the following marker components +/// and their metadata fields: +/// +/// - [Guardian] +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Sniffer; -impl Sniffer { +pub struct ElderGuardian; +impl ElderGuardian { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, - 17 => { - entity.insert(SnifferState(d.value.into_sniffer_state()?)); - } - 18 => { - entity.insert(DropSeedAtTick(d.value.into_int()?)); - } + 0..=17 => Guardian::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [ElderGuardian]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct SnifferMetadataBundle { - _marker: Sniffer, - parent: AbstractAnimalMetadataBundle, - sniffer_state: SnifferState, - drop_seed_at_tick: DropSeedAtTick, +pub struct ElderGuardianMetadataBundle { + _marker: ElderGuardian, + parent: GuardianMetadataBundle, } -impl Default for SnifferMetadataBundle { +impl Default for ElderGuardianMetadataBundle { fn default() -> Self { Self { - _marker: Sniffer, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, + _marker: ElderGuardian, + parent: GuardianMetadataBundle { + _marker: Guardian, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, parent: AbstractCreatureMetadataBundle { _marker: AbstractCreature, parent: AbstractInsentientMetadataBundle { @@ -8802,34 +12929,241 @@ impl Default for SnifferMetadataBundle { stinger_count: StingerCount(0), sleeping_pos: SleepingPos(None), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + }, + moving: Moving(false), + attack_target: AttackTarget(0), + }, + } + } +} + +/// The marker component for entities of type `minecraft:parched`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Parched` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. +#[derive(Component)] +pub struct Parched; +impl Parched { + pub fn apply_metadata( + entity: &mut bevy_ecs::system::EntityCommands, + d: EntityDataItem, + ) -> Result<(), UpdateMetadataError> { + match d.index { + 0..=15 => AbstractMonster::apply_metadata(entity, d)?, + _ => {} + } + Ok(()) + } +} + +/// The metadata bundle for [Parched]. +/// +/// This type should generally not be used directly. +#[derive(Bundle)] +pub struct ParchedMetadataBundle { + _marker: Parched, + parent: AbstractMonsterMetadataBundle, +} +impl Default for ParchedMetadataBundle { + fn default() -> Self { + Self { + _marker: Parched, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + }, + } + } +} + +/// The marker component for entities of type `minecraft:silverfish`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Silverfish` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. +#[derive(Component)] +pub struct Silverfish; +impl Silverfish { + pub fn apply_metadata( + entity: &mut bevy_ecs::system::EntityCommands, + d: EntityDataItem, + ) -> Result<(), UpdateMetadataError> { + match d.index { + 0..=15 => AbstractMonster::apply_metadata(entity, d)?, + _ => {} + } + Ok(()) + } +} + +/// The metadata bundle for [Silverfish]. +/// +/// This type should generally not be used directly. +#[derive(Bundle)] +pub struct SilverfishMetadataBundle { + _marker: Silverfish, + parent: AbstractMonsterMetadataBundle, +} +impl Default for SilverfishMetadataBundle { + fn default() -> Self { + Self { + _marker: Silverfish, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - abstract_ageable_baby: AbstractAgeableBaby(false), }, }, - sniffer_state: SnifferState(Default::default()), - drop_seed_at_tick: DropSeedAtTick(0), } } } -#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)] -pub struct HasPumpkin(pub bool); +/// A metadata field for [Skeleton]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct StrayConversion(pub bool); +/// The marker component for entities of type `minecraft:skeleton`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Skeleton` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [StrayConversion] +/// +/// # Parents +/// +/// Entities with `Skeleton` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct SnowGolem; -impl SnowGolem { +pub struct Skeleton; +impl Skeleton { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractCreature::apply_metadata(entity, d)?, + 0..=15 => AbstractMonster::apply_metadata(entity, d)?, 16 => { - let bitfield = d.value.into_byte()?; - entity.insert(HasPumpkin(bitfield & 0x10 != 0)); + entity.insert(StrayConversion(d.value.into_boolean()?)); } _ => {} } @@ -8837,220 +13171,387 @@ impl SnowGolem { } } +/// The metadata bundle for [Skeleton]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct SnowGolemMetadataBundle { - _marker: SnowGolem, - parent: AbstractCreatureMetadataBundle, - has_pumpkin: HasPumpkin, +pub struct SkeletonMetadataBundle { + _marker: Skeleton, + parent: AbstractMonsterMetadataBundle, + stray_conversion: StrayConversion, } -impl Default for SnowGolemMetadataBundle { +impl Default for SkeletonMetadataBundle { fn default() -> Self { Self { - _marker: SnowGolem, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Skeleton, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), }, }, - has_pumpkin: HasPumpkin(true), + stray_conversion: StrayConversion(false), } } } +#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)] +/// A metadata field for [Spider]. +pub struct Climbing(pub bool); +/// The marker component for entities of type `minecraft:spider`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Spider` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [Climbing] +/// +/// # Parents +/// +/// Entities with `Spider` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [CaveSpider] #[derive(Component)] -pub struct Snowball; -impl Snowball { +pub struct Spider; +impl Spider { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?, + 0..=15 => AbstractMonster::apply_metadata(entity, d)?, + 16 => { + let bitfield = d.value.into_byte()?; + entity.insert(Climbing(bitfield & 0x1 != 0)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Spider]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct SnowballMetadataBundle { - _marker: Snowball, - parent: AbstractThrownItemProjectileMetadataBundle, +pub struct SpiderMetadataBundle { + _marker: Spider, + parent: AbstractMonsterMetadataBundle, + climbing: Climbing, } -impl Default for SnowballMetadataBundle { +impl Default for SpiderMetadataBundle { fn default() -> Self { Self { - _marker: Snowball, - parent: AbstractThrownItemProjectileMetadataBundle { - _marker: AbstractThrownItemProjectile, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Spider, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, }, - abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack( - Default::default(), - ), }, + climbing: Climbing(false), } } } +/// The marker component for entities of type `minecraft:cave_spider`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `CaveSpider` will also have the following marker components +/// and their metadata fields: +/// +/// - [Spider] +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct SpawnerMinecart; -impl SpawnerMinecart { +pub struct CaveSpider; +impl CaveSpider { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=12 => AbstractMinecart::apply_metadata(entity, d)?, + 0..=16 => Spider::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [CaveSpider]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct SpawnerMinecartMetadataBundle { - _marker: SpawnerMinecart, - parent: AbstractMinecartMetadataBundle, +pub struct CaveSpiderMetadataBundle { + _marker: CaveSpider, + parent: SpiderMetadataBundle, } -impl Default for SpawnerMinecartMetadataBundle { +impl Default for CaveSpiderMetadataBundle { fn default() -> Self { Self { - _marker: SpawnerMinecart, - parent: AbstractMinecartMetadataBundle { - _marker: AbstractMinecart, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: CaveSpider, + parent: SpiderMetadataBundle { + _marker: Spider, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), }, - custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR), - display_offset: DisplayOffset(Default::default()), + climbing: Climbing(false), }, } } } +/// The marker component for entities of type `minecraft:stray`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Stray` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct SpectralArrow; -impl SpectralArrow { +pub struct Stray; +impl Stray { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=10 => AbstractArrow::apply_metadata(entity, d)?, + 0..=15 => AbstractMonster::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [Stray]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct SpectralArrowMetadataBundle { - _marker: SpectralArrow, - parent: AbstractArrowMetadataBundle, +pub struct StrayMetadataBundle { + _marker: Stray, + parent: AbstractMonsterMetadataBundle, } -impl Default for SpectralArrowMetadataBundle { +impl Default for StrayMetadataBundle { fn default() -> Self { Self { - _marker: SpectralArrow, - parent: AbstractArrowMetadataBundle { - _marker: AbstractArrow, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Stray, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, }, - crit_arrow: CritArrow(false), - no_physics: NoPhysics(false), - pierce_level: PierceLevel(0), - in_ground: InGround(false), }, } } } +/// A metadata field for [Vex]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct VexFlags(pub u8); +/// The marker component for entities of type `minecraft:vex`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Vex` entities are guaranteed to +/// have, in addition to the metadata components from parent types: +/// +/// - [VexFlags] +/// +/// # Parents +/// +/// Entities with `Vex` will also have the following marker components and their +/// metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Spider; -impl Spider { +pub struct Vex; +impl Vex { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, @@ -9058,8 +13559,7 @@ impl Spider { match d.index { 0..=15 => AbstractMonster::apply_metadata(entity, d)?, 16 => { - let bitfield = d.value.into_byte()?; - entity.insert(Climbing(bitfield & 0x1 != 0)); + entity.insert(VexFlags(d.value.into_byte()?)); } _ => {} } @@ -9067,16 +13567,19 @@ impl Spider { } } +/// The metadata bundle for [Vex]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct SpiderMetadataBundle { - _marker: Spider, +pub struct VexMetadataBundle { + _marker: Vex, parent: AbstractMonsterMetadataBundle, - climbing: Climbing, + vex_flags: VexFlags, } -impl Default for SpiderMetadataBundle { +impl Default for VexMetadataBundle { fn default() -> Self { Self { - _marker: Spider, + _marker: Vex, parent: AbstractMonsterMetadataBundle { _marker: AbstractMonster, parent: AbstractCreatureMetadataBundle { @@ -9117,202 +13620,393 @@ impl Default for SpiderMetadataBundle { }, }, }, - climbing: Climbing(false), + vex_flags: VexFlags(0), } } } +/// A metadata field for [Warden]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ClientAngerLevel(pub i32); +/// The marker component for entities of type `minecraft:warden`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Warden` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [ClientAngerLevel] +/// +/// # Parents +/// +/// Entities with `Warden` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct SplashPotion; -impl SplashPotion { +pub struct Warden; +impl Warden { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?, + 0..=15 => AbstractMonster::apply_metadata(entity, d)?, + 16 => { + entity.insert(ClientAngerLevel(d.value.into_int()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Warden]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct SplashPotionMetadataBundle { - _marker: SplashPotion, - parent: AbstractThrownItemProjectileMetadataBundle, +pub struct WardenMetadataBundle { + _marker: Warden, + parent: AbstractMonsterMetadataBundle, + client_anger_level: ClientAngerLevel, } -impl Default for SplashPotionMetadataBundle { +impl Default for WardenMetadataBundle { fn default() -> Self { Self { - _marker: SplashPotion, - parent: AbstractThrownItemProjectileMetadataBundle { - _marker: AbstractThrownItemProjectile, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Warden, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, }, - abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack( - Default::default(), - ), }, + client_anger_level: ClientAngerLevel(0), } } } +/// A metadata field for [Wither]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct TargetA(pub i32); +/// A metadata field for [Wither]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct TargetB(pub i32); +/// A metadata field for [Wither]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct TargetC(pub i32); +/// A metadata field for [Wither]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Inv(pub i32); +/// The marker component for entities of type `minecraft:wither`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Wither` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [TargetA] +/// - [TargetB] +/// - [TargetC] +/// - [Inv] +/// +/// # Parents +/// +/// Entities with `Wither` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct SpruceBoat; -impl SpruceBoat { +pub struct Wither; +impl Wither { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + 0..=15 => AbstractMonster::apply_metadata(entity, d)?, + 16 => { + entity.insert(TargetA(d.value.into_int()?)); + } + 17 => { + entity.insert(TargetB(d.value.into_int()?)); + } + 18 => { + entity.insert(TargetC(d.value.into_int()?)); + } + 19 => { + entity.insert(Inv(d.value.into_int()?)); + } _ => {} } Ok(()) } -} - -#[derive(Bundle)] -pub struct SpruceBoatMetadataBundle { - _marker: SpruceBoat, - parent: AbstractBoatMetadataBundle, -} -impl Default for SpruceBoatMetadataBundle { - fn default() -> Self { - Self { - _marker: SpruceBoat, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), +} + +/// The metadata bundle for [Wither]. +/// +/// This type should generally not be used directly. +#[derive(Bundle)] +pub struct WitherMetadataBundle { + _marker: Wither, + parent: AbstractMonsterMetadataBundle, + target_a: TargetA, + target_b: TargetB, + target_c: TargetC, + inv: Inv, +} +impl Default for WitherMetadataBundle { + fn default() -> Self { + Self { + _marker: Wither, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), }, + target_a: TargetA(0), + target_b: TargetB(0), + target_c: TargetC(0), + inv: Inv(0), } } } +/// The marker component for entities of type `minecraft:wither_skeleton`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `WitherSkeleton` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct SpruceChestBoat; -impl SpruceChestBoat { +pub struct WitherSkeleton; +impl WitherSkeleton { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + 0..=15 => AbstractMonster::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [WitherSkeleton]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct SpruceChestBoatMetadataBundle { - _marker: SpruceChestBoat, - parent: AbstractBoatMetadataBundle, +pub struct WitherSkeletonMetadataBundle { + _marker: WitherSkeleton, + parent: AbstractMonsterMetadataBundle, } -impl Default for SpruceChestBoatMetadataBundle { +impl Default for WitherSkeletonMetadataBundle { fn default() -> Self { Self { - _marker: SpruceChestBoat, - parent: AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: WitherSkeleton, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), }, } } } +/// A metadata field for [Zoglin]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ZoglinBaby(pub bool); +/// The marker component for entities of type `minecraft:zoglin`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Zoglin` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [ZoglinBaby] +/// +/// # Parents +/// +/// Entities with `Zoglin` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Squid; -impl Squid { +pub struct Zoglin; +impl Zoglin { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAgeable::apply_metadata(entity, d)?, + 0..=15 => AbstractMonster::apply_metadata(entity, d)?, + 16 => { + entity.insert(ZoglinBaby(d.value.into_boolean()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Zoglin]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct SquidMetadataBundle { - _marker: Squid, - parent: AbstractAgeableMetadataBundle, +pub struct ZoglinMetadataBundle { + _marker: Zoglin, + parent: AbstractMonsterMetadataBundle, + zoglin_baby: ZoglinBaby, } -impl Default for SquidMetadataBundle { +impl Default for ZoglinMetadataBundle { fn default() -> Self { Self { - _marker: Squid, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, + _marker: Zoglin, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, parent: AbstractCreatureMetadataBundle { _marker: AbstractCreature, parent: AbstractInsentientMetadataBundle { @@ -9350,36 +14044,88 @@ impl Default for SquidMetadataBundle { aggressive: Aggressive(false), }, }, - abstract_ageable_baby: AbstractAgeableBaby(false), }, + zoglin_baby: ZoglinBaby(false), } } } +/// A metadata field for [Zombie]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ZombieBaby(pub bool); +/// A metadata field for [Zombie]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct SpecialType(pub i32); +/// A metadata field for [Zombie]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct DrownedConversion(pub bool); +/// The marker component for entities of type `minecraft:zombie`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Zombie` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [ZombieBaby] +/// - [SpecialType] +/// - [DrownedConversion] +/// +/// # Parents +/// +/// Entities with `Zombie` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [Drowned] +/// - [Husk] +/// - [ZombieVillager] +/// - [ZombifiedPiglin] #[derive(Component)] -pub struct Stray; -impl Stray { +pub struct Zombie; +impl Zombie { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { 0..=15 => AbstractMonster::apply_metadata(entity, d)?, + 16 => { + entity.insert(ZombieBaby(d.value.into_boolean()?)); + } + 17 => { + entity.insert(SpecialType(d.value.into_int()?)); + } + 18 => { + entity.insert(DrownedConversion(d.value.into_boolean()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Zombie]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct StrayMetadataBundle { - _marker: Stray, +pub struct ZombieMetadataBundle { + _marker: Zombie, parent: AbstractMonsterMetadataBundle, + zombie_baby: ZombieBaby, + special_type: SpecialType, + drowned_conversion: DrownedConversion, } -impl Default for StrayMetadataBundle { +impl Default for ZombieMetadataBundle { fn default() -> Self { Self { - _marker: Stray, + _marker: Zombie, parent: AbstractMonsterMetadataBundle { _marker: AbstractMonster, parent: AbstractCreatureMetadataBundle { @@ -9405,65 +14151,182 @@ impl Default for StrayMetadataBundle { pose: Pose::default(), ticks_frozen: TicksFrozen(Default::default()), }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + }, + zombie_baby: ZombieBaby(false), + special_type: SpecialType(0), + drowned_conversion: DrownedConversion(false), + } + } +} + +/// The marker component for entities of type `minecraft:drowned`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Drowned` will also have the following marker components and +/// their metadata fields: +/// +/// - [Zombie] +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. +#[derive(Component)] +pub struct Drowned; +impl Drowned { + pub fn apply_metadata( + entity: &mut bevy_ecs::system::EntityCommands, + d: EntityDataItem, + ) -> Result<(), UpdateMetadataError> { + match d.index { + 0..=18 => Zombie::apply_metadata(entity, d)?, + _ => {} + } + Ok(()) + } +} + +/// The metadata bundle for [Drowned]. +/// +/// This type should generally not be used directly. +#[derive(Bundle)] +pub struct DrownedMetadataBundle { + _marker: Drowned, + parent: ZombieMetadataBundle, +} +impl Default for DrownedMetadataBundle { + fn default() -> Self { + Self { + _marker: Drowned, + parent: ZombieMetadataBundle { + _marker: Zombie, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), }, }, + zombie_baby: ZombieBaby(false), + special_type: SpecialType(0), + drowned_conversion: DrownedConversion(false), }, } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct StriderBoostTime(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Suffocating(pub bool); +/// The marker component for entities of type `minecraft:husk`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Husk` will also have the following marker components and +/// their metadata fields: +/// +/// - [Zombie] +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Strider; -impl Strider { +pub struct Husk; +impl Husk { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, - 17 => { - entity.insert(StriderBoostTime(d.value.into_int()?)); - } - 18 => { - entity.insert(Suffocating(d.value.into_boolean()?)); - } + 0..=18 => Zombie::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [Husk]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct StriderMetadataBundle { - _marker: Strider, - parent: AbstractAnimalMetadataBundle, - strider_boost_time: StriderBoostTime, - suffocating: Suffocating, +pub struct HuskMetadataBundle { + _marker: Husk, + parent: ZombieMetadataBundle, } -impl Default for StriderMetadataBundle { +impl Default for HuskMetadataBundle { fn default() -> Self { Self { - _marker: Strider, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, + _marker: Husk, + parent: ZombieMetadataBundle { + _marker: Zombie, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, parent: AbstractCreatureMetadataBundle { _marker: AbstractCreature, parent: AbstractInsentientMetadataBundle { @@ -9503,28 +14366,61 @@ impl Default for StriderMetadataBundle { aggressive: Aggressive(false), }, }, - abstract_ageable_baby: AbstractAgeableBaby(false), }, + zombie_baby: ZombieBaby(false), + special_type: SpecialType(0), + drowned_conversion: DrownedConversion(false), }, - strider_boost_time: StriderBoostTime(0), - suffocating: Suffocating(false), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct TadpoleFromBucket(pub bool); +/// A metadata field for [ZombieVillager]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Converting(pub bool); +/// A metadata field for [ZombieVillager]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct ZombieVillagerVillagerData(pub VillagerData); +/// The marker component for entities of type `minecraft:zombie_villager`. +/// +/// # Metadata +/// +/// These are the metadata components that all `ZombieVillager` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [Converting] +/// - [ZombieVillagerVillagerData] +/// +/// # Parents +/// +/// Entities with `ZombieVillager` will also have the following marker +/// components and their metadata fields: +/// +/// - [Zombie] +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Tadpole; -impl Tadpole { +pub struct ZombieVillager; +impl ZombieVillager { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractCreature::apply_metadata(entity, d)?, - 16 => { - entity.insert(TadpoleFromBucket(d.value.into_boolean()?)); + 0..=18 => Zombie::apply_metadata(entity, d)?, + 19 => { + entity.insert(Converting(d.value.into_boolean()?)); + } + 20 => { + entity.insert(ZombieVillagerVillagerData(d.value.into_villager_data()?)); } _ => {} } @@ -9532,193 +14428,218 @@ impl Tadpole { } } +/// The metadata bundle for [ZombieVillager]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct TadpoleMetadataBundle { - _marker: Tadpole, - parent: AbstractCreatureMetadataBundle, - tadpole_from_bucket: TadpoleFromBucket, +pub struct ZombieVillagerMetadataBundle { + _marker: ZombieVillager, + parent: ZombieMetadataBundle, + converting: Converting, + zombie_villager_villager_data: ZombieVillagerVillagerData, } -impl Default for TadpoleMetadataBundle { +impl Default for ZombieVillagerMetadataBundle { fn default() -> Self { Self { - _marker: Tadpole, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: ZombieVillager, + parent: ZombieMetadataBundle { + _marker: Zombie, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), }, + zombie_baby: ZombieBaby(false), + special_type: SpecialType(0), + drowned_conversion: DrownedConversion(false), }, - tadpole_from_bucket: TadpoleFromBucket(false), + converting: Converting(false), + zombie_villager_villager_data: ZombieVillagerVillagerData(VillagerData { + kind: azalea_registry::builtin::VillagerKind::Plains, + profession: azalea_registry::builtin::VillagerProfession::None, + level: 0, + }), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Text(pub FormattedText); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct LineWidth(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct BackgroundColor(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct TextOpacity(pub u8); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct StyleFlags(pub u8); +/// The marker component for entities of type `minecraft:zombified_piglin`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `ZombifiedPiglin` will also have the following marker +/// components and their metadata fields: +/// +/// - [Zombie] +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct TextDisplay; -impl TextDisplay { +pub struct ZombifiedPiglin; +impl ZombifiedPiglin { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=22 => AbstractDisplay::apply_metadata(entity, d)?, - 23 => { - entity.insert(Text(d.value.into_formatted_text()?)); - } - 24 => { - entity.insert(LineWidth(d.value.into_int()?)); - } - 25 => { - entity.insert(BackgroundColor(d.value.into_int()?)); - } - 26 => { - entity.insert(TextOpacity(d.value.into_byte()?)); - } - 27 => { - entity.insert(StyleFlags(d.value.into_byte()?)); - } + 0..=18 => Zombie::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [ZombifiedPiglin]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct TextDisplayMetadataBundle { - _marker: TextDisplay, - parent: AbstractDisplayMetadataBundle, - text: Text, - line_width: LineWidth, - background_color: BackgroundColor, - text_opacity: TextOpacity, - style_flags: StyleFlags, +pub struct ZombifiedPiglinMetadataBundle { + _marker: ZombifiedPiglin, + parent: ZombieMetadataBundle, } -impl Default for TextDisplayMetadataBundle { +impl Default for ZombifiedPiglinMetadataBundle { fn default() -> Self { Self { - _marker: TextDisplay, - parent: AbstractDisplayMetadataBundle { - _marker: AbstractDisplay, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: ZombifiedPiglin, + parent: ZombieMetadataBundle { + _marker: Zombie, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, }, - transformation_interpolation_start_delta_ticks: - TransformationInterpolationStartDeltaTicks(0), - transformation_interpolation_duration: TransformationInterpolationDuration(0), - pos_rot_interpolation_duration: PosRotInterpolationDuration(0), - translation: Translation(Vec3f32 { - x: 0.0, - y: 0.0, - z: 0.0, - }), - scale: Scale(Vec3f32 { - x: 1.0, - y: 1.0, - z: 1.0, - }), - left_rotation: LeftRotation(Quaternion { - x: 0.0, - y: 0.0, - z: 0.0, - w: 1.0, - }), - right_rotation: RightRotation(Quaternion { - x: 0.0, - y: 0.0, - z: 0.0, - w: 1.0, - }), - billboard_render_constraints: BillboardRenderConstraints(Default::default()), - brightness_override: BrightnessOverride(-1), - view_range: ViewRange(1.0), - shadow_radius: ShadowRadius(0.0), - shadow_strength: ShadowStrength(1.0), - abstract_display_width: AbstractDisplayWidth(0.0), - abstract_display_height: AbstractDisplayHeight(0.0), - glow_color_override: GlowColorOverride(-1), + zombie_baby: ZombieBaby(false), + special_type: SpecialType(0), + drowned_conversion: DrownedConversion(false), }, - text: Text(Default::default()), - line_width: LineWidth(200), - background_color: BackgroundColor(1073741824), - text_opacity: TextOpacity(127), - style_flags: StyleFlags(0), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Fuse(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct TntBlockState(pub azalea_block::BlockState); +/// A metadata field for [AbstractPiglin]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct AbstractPiglinImmuneToZombification(pub bool); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// These are the metadata components that all `AbstractPiglin` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [AbstractPiglinImmuneToZombification] +/// +/// # Parents +/// +/// Entities with `AbstractPiglin` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [Piglin] +/// - [PiglinBrute] #[derive(Component)] -pub struct Tnt; -impl Tnt { +pub struct AbstractPiglin; +impl AbstractPiglin { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - 8 => { - entity.insert(Fuse(d.value.into_int()?)); - } - 9 => { - entity.insert(TntBlockState(d.value.into_block_state()?)); + 0..=15 => AbstractMonster::apply_metadata(entity, d)?, + 16 => { + entity.insert(AbstractPiglinImmuneToZombification(d.value.into_boolean()?)); } _ => {} } @@ -9726,268 +14647,334 @@ impl Tnt { } } +/// The metadata bundle for [AbstractPiglin]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct TntMetadataBundle { - _marker: Tnt, - parent: AbstractEntityMetadataBundle, - fuse: Fuse, - tnt_block_state: TntBlockState, +pub struct AbstractPiglinMetadataBundle { + _marker: AbstractPiglin, + parent: AbstractMonsterMetadataBundle, + abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification, } -impl Default for TntMetadataBundle { +impl Default for AbstractPiglinMetadataBundle { fn default() -> Self { Self { - _marker: Tnt, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: AbstractPiglin, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, }, - fuse: Fuse(80), - tnt_block_state: TntBlockState(Default::default()), + abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification(false), } } } +/// A metadata field for [Piglin]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PiglinBaby(pub bool); +/// A metadata field for [Piglin]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PiglinIsChargingCrossbow(pub bool); +/// A metadata field for [Piglin]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct IsDancing(pub bool); +/// The marker component for entities of type `minecraft:piglin`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Piglin` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [PiglinBaby] +/// - [PiglinIsChargingCrossbow] +/// - [IsDancing] +/// +/// # Parents +/// +/// Entities with `Piglin` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractPiglin] +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct TntMinecart; -impl TntMinecart { +pub struct Piglin; +impl Piglin { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=12 => AbstractMinecart::apply_metadata(entity, d)?, + 0..=16 => AbstractPiglin::apply_metadata(entity, d)?, + 17 => { + entity.insert(PiglinBaby(d.value.into_boolean()?)); + } + 18 => { + entity.insert(PiglinIsChargingCrossbow(d.value.into_boolean()?)); + } + 19 => { + entity.insert(IsDancing(d.value.into_boolean()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [Piglin]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct TntMinecartMetadataBundle { - _marker: TntMinecart, - parent: AbstractMinecartMetadataBundle, +pub struct PiglinMetadataBundle { + _marker: Piglin, + parent: AbstractPiglinMetadataBundle, + piglin_baby: PiglinBaby, + piglin_is_charging_crossbow: PiglinIsChargingCrossbow, + is_dancing: IsDancing, } -impl Default for TntMinecartMetadataBundle { +impl Default for PiglinMetadataBundle { fn default() -> Self { Self { - _marker: TntMinecart, - parent: AbstractMinecartMetadataBundle { - _marker: AbstractMinecart, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Piglin, + parent: AbstractPiglinMetadataBundle { + _marker: AbstractPiglin, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), }, - custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR), - display_offset: DisplayOffset(Default::default()), + abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification(false), }, + piglin_baby: PiglinBaby(false), + piglin_is_charging_crossbow: PiglinIsChargingCrossbow(false), + is_dancing: IsDancing(false), } } } +/// The marker component for entities of type `minecraft:piglin_brute`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `PiglinBrute` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractPiglin] +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct TraderLlama; -impl TraderLlama { +pub struct PiglinBrute; +impl PiglinBrute { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=20 => Llama::apply_metadata(entity, d)?, + 0..=16 => AbstractPiglin::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [PiglinBrute]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct TraderLlamaMetadataBundle { - _marker: TraderLlama, - parent: LlamaMetadataBundle, +pub struct PiglinBruteMetadataBundle { + _marker: PiglinBrute, + parent: AbstractPiglinMetadataBundle, } -impl Default for TraderLlamaMetadataBundle { +impl Default for PiglinBruteMetadataBundle { fn default() -> Self { Self { - _marker: TraderLlama, - parent: LlamaMetadataBundle { - _marker: Llama, - parent: AbstractChestedHorseMetadataBundle { - _marker: AbstractChestedHorse, - parent: AbstractHorseMetadataBundle { - _marker: AbstractHorse, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: - AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible( - Default::default(), - ), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem( - false, - ), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, + _marker: PiglinBrute, + parent: AbstractPiglinMetadataBundle { + _marker: AbstractPiglin, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - abstract_ageable_baby: AbstractAgeableBaby(false), + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - tamed: Tamed(false), - eating: Eating(false), - abstract_horse_standing: AbstractHorseStanding(false), - bred: Bred(false), }, - chest: Chest(false), - }, - strength: Strength(0), - llama_variant: LlamaVariant(0), - }, - } - } -} - -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Loyalty(pub u8); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Foil(pub bool); -#[derive(Component)] -pub struct Trident; -impl Trident { - pub fn apply_metadata( - entity: &mut bevy_ecs::system::EntityCommands, - d: EntityDataItem, - ) -> Result<(), UpdateMetadataError> { - match d.index { - 0..=10 => AbstractArrow::apply_metadata(entity, d)?, - 11 => { - entity.insert(Loyalty(d.value.into_byte()?)); - } - 12 => { - entity.insert(Foil(d.value.into_boolean()?)); - } - _ => {} - } - Ok(()) - } -} - -#[derive(Bundle)] -pub struct TridentMetadataBundle { - _marker: Trident, - parent: AbstractArrowMetadataBundle, - loyalty: Loyalty, - foil: Foil, -} -impl Default for TridentMetadataBundle { - fn default() -> Self { - Self { - _marker: Trident, - parent: AbstractArrowMetadataBundle { - _marker: AbstractArrow, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), }, - crit_arrow: CritArrow(false), - no_physics: NoPhysics(false), - pierce_level: PierceLevel(0), - in_ground: InGround(false), + abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification(false), }, - loyalty: Loyalty(0), - foil: Foil(false), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct TropicalFishTypeVariant(pub i32); +/// A metadata field for [AbstractRaider]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct IsCelebrating(pub bool); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// These are the metadata components that all `AbstractRaider` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [IsCelebrating] +/// +/// # Parents +/// +/// Entities with `AbstractRaider` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [Pillager] +/// - [Ravager] +/// - [Vindicator] +/// - [Witch] +/// - [AbstractSpellcasterIllager] +/// - [Evoker] +/// - [Illusioner] #[derive(Component)] -pub struct TropicalFish; -impl TropicalFish { +pub struct AbstractRaider; +impl AbstractRaider { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractFish::apply_metadata(entity, d)?, - 17 => { - entity.insert(TropicalFishTypeVariant(d.value.into_int()?)); + 0..=15 => AbstractMonster::apply_metadata(entity, d)?, + 16 => { + entity.insert(IsCelebrating(d.value.into_boolean()?)); } _ => {} } @@ -9995,18 +14982,21 @@ impl TropicalFish { } } +/// The metadata bundle for [AbstractRaider]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct TropicalFishMetadataBundle { - _marker: TropicalFish, - parent: AbstractFishMetadataBundle, - tropical_fish_type_variant: TropicalFishTypeVariant, +pub struct AbstractRaiderMetadataBundle { + _marker: AbstractRaider, + parent: AbstractMonsterMetadataBundle, + is_celebrating: IsCelebrating, } -impl Default for TropicalFishMetadataBundle { +impl Default for AbstractRaiderMetadataBundle { fn default() -> Self { Self { - _marker: TropicalFish, - parent: AbstractFishMetadataBundle { - _marker: AbstractFish, + _marker: AbstractRaider, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, parent: AbstractCreatureMetadataBundle { _marker: AbstractCreature, parent: AbstractInsentientMetadataBundle { @@ -10030,67 +15020,189 @@ impl Default for TropicalFishMetadataBundle { pose: Pose::default(), ticks_frozen: TicksFrozen(Default::default()), }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + }, + is_celebrating: IsCelebrating(false), + } + } +} + +/// A metadata field for [Pillager]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PillagerIsChargingCrossbow(pub bool); +/// The marker component for entities of type `minecraft:pillager`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Pillager` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [PillagerIsChargingCrossbow] +/// +/// # Parents +/// +/// Entities with `Pillager` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractRaider] +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. +#[derive(Component)] +pub struct Pillager; +impl Pillager { + pub fn apply_metadata( + entity: &mut bevy_ecs::system::EntityCommands, + d: EntityDataItem, + ) -> Result<(), UpdateMetadataError> { + match d.index { + 0..=16 => AbstractRaider::apply_metadata(entity, d)?, + 17 => { + entity.insert(PillagerIsChargingCrossbow(d.value.into_boolean()?)); + } + _ => {} + } + Ok(()) + } +} + +/// The metadata bundle for [Pillager]. +/// +/// This type should generally not be used directly. +#[derive(Bundle)] +pub struct PillagerMetadataBundle { + _marker: Pillager, + parent: AbstractRaiderMetadataBundle, + pillager_is_charging_crossbow: PillagerIsChargingCrossbow, +} +impl Default for PillagerMetadataBundle { + fn default() -> Self { + Self { + _marker: Pillager, + parent: AbstractRaiderMetadataBundle { + _marker: AbstractRaider, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), }, }, - abstract_fish_from_bucket: AbstractFishFromBucket(false), + is_celebrating: IsCelebrating(false), }, - tropical_fish_type_variant: TropicalFishTypeVariant(Default::default()), + pillager_is_charging_crossbow: PillagerIsChargingCrossbow(false), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct HasEgg(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct LayingEgg(pub bool); +/// The marker component for entities of type `minecraft:ravager`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Ravager` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractRaider] +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Turtle; -impl Turtle { +pub struct Ravager; +impl Ravager { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, - 17 => { - entity.insert(HasEgg(d.value.into_boolean()?)); - } - 18 => { - entity.insert(LayingEgg(d.value.into_boolean()?)); - } + 0..=16 => AbstractRaider::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [Ravager]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct TurtleMetadataBundle { - _marker: Turtle, - parent: AbstractAnimalMetadataBundle, - has_egg: HasEgg, - laying_egg: LayingEgg, +pub struct RavagerMetadataBundle { + _marker: Ravager, + parent: AbstractRaiderMetadataBundle, } -impl Default for TurtleMetadataBundle { +impl Default for RavagerMetadataBundle { fn default() -> Self { Self { - _marker: Turtle, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, + _marker: Ravager, + parent: AbstractRaiderMetadataBundle { + _marker: AbstractRaider, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, parent: AbstractCreatureMetadataBundle { _marker: AbstractCreature, parent: AbstractInsentientMetadataBundle { @@ -10130,105 +15242,150 @@ impl Default for TurtleMetadataBundle { aggressive: Aggressive(false), }, }, - abstract_ageable_baby: AbstractAgeableBaby(false), }, + is_celebrating: IsCelebrating(false), }, - has_egg: HasEgg(false), - laying_egg: LayingEgg(false), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct VexFlags(pub u8); +/// The marker component for entities of type `minecraft:vindicator`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Vindicator` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractRaider] +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Vex; -impl Vex { +pub struct Vindicator; +impl Vindicator { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractMonster::apply_metadata(entity, d)?, - 16 => { - entity.insert(VexFlags(d.value.into_byte()?)); - } + 0..=16 => AbstractRaider::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [Vindicator]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct VexMetadataBundle { - _marker: Vex, - parent: AbstractMonsterMetadataBundle, - vex_flags: VexFlags, +pub struct VindicatorMetadataBundle { + _marker: Vindicator, + parent: AbstractRaiderMetadataBundle, } -impl Default for VexMetadataBundle { +impl Default for VindicatorMetadataBundle { fn default() -> Self { Self { - _marker: Vex, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Vindicator, + parent: AbstractRaiderMetadataBundle { + _marker: AbstractRaider, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), }, }, + is_celebrating: IsCelebrating(false), }, - vex_flags: VexFlags(0), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct AbstractVillagerUnhappyCounter(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct VillagerVillagerData(pub VillagerData); +/// A metadata field for [Witch]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct WitchUsingItem(pub bool); +/// The marker component for entities of type `minecraft:witch`. +/// +/// # Metadata +/// +/// These are the metadata components that all `Witch` entities are guaranteed +/// to have, in addition to the metadata components from parent types: +/// +/// - [WitchUsingItem] +/// +/// # Parents +/// +/// Entities with `Witch` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractRaider] +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Villager; -impl Villager { +pub struct Witch; +impl Witch { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=17 => AbstractVillager::apply_metadata(entity, d)?, - 18 => { - entity.insert(VillagerVillagerData(d.value.into_villager_data()?)); + 0..=16 => AbstractRaider::apply_metadata(entity, d)?, + 17 => { + entity.insert(WitchUsingItem(d.value.into_boolean()?)); } _ => {} } @@ -10236,20 +15393,23 @@ impl Villager { } } +/// The metadata bundle for [Witch]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct VillagerMetadataBundle { - _marker: Villager, - parent: AbstractVillagerMetadataBundle, - villager_villager_data: VillagerVillagerData, +pub struct WitchMetadataBundle { + _marker: Witch, + parent: AbstractRaiderMetadataBundle, + witch_using_item: WitchUsingItem, } -impl Default for VillagerMetadataBundle { +impl Default for WitchMetadataBundle { fn default() -> Self { Self { - _marker: Villager, - parent: AbstractVillagerMetadataBundle { - _marker: AbstractVillager, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, + _marker: Witch, + parent: AbstractRaiderMetadataBundle { + _marker: AbstractRaider, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, parent: AbstractCreatureMetadataBundle { _marker: AbstractCreature, parent: AbstractInsentientMetadataBundle { @@ -10289,43 +15449,74 @@ impl Default for VillagerMetadataBundle { aggressive: Aggressive(false), }, }, - abstract_ageable_baby: AbstractAgeableBaby(false), }, - abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter(0), + is_celebrating: IsCelebrating(false), }, - villager_villager_data: VillagerVillagerData(VillagerData { - kind: azalea_registry::builtin::VillagerKind::Plains, - profession: azalea_registry::builtin::VillagerProfession::None, - level: 0, - }), + witch_using_item: WitchUsingItem(false), } } } +/// A metadata field for [AbstractSpellcasterIllager]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct SpellCasting(pub u8); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// These are the metadata components that all `AbstractSpellcasterIllager` +/// entities are guaranteed to have, in addition to the metadata components from +/// parent types: +/// +/// - [SpellCasting] +/// +/// # Parents +/// +/// Entities with `AbstractSpellcasterIllager` will also have the following +/// marker components and their metadata fields: +/// +/// - [AbstractRaider] +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [Evoker] +/// - [Illusioner] #[derive(Component)] -pub struct Vindicator; -impl Vindicator { +pub struct AbstractSpellcasterIllager; +impl AbstractSpellcasterIllager { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { 0..=16 => AbstractRaider::apply_metadata(entity, d)?, + 17 => { + entity.insert(SpellCasting(d.value.into_byte()?)); + } _ => {} } Ok(()) } } +/// The metadata bundle for [AbstractSpellcasterIllager]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct VindicatorMetadataBundle { - _marker: Vindicator, +pub struct AbstractSpellcasterIllagerMetadataBundle { + _marker: AbstractSpellcasterIllager, parent: AbstractRaiderMetadataBundle, + spell_casting: SpellCasting, } -impl Default for VindicatorMetadataBundle { +impl Default for AbstractSpellcasterIllagerMetadataBundle { fn default() -> Self { Self { - _marker: Vindicator, + _marker: AbstractSpellcasterIllager, parent: AbstractRaiderMetadataBundle { _marker: AbstractRaider, parent: AbstractMonsterMetadataBundle { @@ -10372,455 +15563,798 @@ impl Default for VindicatorMetadataBundle { }, is_celebrating: IsCelebrating(false), }, + spell_casting: SpellCasting(0), } } } +/// The marker component for entities of type `minecraft:evoker`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Evoker` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractSpellcasterIllager] +/// - [AbstractRaider] +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct WanderingTrader; -impl WanderingTrader { +pub struct Evoker; +impl Evoker { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=17 => AbstractVillager::apply_metadata(entity, d)?, + 0..=17 => AbstractSpellcasterIllager::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [Evoker]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct WanderingTraderMetadataBundle { - _marker: WanderingTrader, - parent: AbstractVillagerMetadataBundle, +pub struct EvokerMetadataBundle { + _marker: Evoker, + parent: AbstractSpellcasterIllagerMetadataBundle, } -impl Default for WanderingTraderMetadataBundle { +impl Default for EvokerMetadataBundle { fn default() -> Self { Self { - _marker: WanderingTrader, - parent: AbstractVillagerMetadataBundle { - _marker: AbstractVillager, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Evoker, + parent: AbstractSpellcasterIllagerMetadataBundle { + _marker: AbstractSpellcasterIllager, + parent: AbstractRaiderMetadataBundle { + _marker: AbstractRaider, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), }, }, - abstract_ageable_baby: AbstractAgeableBaby(false), + is_celebrating: IsCelebrating(false), + }, + spell_casting: SpellCasting(0), + }, + } + } +} + +/// The marker component for entities of type `minecraft:illusioner`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Illusioner` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractSpellcasterIllager] +/// - [AbstractRaider] +/// - [AbstractMonster] +/// - [AbstractCreature] +/// - [AbstractInsentient] +/// - [AbstractLiving] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. +#[derive(Component)] +pub struct Illusioner; +impl Illusioner { + pub fn apply_metadata( + entity: &mut bevy_ecs::system::EntityCommands, + d: EntityDataItem, + ) -> Result<(), UpdateMetadataError> { + match d.index { + 0..=17 => AbstractSpellcasterIllager::apply_metadata(entity, d)?, + _ => {} + } + Ok(()) + } +} + +/// The metadata bundle for [Illusioner]. +/// +/// This type should generally not be used directly. +#[derive(Bundle)] +pub struct IllusionerMetadataBundle { + _marker: Illusioner, + parent: AbstractSpellcasterIllagerMetadataBundle, +} +impl Default for IllusionerMetadataBundle { + fn default() -> Self { + Self { + _marker: Illusioner, + parent: AbstractSpellcasterIllagerMetadataBundle { + _marker: AbstractSpellcasterIllager, + parent: AbstractRaiderMetadataBundle { + _marker: AbstractRaider, + parent: AbstractMonsterMetadataBundle { + _marker: AbstractMonster, + parent: AbstractCreatureMetadataBundle { + _marker: AbstractCreature, + parent: AbstractInsentientMetadataBundle { + _marker: AbstractInsentient, + parent: AbstractLivingMetadataBundle { + _marker: AbstractLiving, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( + false, + ), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + auto_spin_attack: AutoSpinAttack(false), + abstract_living_using_item: AbstractLivingUsingItem(false), + health: Health(1.0), + effect_particles: EffectParticles(Default::default()), + effect_ambience: EffectAmbience(false), + arrow_count: ArrowCount(0), + stinger_count: StingerCount(0), + sleeping_pos: SleepingPos(None), + }, + no_ai: NoAi(false), + left_handed: LeftHanded(false), + aggressive: Aggressive(false), + }, + }, + }, + is_celebrating: IsCelebrating(false), + }, + spell_casting: SpellCasting(0), + }, + } + } +} + +/// A metadata field for [AbstractThrownItemProjectile]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct AbstractThrownItemProjectileItemStack(pub ItemStack); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// These are the metadata components that all `AbstractThrownItemProjectile` +/// entities are guaranteed to have, in addition to the metadata components from +/// parent types: +/// +/// - [AbstractThrownItemProjectileItemStack] +/// +/// # Parents +/// +/// Entities with `AbstractThrownItemProjectile` will also have the following +/// marker components and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [Egg] +/// - [EnderPearl] +/// - [ExperienceBottle] +/// - [LingeringPotion] +/// - [Snowball] +/// - [SplashPotion] +#[derive(Component)] +pub struct AbstractThrownItemProjectile; +impl AbstractThrownItemProjectile { + pub fn apply_metadata( + entity: &mut bevy_ecs::system::EntityCommands, + d: EntityDataItem, + ) -> Result<(), UpdateMetadataError> { + match d.index { + 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 8 => { + entity.insert(AbstractThrownItemProjectileItemStack( + d.value.into_item_stack()?, + )); + } + _ => {} + } + Ok(()) + } +} + +/// The metadata bundle for [AbstractThrownItemProjectile]. +/// +/// This type should generally not be used directly. +#[derive(Bundle)] +pub struct AbstractThrownItemProjectileMetadataBundle { + _marker: AbstractThrownItemProjectile, + parent: AbstractEntityMetadataBundle, + abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack, +} +impl Default for AbstractThrownItemProjectileMetadataBundle { + fn default() -> Self { + Self { + _marker: AbstractThrownItemProjectile, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack( + Default::default(), + ), + } + } +} + +/// The marker component for entities of type `minecraft:egg`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Egg` will also have the following marker components and their +/// metadata fields: +/// +/// - [AbstractThrownItemProjectile] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. +#[derive(Component)] +pub struct Egg; +impl Egg { + pub fn apply_metadata( + entity: &mut bevy_ecs::system::EntityCommands, + d: EntityDataItem, + ) -> Result<(), UpdateMetadataError> { + match d.index { + 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?, + _ => {} + } + Ok(()) + } +} + +/// The metadata bundle for [Egg]. +/// +/// This type should generally not be used directly. +#[derive(Bundle)] +pub struct EggMetadataBundle { + _marker: Egg, + parent: AbstractThrownItemProjectileMetadataBundle, +} +impl Default for EggMetadataBundle { + fn default() -> Self { + Self { + _marker: Egg, + parent: AbstractThrownItemProjectileMetadataBundle { + _marker: AbstractThrownItemProjectile, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter(0), + abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack( + Default::default(), + ), }, } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ClientAngerLevel(pub i32); +/// The marker component for entities of type `minecraft:ender_pearl`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `EnderPearl` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractThrownItemProjectile] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Warden; -impl Warden { +pub struct EnderPearl; +impl EnderPearl { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractMonster::apply_metadata(entity, d)?, - 16 => { - entity.insert(ClientAngerLevel(d.value.into_int()?)); - } + 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [EnderPearl]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct WardenMetadataBundle { - _marker: Warden, - parent: AbstractMonsterMetadataBundle, - client_anger_level: ClientAngerLevel, +pub struct EnderPearlMetadataBundle { + _marker: EnderPearl, + parent: AbstractThrownItemProjectileMetadataBundle, } -impl Default for WardenMetadataBundle { +impl Default for EnderPearlMetadataBundle { fn default() -> Self { Self { - _marker: Warden, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, + _marker: EnderPearl, + parent: AbstractThrownItemProjectileMetadataBundle { + _marker: AbstractThrownItemProjectile, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack( + Default::default(), + ), }, - client_anger_level: ClientAngerLevel(0), } } } +/// The marker component for entities of type `minecraft:experience_bottle`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `ExperienceBottle` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractThrownItemProjectile] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct WindCharge; -impl WindCharge { +pub struct ExperienceBottle; +impl ExperienceBottle { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, + 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [ExperienceBottle]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct WindChargeMetadataBundle { - _marker: WindCharge, - parent: AbstractEntityMetadataBundle, +pub struct ExperienceBottleMetadataBundle { + _marker: ExperienceBottle, + parent: AbstractThrownItemProjectileMetadataBundle, } -impl Default for WindChargeMetadataBundle { +impl Default for ExperienceBottleMetadataBundle { fn default() -> Self { Self { - _marker: WindCharge, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: ExperienceBottle, + parent: AbstractThrownItemProjectileMetadataBundle { + _marker: AbstractThrownItemProjectile, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack( + Default::default(), + ), }, } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct WitchUsingItem(pub bool); +/// The marker component for entities of type `minecraft:lingering_potion`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `LingeringPotion` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractThrownItemProjectile] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Witch; -impl Witch { +pub struct LingeringPotion; +impl LingeringPotion { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractRaider::apply_metadata(entity, d)?, - 17 => { - entity.insert(WitchUsingItem(d.value.into_boolean()?)); - } + 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [LingeringPotion]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct WitchMetadataBundle { - _marker: Witch, - parent: AbstractRaiderMetadataBundle, - witch_using_item: WitchUsingItem, +pub struct LingeringPotionMetadataBundle { + _marker: LingeringPotion, + parent: AbstractThrownItemProjectileMetadataBundle, } -impl Default for WitchMetadataBundle { +impl Default for LingeringPotionMetadataBundle { fn default() -> Self { Self { - _marker: Witch, - parent: AbstractRaiderMetadataBundle { - _marker: AbstractRaider, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, + _marker: LingeringPotion, + parent: AbstractThrownItemProjectileMetadataBundle { + _marker: AbstractThrownItemProjectile, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - is_celebrating: IsCelebrating(false), + abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack( + Default::default(), + ), }, - witch_using_item: WitchUsingItem(false), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct TargetA(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct TargetB(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct TargetC(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Inv(pub i32); +/// The marker component for entities of type `minecraft:snowball`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Snowball` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractThrownItemProjectile] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Wither; -impl Wither { +pub struct Snowball; +impl Snowball { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractMonster::apply_metadata(entity, d)?, - 16 => { - entity.insert(TargetA(d.value.into_int()?)); - } - 17 => { - entity.insert(TargetB(d.value.into_int()?)); - } - 18 => { - entity.insert(TargetC(d.value.into_int()?)); - } - 19 => { - entity.insert(Inv(d.value.into_int()?)); - } + 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [Snowball]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct WitherMetadataBundle { - _marker: Wither, - parent: AbstractMonsterMetadataBundle, - target_a: TargetA, - target_b: TargetB, - target_c: TargetC, - inv: Inv, +pub struct SnowballMetadataBundle { + _marker: Snowball, + parent: AbstractThrownItemProjectileMetadataBundle, } -impl Default for WitherMetadataBundle { +impl Default for SnowballMetadataBundle { fn default() -> Self { Self { - _marker: Wither, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, + _marker: Snowball, + parent: AbstractThrownItemProjectileMetadataBundle { + _marker: AbstractThrownItemProjectile, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack( + Default::default(), + ), }, - target_a: TargetA(0), - target_b: TargetB(0), - target_c: TargetC(0), - inv: Inv(0), } } } +/// The marker component for entities of type `minecraft:splash_potion`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `SplashPotion` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractThrownItemProjectile] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct WitherSkeleton; -impl WitherSkeleton { +pub struct SplashPotion; +impl SplashPotion { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractMonster::apply_metadata(entity, d)?, + 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [SplashPotion]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct WitherSkeletonMetadataBundle { - _marker: WitherSkeleton, - parent: AbstractMonsterMetadataBundle, +pub struct SplashPotionMetadataBundle { + _marker: SplashPotion, + parent: AbstractThrownItemProjectileMetadataBundle, } -impl Default for WitherSkeletonMetadataBundle { +impl Default for SplashPotionMetadataBundle { fn default() -> Self { Self { - _marker: WitherSkeleton, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, + _marker: SplashPotion, + parent: AbstractThrownItemProjectileMetadataBundle { + _marker: AbstractThrownItemProjectile, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack( + Default::default(), + ), }, } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Dangerous(pub bool); +/// A metadata field for [AbstractVehicle]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Hurt(pub i32); +/// A metadata field for [AbstractVehicle]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Hurtdir(pub i32); +/// A metadata field for [AbstractVehicle]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Damage(pub f32); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// These are the metadata components that all `AbstractVehicle` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [Hurt] +/// - [Hurtdir] +/// - [Damage] +/// +/// # Parents +/// +/// Entities with `AbstractVehicle` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [AbstractBoat] +/// - [AcaciaBoat] +/// - [AcaciaChestBoat] +/// - [BambooChestRaft] +/// - [BambooRaft] +/// - [BirchBoat] +/// - [BirchChestBoat] +/// - [CherryBoat] +/// - [CherryChestBoat] +/// - [DarkOakBoat] +/// - [DarkOakChestBoat] +/// - [JungleBoat] +/// - [JungleChestBoat] +/// - [MangroveBoat] +/// - [MangroveChestBoat] +/// - [OakBoat] +/// - [OakChestBoat] +/// - [PaleOakBoat] +/// - [PaleOakChestBoat] +/// - [SpruceBoat] +/// - [SpruceChestBoat] +/// - [AbstractMinecart] +/// - [ChestMinecart] +/// - [CommandBlockMinecart] +/// - [FurnaceMinecart] +/// - [HopperMinecart] +/// - [Minecart] +/// - [SpawnerMinecart] +/// - [TntMinecart] #[derive(Component)] -pub struct WitherSkull; -impl WitherSkull { +pub struct AbstractVehicle; +impl AbstractVehicle { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, @@ -10828,7 +16362,13 @@ impl WitherSkull { match d.index { 0..=7 => AbstractEntity::apply_metadata(entity, d)?, 8 => { - entity.insert(Dangerous(d.value.into_boolean()?)); + entity.insert(Hurt(d.value.into_int()?)); + } + 9 => { + entity.insert(Hurtdir(d.value.into_int()?)); + } + 10 => { + entity.insert(Damage(d.value.into_float()?)); } _ => {} } @@ -10836,16 +16376,21 @@ impl WitherSkull { } } +/// The metadata bundle for [AbstractVehicle]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct WitherSkullMetadataBundle { - _marker: WitherSkull, +pub struct AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, parent: AbstractEntityMetadataBundle, - dangerous: Dangerous, + hurt: Hurt, + hurtdir: Hurtdir, + damage: Damage, } -impl Default for WitherSkullMetadataBundle { +impl Default for AbstractVehicleMetadataBundle { fn default() -> Self { Self { - _marker: WitherSkull, + _marker: AbstractVehicle, parent: AbstractEntityMetadataBundle { _marker: AbstractEntity, on_fire: OnFire(false), @@ -10863,44 +16408,81 @@ impl Default for WitherSkullMetadataBundle { pose: Pose::default(), ticks_frozen: TicksFrozen(Default::default()), }, - dangerous: Dangerous(false), + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct WolfInterested(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct WolfCollarColor(pub i32); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct WolfAngerEndTime(pub i64); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct WolfVariant(pub azalea_registry::data::CowVariant); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct SoundVariant(pub azalea_registry::data::WolfVariant); +/// A metadata field for [AbstractBoat]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PaddleLeft(pub bool); +/// A metadata field for [AbstractBoat]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct PaddleRight(pub bool); +/// A metadata field for [AbstractBoat]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct BubbleTime(pub i32); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// These are the metadata components that all `AbstractBoat` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [PaddleLeft] +/// - [PaddleRight] +/// - [BubbleTime] +/// +/// # Parents +/// +/// Entities with `AbstractBoat` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [AcaciaBoat] +/// - [AcaciaChestBoat] +/// - [BambooChestRaft] +/// - [BambooRaft] +/// - [BirchBoat] +/// - [BirchChestBoat] +/// - [CherryBoat] +/// - [CherryChestBoat] +/// - [DarkOakBoat] +/// - [DarkOakChestBoat] +/// - [JungleBoat] +/// - [JungleChestBoat] +/// - [MangroveBoat] +/// - [MangroveChestBoat] +/// - [OakBoat] +/// - [OakChestBoat] +/// - [PaleOakBoat] +/// - [PaleOakChestBoat] +/// - [SpruceBoat] +/// - [SpruceChestBoat] #[derive(Component)] -pub struct Wolf; -impl Wolf { +pub struct AbstractBoat; +impl AbstractBoat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=18 => AbstractTameable::apply_metadata(entity, d)?, - 19 => { - entity.insert(WolfInterested(d.value.into_boolean()?)); - } - 20 => { - entity.insert(WolfCollarColor(d.value.into_int()?)); - } - 21 => { - entity.insert(WolfAngerEndTime(d.value.into_long()?)); + 0..=10 => AbstractVehicle::apply_metadata(entity, d)?, + 11 => { + entity.insert(PaddleLeft(d.value.into_boolean()?)); } - 22 => { - entity.insert(WolfVariant(d.value.into_cow_variant()?)); + 12 => { + entity.insert(PaddleRight(d.value.into_boolean()?)); } - 23 => { - entity.insert(SoundVariant(d.value.into_wolf_variant()?)); + 13 => { + entity.insert(BubbleTime(d.value.into_int()?)); } _ => {} } @@ -10908,1037 +16490,1128 @@ impl Wolf { } } +/// The metadata bundle for [AbstractBoat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct WolfMetadataBundle { - _marker: Wolf, - parent: AbstractTameableMetadataBundle, - wolf_interested: WolfInterested, - wolf_collar_color: WolfCollarColor, - wolf_anger_end_time: WolfAngerEndTime, - wolf_variant: WolfVariant, - sound_variant: SoundVariant, +pub struct AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle, + paddle_left: PaddleLeft, + paddle_right: PaddleRight, + bubble_time: BubbleTime, } -impl Default for WolfMetadataBundle { +impl Default for AbstractBoatMetadataBundle { fn default() -> Self { Self { - _marker: Wolf, - parent: AbstractTameableMetadataBundle { - _marker: AbstractTameable, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - abstract_ageable_baby: AbstractAgeableBaby(false), - }, + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - tame: Tame(false), - in_sitting_pose: InSittingPose(false), - owneruuid: Owneruuid(None), + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, - wolf_interested: WolfInterested(false), - wolf_collar_color: WolfCollarColor(Default::default()), - wolf_anger_end_time: WolfAngerEndTime(-1), - wolf_variant: WolfVariant(azalea_registry::data::CowVariant::new_raw(0)), - sound_variant: SoundVariant(azalea_registry::data::WolfVariant::new_raw(0)), + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ZoglinBaby(pub bool); +/// The marker component for entities of type `minecraft:acacia_boat`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `AcaciaBoat` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Zoglin; -impl Zoglin { +pub struct AcaciaBoat; +impl AcaciaBoat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractMonster::apply_metadata(entity, d)?, - 16 => { - entity.insert(ZoglinBaby(d.value.into_boolean()?)); - } + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [AcaciaBoat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct ZoglinMetadataBundle { - _marker: Zoglin, - parent: AbstractMonsterMetadataBundle, - zoglin_baby: ZoglinBaby, +pub struct AcaciaBoatMetadataBundle { + _marker: AcaciaBoat, + parent: AbstractBoatMetadataBundle, } -impl Default for ZoglinMetadataBundle { +impl Default for AcaciaBoatMetadataBundle { fn default() -> Self { Self { - _marker: Zoglin, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + _marker: AcaciaBoat, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), }, - zoglin_baby: ZoglinBaby(false), } } } +/// The marker component for entities of type `minecraft:acacia_chest_boat`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `AcaciaChestBoat` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct Zombie; -impl Zombie { +pub struct AcaciaChestBoat; +impl AcaciaChestBoat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractMonster::apply_metadata(entity, d)?, - 16 => { - entity.insert(ZombieBaby(d.value.into_boolean()?)); - } - 17 => { - entity.insert(SpecialType(d.value.into_int()?)); - } - 18 => { - entity.insert(DrownedConversion(d.value.into_boolean()?)); - } + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [AcaciaChestBoat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct ZombieMetadataBundle { - _marker: Zombie, - parent: AbstractMonsterMetadataBundle, - zombie_baby: ZombieBaby, - special_type: SpecialType, - drowned_conversion: DrownedConversion, +pub struct AcaciaChestBoatMetadataBundle { + _marker: AcaciaChestBoat, + parent: AbstractBoatMetadataBundle, } -impl Default for ZombieMetadataBundle { +impl Default for AcaciaChestBoatMetadataBundle { fn default() -> Self { Self { - _marker: Zombie, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + _marker: AcaciaChestBoat, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), + }, + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), + }, + } + } +} + +/// The marker component for entities of type `minecraft:bamboo_chest_raft`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `BambooChestRaft` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. +#[derive(Component)] +pub struct BambooChestRaft; +impl BambooChestRaft { + pub fn apply_metadata( + entity: &mut bevy_ecs::system::EntityCommands, + d: EntityDataItem, + ) -> Result<(), UpdateMetadataError> { + match d.index { + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + _ => {} + } + Ok(()) + } +} + +/// The metadata bundle for [BambooChestRaft]. +/// +/// This type should generally not be used directly. +#[derive(Bundle)] +pub struct BambooChestRaftMetadataBundle { + _marker: BambooChestRaft, + parent: AbstractBoatMetadataBundle, +} +impl Default for BambooChestRaftMetadataBundle { + fn default() -> Self { + Self { + _marker: BambooChestRaft, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), }, - zombie_baby: ZombieBaby(false), - special_type: SpecialType(0), - drowned_conversion: DrownedConversion(false), } } } +/// The marker component for entities of type `minecraft:bamboo_raft`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `BambooRaft` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct ZombieHorse; -impl ZombieHorse { +pub struct BambooRaft; +impl BambooRaft { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=17 => AbstractHorse::apply_metadata(entity, d)?, + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [BambooRaft]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct ZombieHorseMetadataBundle { - _marker: ZombieHorse, - parent: AbstractHorseMetadataBundle, +pub struct BambooRaftMetadataBundle { + _marker: BambooRaft, + parent: AbstractBoatMetadataBundle, } -impl Default for ZombieHorseMetadataBundle { +impl Default for BambooRaftMetadataBundle { fn default() -> Self { Self { - _marker: ZombieHorse, - parent: AbstractHorseMetadataBundle { - _marker: AbstractHorse, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - abstract_ageable_baby: AbstractAgeableBaby(false), + _marker: BambooRaft, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, - tamed: Tamed(false), - eating: Eating(false), - abstract_horse_standing: AbstractHorseStanding(false), - bred: Bred(false), + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), }, } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ZombieNautilusDash(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ZombieNautilusVariant(pub azalea_registry::data::ZombieNautilusVariant); +/// The marker component for entities of type `minecraft:birch_boat`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `BirchBoat` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct ZombieNautilus; -impl ZombieNautilus { +pub struct BirchBoat; +impl BirchBoat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=18 => AbstractTameable::apply_metadata(entity, d)?, - 19 => { - entity.insert(ZombieNautilusDash(d.value.into_boolean()?)); - } - 20 => { - entity.insert(ZombieNautilusVariant( - d.value.into_zombie_nautilus_variant()?, - )); - } + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [BirchBoat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct ZombieNautilusMetadataBundle { - _marker: ZombieNautilus, - parent: AbstractTameableMetadataBundle, - zombie_nautilus_dash: ZombieNautilusDash, - zombie_nautilus_variant: ZombieNautilusVariant, +pub struct BirchBoatMetadataBundle { + _marker: BirchBoat, + parent: AbstractBoatMetadataBundle, } -impl Default for ZombieNautilusMetadataBundle { +impl Default for BirchBoatMetadataBundle { fn default() -> Self { Self { - _marker: ZombieNautilus, - parent: AbstractTameableMetadataBundle { - _marker: AbstractTameable, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - abstract_ageable_baby: AbstractAgeableBaby(false), + _marker: BirchBoat, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, - tame: Tame(false), - in_sitting_pose: InSittingPose(false), - owneruuid: Owneruuid(None), + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), }, - zombie_nautilus_dash: ZombieNautilusDash(false), - zombie_nautilus_variant: ZombieNautilusVariant( - azalea_registry::data::ZombieNautilusVariant::new_raw(0), - ), } } } -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct Converting(pub bool); -#[derive(Clone, Component, Deref, DerefMut, PartialEq)] -pub struct ZombieVillagerVillagerData(pub VillagerData); +/// The marker component for entities of type `minecraft:birch_chest_boat`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `BirchChestBoat` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct ZombieVillager; -impl ZombieVillager { +pub struct BirchChestBoat; +impl BirchChestBoat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=18 => Zombie::apply_metadata(entity, d)?, - 19 => { - entity.insert(Converting(d.value.into_boolean()?)); - } - 20 => { - entity.insert(ZombieVillagerVillagerData(d.value.into_villager_data()?)); - } + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [BirchChestBoat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct ZombieVillagerMetadataBundle { - _marker: ZombieVillager, - parent: ZombieMetadataBundle, - converting: Converting, - zombie_villager_villager_data: ZombieVillagerVillagerData, +pub struct BirchChestBoatMetadataBundle { + _marker: BirchChestBoat, + parent: AbstractBoatMetadataBundle, } -impl Default for ZombieVillagerMetadataBundle { +impl Default for BirchChestBoatMetadataBundle { fn default() -> Self { Self { - _marker: ZombieVillager, - parent: ZombieMetadataBundle { - _marker: Zombie, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, + _marker: BirchChestBoat, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, - zombie_baby: ZombieBaby(false), - special_type: SpecialType(0), - drowned_conversion: DrownedConversion(false), + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), }, - converting: Converting(false), - zombie_villager_villager_data: ZombieVillagerVillagerData(VillagerData { - kind: azalea_registry::builtin::VillagerKind::Plains, - profession: azalea_registry::builtin::VillagerProfession::None, - level: 0, - }), } } } +/// The marker component for entities of type `minecraft:cherry_boat`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `CherryBoat` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct ZombifiedPiglin; -impl ZombifiedPiglin { +pub struct CherryBoat; +impl CherryBoat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=18 => Zombie::apply_metadata(entity, d)?, + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [CherryBoat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct ZombifiedPiglinMetadataBundle { - _marker: ZombifiedPiglin, - parent: ZombieMetadataBundle, +pub struct CherryBoatMetadataBundle { + _marker: CherryBoat, + parent: AbstractBoatMetadataBundle, } -impl Default for ZombifiedPiglinMetadataBundle { +impl Default for CherryBoatMetadataBundle { fn default() -> Self { Self { - _marker: ZombifiedPiglin, - parent: ZombieMetadataBundle { - _marker: Zombie, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, + _marker: CherryBoat, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, - zombie_baby: ZombieBaby(false), - special_type: SpecialType(0), - drowned_conversion: DrownedConversion(false), + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), }, } } } -#[derive(Component)] -pub struct AbstractAgeable; -impl AbstractAgeable { - pub fn apply_metadata( - entity: &mut bevy_ecs::system::EntityCommands, - d: EntityDataItem, - ) -> Result<(), UpdateMetadataError> { - match d.index { - 0..=15 => AbstractCreature::apply_metadata(entity, d)?, - 16 => { - entity.insert(AbstractAgeableBaby(d.value.into_boolean()?)); - } - _ => {} - } - Ok(()) - } -} - -#[derive(Bundle)] -pub struct AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle, - abstract_ageable_baby: AbstractAgeableBaby, -} -impl Default for AbstractAgeableMetadataBundle { - fn default() -> Self { - Self { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), +/// The marker component for entities of type `minecraft:cherry_chest_boat`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `CherryChestBoat` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. +#[derive(Component)] +pub struct CherryChestBoat; +impl CherryChestBoat { + pub fn apply_metadata( + entity: &mut bevy_ecs::system::EntityCommands, + d: EntityDataItem, + ) -> Result<(), UpdateMetadataError> { + match d.index { + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, + _ => {} + } + Ok(()) + } +} + +/// The metadata bundle for [CherryChestBoat]. +/// +/// This type should generally not be used directly. +#[derive(Bundle)] +pub struct CherryChestBoatMetadataBundle { + _marker: CherryChestBoat, + parent: AbstractBoatMetadataBundle, +} +impl Default for CherryChestBoatMetadataBundle { + fn default() -> Self { + Self { + _marker: CherryChestBoat, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), }, - abstract_ageable_baby: AbstractAgeableBaby(false), } } } +/// The marker component for entities of type `minecraft:dark_oak_boat`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `DarkOakBoat` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct AbstractAnimal; -impl AbstractAnimal { +pub struct DarkOakBoat; +impl DarkOakBoat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAgeable::apply_metadata(entity, d)?, + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [DarkOakBoat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle, +pub struct DarkOakBoatMetadataBundle { + _marker: DarkOakBoat, + parent: AbstractBoatMetadataBundle, } -impl Default for AbstractAnimalMetadataBundle { +impl Default for DarkOakBoatMetadataBundle { fn default() -> Self { Self { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + _marker: DarkOakBoat, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, - abstract_ageable_baby: AbstractAgeableBaby(false), + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), }, } } } +/// The marker component for entities of type `minecraft:dark_oak_chest_boat`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `DarkOakChestBoat` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct AbstractArrow; -impl AbstractArrow { +pub struct DarkOakChestBoat; +impl DarkOakChestBoat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - 8 => { - let bitfield = d.value.into_byte()?; - entity.insert(CritArrow(bitfield & 0x1 != 0)); - entity.insert(NoPhysics(bitfield & 0x2 != 0)); - } - 9 => { - entity.insert(PierceLevel(d.value.into_byte()?)); - } - 10 => { - entity.insert(InGround(d.value.into_boolean()?)); - } + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [DarkOakChestBoat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AbstractArrowMetadataBundle { - _marker: AbstractArrow, - parent: AbstractEntityMetadataBundle, - crit_arrow: CritArrow, - no_physics: NoPhysics, - pierce_level: PierceLevel, - in_ground: InGround, +pub struct DarkOakChestBoatMetadataBundle { + _marker: DarkOakChestBoat, + parent: AbstractBoatMetadataBundle, } -impl Default for AbstractArrowMetadataBundle { +impl Default for DarkOakChestBoatMetadataBundle { fn default() -> Self { Self { - _marker: AbstractArrow, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: DarkOakChestBoat, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), + }, + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), }, - crit_arrow: CritArrow(false), - no_physics: NoPhysics(false), - pierce_level: PierceLevel(0), - in_ground: InGround(false), } } } +/// The marker component for entities of type `minecraft:jungle_boat`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `JungleBoat` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct AbstractAvatar; -impl AbstractAvatar { +pub struct JungleBoat; +impl JungleBoat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=14 => AbstractLiving::apply_metadata(entity, d)?, - 15 => { - entity.insert(PlayerMainHand(d.value.into_humanoid_arm()?)); - } - 16 => { - entity.insert(PlayerModeCustomisation(d.value.into_byte()?)); - } + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [JungleBoat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AbstractAvatarMetadataBundle { - _marker: AbstractAvatar, - parent: AbstractLivingMetadataBundle, - player_main_hand: PlayerMainHand, - player_mode_customisation: PlayerModeCustomisation, +pub struct JungleBoatMetadataBundle { + _marker: JungleBoat, + parent: AbstractBoatMetadataBundle, } -impl Default for AbstractAvatarMetadataBundle { +impl Default for JungleBoatMetadataBundle { fn default() -> Self { Self { - _marker: AbstractAvatar, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: JungleBoat, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), }, - player_main_hand: PlayerMainHand(Default::default()), - player_mode_customisation: PlayerModeCustomisation(0), } } } +/// The marker component for entities of type `minecraft:jungle_chest_boat`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `JungleChestBoat` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct AbstractBoat; -impl AbstractBoat { +pub struct JungleChestBoat; +impl JungleChestBoat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=10 => AbstractVehicle::apply_metadata(entity, d)?, - 11 => { - entity.insert(PaddleLeft(d.value.into_boolean()?)); - } - 12 => { - entity.insert(PaddleRight(d.value.into_boolean()?)); - } - 13 => { - entity.insert(BubbleTime(d.value.into_int()?)); - } + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [JungleChestBoat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AbstractBoatMetadataBundle { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle, - paddle_left: PaddleLeft, - paddle_right: PaddleRight, - bubble_time: BubbleTime, +pub struct JungleChestBoatMetadataBundle { + _marker: JungleChestBoat, + parent: AbstractBoatMetadataBundle, } -impl Default for AbstractBoatMetadataBundle { +impl Default for JungleChestBoatMetadataBundle { fn default() -> Self { Self { - _marker: AbstractBoat, - parent: AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: JungleChestBoat, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), }, - paddle_left: PaddleLeft(false), - paddle_right: PaddleRight(false), - bubble_time: BubbleTime(0), } } } +/// The marker component for entities of type `minecraft:mangrove_boat`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `MangroveBoat` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct AbstractChestedHorse; -impl AbstractChestedHorse { +pub struct MangroveBoat; +impl MangroveBoat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=17 => AbstractHorse::apply_metadata(entity, d)?, - 18 => { - entity.insert(Chest(d.value.into_boolean()?)); - } + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [MangroveBoat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AbstractChestedHorseMetadataBundle { - _marker: AbstractChestedHorse, - parent: AbstractHorseMetadataBundle, - chest: Chest, +pub struct MangroveBoatMetadataBundle { + _marker: MangroveBoat, + parent: AbstractBoatMetadataBundle, } -impl Default for AbstractChestedHorseMetadataBundle { +impl Default for MangroveBoatMetadataBundle { fn default() -> Self { Self { - _marker: AbstractChestedHorse, - parent: AbstractHorseMetadataBundle { - _marker: AbstractHorse, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - abstract_ageable_baby: AbstractAgeableBaby(false), + _marker: MangroveBoat, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, - tamed: Tamed(false), - eating: Eating(false), - abstract_horse_standing: AbstractHorseStanding(false), - bred: Bred(false), + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), }, - chest: Chest(false), } } } +/// The marker component for entities of type `minecraft:mangrove_chest_boat`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `MangroveChestBoat` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct AbstractCreature; -impl AbstractCreature { +pub struct MangroveChestBoat; +impl MangroveChestBoat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractInsentient::apply_metadata(entity, d)?, + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [MangroveChestBoat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle, +pub struct MangroveChestBoatMetadataBundle { + _marker: MangroveChestBoat, + parent: AbstractBoatMetadataBundle, } -impl Default for AbstractCreatureMetadataBundle { +impl Default for MangroveChestBoatMetadataBundle { fn default() -> Self { Self { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, + _marker: MangroveChestBoat, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, parent: AbstractEntityMetadataBundle { _marker: AbstractEntity, on_fire: OnFire(false), @@ -11956,560 +17629,526 @@ impl Default for AbstractCreatureMetadataBundle { pose: Pose::default(), ticks_frozen: TicksFrozen(Default::default()), }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), }, } } } -#[derive(Component)] -pub struct AbstractDisplay; -impl AbstractDisplay { +/// The marker component for entities of type `minecraft:oak_boat`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `OakBoat` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. +#[derive(Component)] +pub struct OakBoat; +impl OakBoat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - 8 => { - entity.insert(TransformationInterpolationStartDeltaTicks( - d.value.into_int()?, - )); - } - 9 => { - entity.insert(TransformationInterpolationDuration(d.value.into_int()?)); - } - 10 => { - entity.insert(PosRotInterpolationDuration(d.value.into_int()?)); - } - 11 => { - entity.insert(Translation(d.value.into_vector3()?)); - } - 12 => { - entity.insert(Scale(d.value.into_vector3()?)); - } - 13 => { - entity.insert(LeftRotation(d.value.into_quaternion()?)); - } - 14 => { - entity.insert(RightRotation(d.value.into_quaternion()?)); - } - 15 => { - entity.insert(BillboardRenderConstraints(d.value.into_byte()?)); - } - 16 => { - entity.insert(BrightnessOverride(d.value.into_int()?)); - } - 17 => { - entity.insert(ViewRange(d.value.into_float()?)); - } - 18 => { - entity.insert(ShadowRadius(d.value.into_float()?)); - } - 19 => { - entity.insert(ShadowStrength(d.value.into_float()?)); - } - 20 => { - entity.insert(AbstractDisplayWidth(d.value.into_float()?)); - } - 21 => { - entity.insert(AbstractDisplayHeight(d.value.into_float()?)); - } - 22 => { - entity.insert(GlowColorOverride(d.value.into_int()?)); - } + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [OakBoat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AbstractDisplayMetadataBundle { - _marker: AbstractDisplay, - parent: AbstractEntityMetadataBundle, - transformation_interpolation_start_delta_ticks: TransformationInterpolationStartDeltaTicks, - transformation_interpolation_duration: TransformationInterpolationDuration, - pos_rot_interpolation_duration: PosRotInterpolationDuration, - translation: Translation, - scale: Scale, - left_rotation: LeftRotation, - right_rotation: RightRotation, - billboard_render_constraints: BillboardRenderConstraints, - brightness_override: BrightnessOverride, - view_range: ViewRange, - shadow_radius: ShadowRadius, - shadow_strength: ShadowStrength, - abstract_display_width: AbstractDisplayWidth, - abstract_display_height: AbstractDisplayHeight, - glow_color_override: GlowColorOverride, +pub struct OakBoatMetadataBundle { + _marker: OakBoat, + parent: AbstractBoatMetadataBundle, } -impl Default for AbstractDisplayMetadataBundle { +impl Default for OakBoatMetadataBundle { fn default() -> Self { Self { - _marker: AbstractDisplay, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: OakBoat, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), + }, + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), }, - transformation_interpolation_start_delta_ticks: - TransformationInterpolationStartDeltaTicks(0), - transformation_interpolation_duration: TransformationInterpolationDuration(0), - pos_rot_interpolation_duration: PosRotInterpolationDuration(0), - translation: Translation(Vec3f32 { - x: 0.0, - y: 0.0, - z: 0.0, - }), - scale: Scale(Vec3f32 { - x: 1.0, - y: 1.0, - z: 1.0, - }), - left_rotation: LeftRotation(Quaternion { - x: 0.0, - y: 0.0, - z: 0.0, - w: 1.0, - }), - right_rotation: RightRotation(Quaternion { - x: 0.0, - y: 0.0, - z: 0.0, - w: 1.0, - }), - billboard_render_constraints: BillboardRenderConstraints(Default::default()), - brightness_override: BrightnessOverride(-1), - view_range: ViewRange(1.0), - shadow_radius: ShadowRadius(0.0), - shadow_strength: ShadowStrength(1.0), - abstract_display_width: AbstractDisplayWidth(0.0), - abstract_display_height: AbstractDisplayHeight(0.0), - glow_color_override: GlowColorOverride(-1), } } } +/// The marker component for entities of type `minecraft:oak_chest_boat`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `OakChestBoat` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct AbstractEntity; -impl AbstractEntity { +pub struct OakChestBoat; +impl OakChestBoat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0 => { - let bitfield = d.value.into_byte()?; - entity.insert(OnFire(bitfield & 0x1 != 0)); - entity.insert(AbstractEntityShiftKeyDown(bitfield & 0x2 != 0)); - entity.insert(Sprinting(bitfield & 0x8 != 0)); - entity.insert(Swimming(bitfield & 0x10 != 0)); - entity.insert(CurrentlyGlowing(bitfield & 0x40 != 0)); - entity.insert(Invisible(bitfield & 0x20 != 0)); - entity.insert(FallFlying(bitfield & 0x80 != 0)); - } - 1 => { - entity.insert(AirSupply(d.value.into_int()?)); - } - 2 => { - entity.insert(CustomName(d.value.into_optional_formatted_text()?)); - } - 3 => { - entity.insert(CustomNameVisible(d.value.into_boolean()?)); - } - 4 => { - entity.insert(Silent(d.value.into_boolean()?)); - } - 5 => { - entity.insert(NoGravity(d.value.into_boolean()?)); - } - 6 => { - entity.insert(d.value.into_pose()?); - } - 7 => { - entity.insert(TicksFrozen(d.value.into_int()?)); - } + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [OakChestBoat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire, - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown, - sprinting: Sprinting, - swimming: Swimming, - currently_glowing: CurrentlyGlowing, - invisible: Invisible, - fall_flying: FallFlying, - air_supply: AirSupply, - custom_name: CustomName, - custom_name_visible: CustomNameVisible, - silent: Silent, - no_gravity: NoGravity, - pose: Pose, - ticks_frozen: TicksFrozen, +pub struct OakChestBoatMetadataBundle { + _marker: OakChestBoat, + parent: AbstractBoatMetadataBundle, } -impl Default for AbstractEntityMetadataBundle { +impl Default for OakChestBoatMetadataBundle { fn default() -> Self { Self { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: OakChestBoat, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), + }, + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), + }, } } } +/// The marker component for entities of type `minecraft:pale_oak_boat`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `PaleOakBoat` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct AbstractFish; -impl AbstractFish { +pub struct PaleOakBoat; +impl PaleOakBoat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractCreature::apply_metadata(entity, d)?, - 16 => { - entity.insert(AbstractFishFromBucket(d.value.into_boolean()?)); - } + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [PaleOakBoat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AbstractFishMetadataBundle { - _marker: AbstractFish, - parent: AbstractCreatureMetadataBundle, - abstract_fish_from_bucket: AbstractFishFromBucket, +pub struct PaleOakBoatMetadataBundle { + _marker: PaleOakBoat, + parent: AbstractBoatMetadataBundle, } -impl Default for AbstractFishMetadataBundle { +impl Default for PaleOakBoatMetadataBundle { fn default() -> Self { Self { - _marker: AbstractFish, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + _marker: PaleOakBoat, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), }, - abstract_fish_from_bucket: AbstractFishFromBucket(false), } } } +/// The marker component for entities of type `minecraft:pale_oak_chest_boat`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `PaleOakChestBoat` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct AbstractHorse; -impl AbstractHorse { +pub struct PaleOakChestBoat; +impl PaleOakChestBoat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, - 17 => { - let bitfield = d.value.into_byte()?; - entity.insert(Tamed(bitfield & 0x2 != 0)); - entity.insert(Eating(bitfield & 0x10 != 0)); - entity.insert(AbstractHorseStanding(bitfield & 0x20 != 0)); - entity.insert(Bred(bitfield & 0x8 != 0)); - } + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [PaleOakChestBoat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AbstractHorseMetadataBundle { - _marker: AbstractHorse, - parent: AbstractAnimalMetadataBundle, - tamed: Tamed, - eating: Eating, - abstract_horse_standing: AbstractHorseStanding, - bred: Bred, +pub struct PaleOakChestBoatMetadataBundle { + _marker: PaleOakChestBoat, + parent: AbstractBoatMetadataBundle, } -impl Default for AbstractHorseMetadataBundle { +impl Default for PaleOakChestBoatMetadataBundle { fn default() -> Self { Self { - _marker: AbstractHorse, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, + _marker: PaleOakChestBoat, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - abstract_ageable_baby: AbstractAgeableBaby(false), + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), }, - tamed: Tamed(false), - eating: Eating(false), - abstract_horse_standing: AbstractHorseStanding(false), - bred: Bred(false), } } } +/// The marker component for entities of type `minecraft:spruce_boat`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `SpruceBoat` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct AbstractInsentient; -impl AbstractInsentient { +pub struct SpruceBoat; +impl SpruceBoat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=14 => AbstractLiving::apply_metadata(entity, d)?, - 15 => { - let bitfield = d.value.into_byte()?; - entity.insert(NoAi(bitfield & 0x1 != 0)); - entity.insert(LeftHanded(bitfield & 0x2 != 0)); - entity.insert(Aggressive(bitfield & 0x4 != 0)); - } + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [SpruceBoat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle, - no_ai: NoAi, - left_handed: LeftHanded, - aggressive: Aggressive, +pub struct SpruceBoatMetadataBundle { + _marker: SpruceBoat, + parent: AbstractBoatMetadataBundle, } -impl Default for AbstractInsentientMetadataBundle { +impl Default for SpruceBoatMetadataBundle { fn default() -> Self { Self { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), + _marker: SpruceBoat, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), + }, + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), } } } +/// The marker component for entities of type `minecraft:spruce_chest_boat`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `SpruceChestBoat` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractBoat] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct AbstractLiving; -impl AbstractLiving { +pub struct SpruceChestBoat; +impl SpruceChestBoat { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - 8 => { - let bitfield = d.value.into_byte()?; - entity.insert(AutoSpinAttack(bitfield & 0x4 != 0)); - entity.insert(AbstractLivingUsingItem(bitfield & 0x1 != 0)); - } - 9 => { - entity.insert(Health(d.value.into_float()?)); - } - 10 => { - entity.insert(EffectParticles(d.value.into_particles()?)); - } - 11 => { - entity.insert(EffectAmbience(d.value.into_boolean()?)); - } - 12 => { - entity.insert(ArrowCount(d.value.into_int()?)); - } - 13 => { - entity.insert(StingerCount(d.value.into_int()?)); - } - 14 => { - entity.insert(SleepingPos(d.value.into_optional_block_pos()?)); - } + 0..=13 => AbstractBoat::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [SpruceChestBoat]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle, - auto_spin_attack: AutoSpinAttack, - abstract_living_using_item: AbstractLivingUsingItem, - health: Health, - effect_particles: EffectParticles, - effect_ambience: EffectAmbience, - arrow_count: ArrowCount, - stinger_count: StingerCount, - sleeping_pos: SleepingPos, +pub struct SpruceChestBoatMetadataBundle { + _marker: SpruceChestBoat, + parent: AbstractBoatMetadataBundle, } -impl Default for AbstractLivingMetadataBundle { +impl Default for SpruceChestBoatMetadataBundle { fn default() -> Self { Self { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: SpruceChestBoat, + parent: AbstractBoatMetadataBundle { + _marker: AbstractBoat, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), + }, + paddle_left: PaddleLeft(false), + paddle_right: PaddleRight(false), + bubble_time: BubbleTime(0), }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), } } } +/// A metadata field for [AbstractMinecart]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct CustomDisplayBlock(pub azalea_block::BlockState); +/// A metadata field for [AbstractMinecart]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct DisplayOffset(pub i32); +/// An abstract entity marker component. +/// +/// # Metadata +/// +/// These are the metadata components that all `AbstractMinecart` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [CustomDisplayBlock] +/// - [DisplayOffset] +/// +/// # Parents +/// +/// Entities with `AbstractMinecart` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// - [ChestMinecart] +/// - [CommandBlockMinecart] +/// - [FurnaceMinecart] +/// - [HopperMinecart] +/// - [Minecart] +/// - [SpawnerMinecart] +/// - [TntMinecart] #[derive(Component)] pub struct AbstractMinecart; impl AbstractMinecart { @@ -12531,6 +18170,9 @@ impl AbstractMinecart { } } +/// The metadata bundle for [AbstractMinecart]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] pub struct AbstractMinecartMetadataBundle { _marker: AbstractMinecart, @@ -12571,155 +18213,128 @@ impl Default for AbstractMinecartMetadataBundle { } } +/// The marker component for entities of type `minecraft:chest_minecart`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `ChestMinecart` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractMinecart] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct AbstractMonster; -impl AbstractMonster { - pub fn apply_metadata( - entity: &mut bevy_ecs::system::EntityCommands, - d: EntityDataItem, - ) -> Result<(), UpdateMetadataError> { - match d.index { - 0..=15 => AbstractCreature::apply_metadata(entity, d)?, - _ => {} - } - Ok(()) - } -} - -#[derive(Bundle)] -pub struct AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle, -} -impl Default for AbstractMonsterMetadataBundle { - fn default() -> Self { - Self { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, - }, - } - } -} - -#[derive(Component)] -pub struct AbstractPiglin; -impl AbstractPiglin { +pub struct ChestMinecart; +impl ChestMinecart { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractMonster::apply_metadata(entity, d)?, - 16 => { - entity.insert(AbstractPiglinImmuneToZombification(d.value.into_boolean()?)); - } + 0..=12 => AbstractMinecart::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [ChestMinecart]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AbstractPiglinMetadataBundle { - _marker: AbstractPiglin, - parent: AbstractMonsterMetadataBundle, - abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification, +pub struct ChestMinecartMetadataBundle { + _marker: ChestMinecart, + parent: AbstractMinecartMetadataBundle, } -impl Default for AbstractPiglinMetadataBundle { +impl Default for ChestMinecartMetadataBundle { fn default() -> Self { Self { - _marker: AbstractPiglin, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + _marker: ChestMinecart, + parent: AbstractMinecartMetadataBundle { + _marker: AbstractMinecart, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, + custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR), + display_offset: DisplayOffset(Default::default()), }, - abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification(false), } } } +/// A metadata field for [CommandBlockMinecart]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct CommandName(pub String); +/// A metadata field for [CommandBlockMinecart]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct LastOutput(pub FormattedText); +/// The marker component for entities of type +/// `minecraft:command_block_minecart`. +/// +/// # Metadata +/// +/// These are the metadata components that all `CommandBlockMinecart` entities +/// are guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [CommandName] +/// - [LastOutput] +/// +/// # Parents +/// +/// Entities with `CommandBlockMinecart` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractMinecart] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct AbstractRaider; -impl AbstractRaider { +pub struct CommandBlockMinecart; +impl CommandBlockMinecart { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=15 => AbstractMonster::apply_metadata(entity, d)?, - 16 => { - entity.insert(IsCelebrating(d.value.into_boolean()?)); + 0..=12 => AbstractMinecart::apply_metadata(entity, d)?, + 13 => { + entity.insert(CommandName(d.value.into_string()?)); + } + 14 => { + entity.insert(LastOutput(d.value.into_formatted_text()?)); } _ => {} } @@ -12727,72 +18342,90 @@ impl AbstractRaider { } } +/// The metadata bundle for [CommandBlockMinecart]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AbstractRaiderMetadataBundle { - _marker: AbstractRaider, - parent: AbstractMonsterMetadataBundle, - is_celebrating: IsCelebrating, +pub struct CommandBlockMinecartMetadataBundle { + _marker: CommandBlockMinecart, + parent: AbstractMinecartMetadataBundle, + command_name: CommandName, + last_output: LastOutput, } -impl Default for AbstractRaiderMetadataBundle { +impl Default for CommandBlockMinecartMetadataBundle { fn default() -> Self { Self { - _marker: AbstractRaider, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + _marker: CommandBlockMinecart, + parent: AbstractMinecartMetadataBundle { + _marker: AbstractMinecart, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, + custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR), + display_offset: DisplayOffset(Default::default()), }, - is_celebrating: IsCelebrating(false), + command_name: CommandName("".to_owned()), + last_output: LastOutput(Default::default()), } } } +/// A metadata field for [FurnaceMinecart]. +#[derive(Component, Deref, DerefMut, Clone, PartialEq)] +pub struct Fuel(pub bool); +/// The marker component for entities of type `minecraft:furnace_minecart`. +/// +/// # Metadata +/// +/// These are the metadata components that all `FurnaceMinecart` entities are +/// guaranteed to have, in addition to the metadata components from parent +/// types: +/// +/// - [Fuel] +/// +/// # Parents +/// +/// Entities with `FurnaceMinecart` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractMinecart] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct AbstractSpellcasterIllager; -impl AbstractSpellcasterIllager { +pub struct FurnaceMinecart; +impl FurnaceMinecart { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractRaider::apply_metadata(entity, d)?, - 17 => { - entity.insert(SpellCasting(d.value.into_byte()?)); + 0..=12 => AbstractMinecart::apply_metadata(entity, d)?, + 13 => { + entity.insert(Fuel(d.value.into_boolean()?)); } _ => {} } @@ -12800,339 +18433,360 @@ impl AbstractSpellcasterIllager { } } +/// The metadata bundle for [FurnaceMinecart]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AbstractSpellcasterIllagerMetadataBundle { - _marker: AbstractSpellcasterIllager, - parent: AbstractRaiderMetadataBundle, - spell_casting: SpellCasting, +pub struct FurnaceMinecartMetadataBundle { + _marker: FurnaceMinecart, + parent: AbstractMinecartMetadataBundle, + fuel: Fuel, } -impl Default for AbstractSpellcasterIllagerMetadataBundle { +impl Default for FurnaceMinecartMetadataBundle { fn default() -> Self { Self { - _marker: AbstractSpellcasterIllager, - parent: AbstractRaiderMetadataBundle { - _marker: AbstractRaider, - parent: AbstractMonsterMetadataBundle { - _marker: AbstractMonster, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, + _marker: FurnaceMinecart, + parent: AbstractMinecartMetadataBundle { + _marker: AbstractMinecart, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, - is_celebrating: IsCelebrating(false), + custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR), + display_offset: DisplayOffset(Default::default()), }, - spell_casting: SpellCasting(0), + fuel: Fuel(false), } } } +/// The marker component for entities of type `minecraft:hopper_minecart`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `HopperMinecart` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractMinecart] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct AbstractTameable; -impl AbstractTameable { +pub struct HopperMinecart; +impl HopperMinecart { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAnimal::apply_metadata(entity, d)?, - 17 => { - let bitfield = d.value.into_byte()?; - entity.insert(Tame(bitfield & 0x4 != 0)); - entity.insert(InSittingPose(bitfield & 0x1 != 0)); - } - 18 => { - entity.insert(Owneruuid(d.value.into_optional_living_entity_reference()?)); - } + 0..=12 => AbstractMinecart::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [HopperMinecart]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AbstractTameableMetadataBundle { - _marker: AbstractTameable, - parent: AbstractAnimalMetadataBundle, - tame: Tame, - in_sitting_pose: InSittingPose, - owneruuid: Owneruuid, +pub struct HopperMinecartMetadataBundle { + _marker: HopperMinecart, + parent: AbstractMinecartMetadataBundle, } -impl Default for AbstractTameableMetadataBundle { +impl Default for HopperMinecartMetadataBundle { fn default() -> Self { Self { - _marker: AbstractTameable, - parent: AbstractAnimalMetadataBundle { - _marker: AbstractAnimal, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown( - false, - ), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), - }, + _marker: HopperMinecart, + parent: AbstractMinecartMetadataBundle { + _marker: AbstractMinecart, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, - abstract_ageable_baby: AbstractAgeableBaby(false), + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, + custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR), + display_offset: DisplayOffset(Default::default()), }, - tame: Tame(false), - in_sitting_pose: InSittingPose(false), - owneruuid: Owneruuid(None), } } } +/// The marker component for entities of type `minecraft:minecart`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `Minecart` will also have the following marker components and +/// their metadata fields: +/// +/// - [AbstractMinecart] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct AbstractThrownItemProjectile; -impl AbstractThrownItemProjectile { +pub struct Minecart; +impl Minecart { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - 8 => { - entity.insert(AbstractThrownItemProjectileItemStack( - d.value.into_item_stack()?, - )); - } + 0..=12 => AbstractMinecart::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [Minecart]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AbstractThrownItemProjectileMetadataBundle { - _marker: AbstractThrownItemProjectile, - parent: AbstractEntityMetadataBundle, - abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack, +pub struct MinecartMetadataBundle { + _marker: Minecart, + parent: AbstractMinecartMetadataBundle, } -impl Default for AbstractThrownItemProjectileMetadataBundle { +impl Default for MinecartMetadataBundle { fn default() -> Self { Self { - _marker: AbstractThrownItemProjectile, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: Minecart, + parent: AbstractMinecartMetadataBundle { + _marker: AbstractMinecart, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), + }, + custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR), + display_offset: DisplayOffset(Default::default()), }, - abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack( - Default::default(), - ), } } } +/// The marker component for entities of type `minecraft:spawner_minecart`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `SpawnerMinecart` will also have the following marker +/// components and their metadata fields: +/// +/// - [AbstractMinecart] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct AbstractVehicle; -impl AbstractVehicle { +pub struct SpawnerMinecart; +impl SpawnerMinecart { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=7 => AbstractEntity::apply_metadata(entity, d)?, - 8 => { - entity.insert(Hurt(d.value.into_int()?)); - } - 9 => { - entity.insert(Hurtdir(d.value.into_int()?)); - } - 10 => { - entity.insert(Damage(d.value.into_float()?)); - } + 0..=12 => AbstractMinecart::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [SpawnerMinecart]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AbstractVehicleMetadataBundle { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle, - hurt: Hurt, - hurtdir: Hurtdir, - damage: Damage, +pub struct SpawnerMinecartMetadataBundle { + _marker: SpawnerMinecart, + parent: AbstractMinecartMetadataBundle, } -impl Default for AbstractVehicleMetadataBundle { +impl Default for SpawnerMinecartMetadataBundle { fn default() -> Self { Self { - _marker: AbstractVehicle, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), + _marker: SpawnerMinecart, + parent: AbstractMinecartMetadataBundle { + _marker: AbstractMinecart, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), + }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), + }, + custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR), + display_offset: DisplayOffset(Default::default()), }, - hurt: Hurt(0), - hurtdir: Hurtdir(1), - damage: Damage(0.0), } } } +/// The marker component for entities of type `minecraft:tnt_minecart`. +/// +/// # Metadata +/// +/// This entity type does not add any additional metadata. It will still have +/// metadata from parent types. +/// +/// # Parents +/// +/// Entities with `TntMinecart` will also have the following marker components +/// and their metadata fields: +/// +/// - [AbstractMinecart] +/// - [AbstractVehicle] +/// - [AbstractEntity] +/// +/// # Children +/// +/// This entity type has no children types. #[derive(Component)] -pub struct AbstractVillager; -impl AbstractVillager { +pub struct TntMinecart; +impl TntMinecart { pub fn apply_metadata( entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem, ) -> Result<(), UpdateMetadataError> { match d.index { - 0..=16 => AbstractAgeable::apply_metadata(entity, d)?, - 17 => { - entity.insert(AbstractVillagerUnhappyCounter(d.value.into_int()?)); - } + 0..=12 => AbstractMinecart::apply_metadata(entity, d)?, _ => {} } Ok(()) } } +/// The metadata bundle for [TntMinecart]. +/// +/// This type should generally not be used directly. #[derive(Bundle)] -pub struct AbstractVillagerMetadataBundle { - _marker: AbstractVillager, - parent: AbstractAgeableMetadataBundle, - abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter, +pub struct TntMinecartMetadataBundle { + _marker: TntMinecart, + parent: AbstractMinecartMetadataBundle, } -impl Default for AbstractVillagerMetadataBundle { +impl Default for TntMinecartMetadataBundle { fn default() -> Self { Self { - _marker: AbstractVillager, - parent: AbstractAgeableMetadataBundle { - _marker: AbstractAgeable, - parent: AbstractCreatureMetadataBundle { - _marker: AbstractCreature, - parent: AbstractInsentientMetadataBundle { - _marker: AbstractInsentient, - parent: AbstractLivingMetadataBundle { - _marker: AbstractLiving, - parent: AbstractEntityMetadataBundle { - _marker: AbstractEntity, - on_fire: OnFire(false), - abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), - sprinting: Sprinting(false), - swimming: Swimming(false), - currently_glowing: CurrentlyGlowing(false), - invisible: Invisible(false), - fall_flying: FallFlying(false), - air_supply: AirSupply(Default::default()), - custom_name: CustomName(Default::default()), - custom_name_visible: CustomNameVisible(Default::default()), - silent: Silent(Default::default()), - no_gravity: NoGravity(Default::default()), - pose: Pose::default(), - ticks_frozen: TicksFrozen(Default::default()), - }, - auto_spin_attack: AutoSpinAttack(false), - abstract_living_using_item: AbstractLivingUsingItem(false), - health: Health(1.0), - effect_particles: EffectParticles(Default::default()), - effect_ambience: EffectAmbience(false), - arrow_count: ArrowCount(0), - stinger_count: StingerCount(0), - sleeping_pos: SleepingPos(None), - }, - no_ai: NoAi(false), - left_handed: LeftHanded(false), - aggressive: Aggressive(false), + _marker: TntMinecart, + parent: AbstractMinecartMetadataBundle { + _marker: AbstractMinecart, + parent: AbstractVehicleMetadataBundle { + _marker: AbstractVehicle, + parent: AbstractEntityMetadataBundle { + _marker: AbstractEntity, + on_fire: OnFire(false), + abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false), + sprinting: Sprinting(false), + swimming: Swimming(false), + currently_glowing: CurrentlyGlowing(false), + invisible: Invisible(false), + fall_flying: FallFlying(false), + air_supply: AirSupply(Default::default()), + custom_name: CustomName(Default::default()), + custom_name_visible: CustomNameVisible(Default::default()), + silent: Silent(Default::default()), + no_gravity: NoGravity(Default::default()), + pose: Pose::default(), + ticks_frozen: TicksFrozen(Default::default()), }, + hurt: Hurt(0), + hurtdir: Hurtdir(1), + damage: Damage(0.0), }, - abstract_ageable_baby: AbstractAgeableBaby(false), + custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR), + display_offset: DisplayOffset(Default::default()), }, - abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter(0), } } } diff --git a/codegen/lib/code/entity.py b/codegen/lib/code/entity.py index 02167dfa..9d9e7733 100644 --- a/codegen/lib/code/entity.py +++ b/codegen/lib/code/entity.py @@ -102,13 +102,26 @@ def generate_entity_metadata(burger_entities_data: dict, mappings: Mappings): metadata_types = parse_metadata_types_from_code() - code = [] - code.append("""#![allow(clippy::single_match)] - -// This file is @generated from codegen/lib/code/entity.py. -// Don't change it manually! + code_header = [] + code_header.append("// This file is @generated from codegen/lib/code/entity.py.") + code_header.append("// Don't change it manually!") + code_header.append("") + + code_header.append("""//! Metadata fields stored on entities. +//! +//! Also see the [protocol wiki documentation](https://minecraft.wiki/w/Java_Edition_protocol/Entity_metadata). +//! +//! # Entities +//! +//! Azalea creates a marker ECS component for every entity and abstract entity. +//! You can use these to check if an entity is of a given type with an ECS +//! filter, such as `With`. +//! +//! All marker components are shown as a tree structure below: +//!""") -use azalea_chat::FormattedText; + code = [] + code.append("""use azalea_chat::FormattedText; use azalea_core::{ direction::Direction, position::{BlockPos, Vec3f32}, @@ -157,6 +170,8 @@ impl From for UpdateMetadataError { # make this one longer to avoid accidental use -- AbstractEntityShiftKeyDown instead of ShiftKeydown duplicate_field_names.add("shift_key_down") + entity_ids_to_children_ids = {} + for entity_id in burger_entity_metadata.keys(): field_name_map[entity_id] = {} for field_name_or_bitfield in get_entity_metadata_names( @@ -178,6 +193,11 @@ impl From for UpdateMetadataError { # make sure entity names don't clash with field names duplicate_field_names.add(entity_id) + parent_id = get_entity_parent(entity_id, burger_entity_metadata) + if parent_id not in entity_ids_to_children_ids: + entity_ids_to_children_ids[parent_id] = [] + entity_ids_to_children_ids[parent_id].append(entity_id) + # make sure these types are only ever made once for name in single_use_imported_types: if name in duplicate_field_names: @@ -237,6 +257,12 @@ impl From for UpdateMetadataError { ) parent_id = parents[1] if len(parents) > 1 else None + entity_struct_name = entity_id_to_struct_name(entity_id) + code_header_indent = " " * (len(parents) - 1) + code_header.append(f"//! {code_header_indent}- [{entity_struct_name}]") + + entity_metadata_doc_code = [] + # now add all the fields/component structs for index, name_or_bitfield in enumerate(all_field_names_or_bitfields): # make sure we only ever make these structs once @@ -262,8 +288,10 @@ impl From for UpdateMetadataError { metadata_type_data = metadata_types[type_id] rust_type = metadata_type_data["type"] + code.append(f"/// A metadata field for [{entity_struct_name}].") code.append("#[derive(Component, Deref, DerefMut, Clone, PartialEq)]") code.append(f"pub struct {struct_name}(pub {rust_type});") + entity_metadata_doc_code.append(f"/// - [{struct_name}]") else: # if it's a bitfield just make a struct for each bit for mask, name in name_or_bitfield.items(): @@ -272,12 +300,70 @@ impl From for UpdateMetadataError { code.append( "#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]" ) + code.append(f"/// A metadata field for [{entity_struct_name}].") code.append(f"pub struct {struct_name}(pub bool);") + entity_metadata_doc_code.append(f"/// - [{struct_name}]") # add the entity struct and Bundle struct - struct_name: str = upper_first_letter(to_camel_case(entity_id.lstrip("~"))) + if entity_id == "~abstract_entity": + code.append("/// The root entity marker component.") + code.append("///") + code.append( + "/// All entities that have had their metadata sent by the server will have this component." + ) + elif entity_id.startswith("~"): + code.append("/// An abstract entity marker component.") + else: + code.append( + f"/// The marker component for entities of type `minecraft:{entity_id}`." + ) + + code.append("///") + code.append("/// # Metadata") + code.append("///") + if len(entity_metadata_doc_code) == 0: + code.append( + "/// This entity type does not add any additional metadata. It will still have metadata from parent types." + ) + else: + code.append( + f"/// These are the metadata components that all `{entity_struct_name}` entities are guaranteed to have, in addition to the metadata components from parent types:" + ) + code.append("///") + code.extend(entity_metadata_doc_code) + + if len(parents) > 1: + code.append("///") + code.append("/// # Parents") + code.append("///") + code.append( + f"/// Entities with `{entity_struct_name}` will also have the following marker components and their metadata fields:" + ) + code.append("///") + for parent_entity_id in parents[1:]: + code.append(f"/// - [{entity_id_to_struct_name(parent_entity_id)}]") + + code.append("///") + code.append("/// # Children") + code.append("///") + + def add_children_recursively(current_entity_id, indentation=""): + for child_entity_id in entity_ids_to_children_ids.get( + current_entity_id, [] + ): + code.append( + f"/// {indentation}- [{entity_id_to_struct_name(child_entity_id)}]" + ) + add_children_recursively(child_entity_id, indentation + " ") + + children_entity_ids = entity_ids_to_children_ids.get(entity_id) + if children_entity_ids: + add_children_recursively(entity_id) + else: + code.append("/// This entity type has no children types.") + code.append("#[derive(Component)]") - code.append(f"pub struct {struct_name};") + code.append(f"pub struct {entity_struct_name};") parent_struct_name = ( upper_first_letter(to_camel_case(parent_id.lstrip("~"))) @@ -298,7 +384,7 @@ impl From for UpdateMetadataError { # Ok(()) # } # } - code.append(f"impl {struct_name} {{") + code.append(f"impl {entity_struct_name} {{") code.append( " pub fn apply_metadata(entity: &mut bevy_ecs::system::EntityCommands, d: EntityDataItem) -> Result<(), UpdateMetadataError> {" ) @@ -367,11 +453,14 @@ impl From for UpdateMetadataError { # dancing: Dancing, # can_duplicate: CanDuplicate, # } - bundle_struct_name = f"{struct_name}MetadataBundle" + bundle_struct_name = f"{entity_struct_name}MetadataBundle" code.append("") + code.append(f"/// The metadata bundle for [{entity_struct_name}].") + code.append("///") + code.append("/// This type should generally not be used directly.") code.append("#[derive(Bundle)]") code.append(f"pub struct {bundle_struct_name} {{") - code.append(f" _marker: {struct_name},") + code.append(f" _marker: {entity_struct_name},") if parent_struct_name: code.append(f" parent: {parent_struct_name}MetadataBundle,") for index, name_or_bitfield in get_entity_metadata_names( @@ -560,10 +649,14 @@ impl From for UpdateMetadataError { code.append("}") code.append("") - # parent_field_name = None - for entity_id in burger_entity_metadata: + def new_entity_recursive(entity_id: str): new_entity(entity_id) + for child_entity_id in entity_ids_to_children_ids.get(entity_id, []): + new_entity_recursive(child_entity_id) + + new_entity_recursive("~abstract_entity") + # and now make the main apply_metadata # pub fn apply_metadata( # entity: &mut bevy_ecs::system::EntityCommands, @@ -626,10 +719,18 @@ impl From for UpdateMetadataError { code.append("}") code.append("") + code_header.append("") + code_header.append("#![allow(clippy::single_match)]") + with open(METADATA_RS_DIR, "w") as f: + f.write("\n".join(code_header) + "\n\n") f.write("\n".join(code)) +def entity_id_to_struct_name(entity_id: str) -> str: + return upper_first_letter(to_camel_case(entity_id.lstrip("~"))) + + def generate_entity_dimensions(burger_entities_data: dict): # lines look like # EntityKind::Player => EntityDimensions::new(0.6, 1.8).eye_height(1.62), -- cgit v1.2.3