aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-12-15 05:45:53 -0100
committermat <git@matdoes.dev>2025-12-15 05:45:53 -0100
commit9846cb008abd88cb1785881dcac14014762977eb (patch)
tree58961e1c661f8a7879e441d8706ae9deea0cab0b
parent0b5e5d2b8a1a462f27c9f998845765e35d7158d5 (diff)
downloadazalea-drasl-9846cb008abd88cb1785881dcac14014762977eb.tar.xz
generate docs for metadata components
-rw-r--r--.gitignore3
-rw-r--r--azalea-entity/src/metadata.rs21114
-rw-r--r--codegen/lib/code/entity.py127
3 files changed, 13498 insertions, 7746 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<AbstractMonster>`.
+//!
+//! 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,599 @@ impl From<EntityDataValue> 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<FormattedText>);
-#[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);
+/// 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 AcaciaBoat;
-impl AcaciaBoat {
+pub struct AbstractEntity;
+impl AbstractEntity {
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 => {
+ 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()?));
+ }
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [AbstractEntity].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct AcaciaBoatMetadataBundle {
- _marker: AcaciaBoat,
- parent: AbstractBoatMetadataBundle,
+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 AcaciaBoatMetadataBundle {
+impl Default for AbstractEntityMetadataBundle {
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),
+ _marker: AbstractEntity,
+ on_fire: OnFire(false),
+ abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false),
+ sprinting: Sprinting(false),
+ swimming: Swimming(false),
+ currently_glowing: CurrentlyGlowing(false),
+ invisible: Invisible(false),
+ fall_flying: FallFlying(false),
+ air_supply: AirSupply(Default::default()),
+ custom_name: CustomName(Default::default()),
+ custom_name_visible: CustomNameVisible(Default::default()),
+ silent: Silent(Default::default()),
+ no_gravity: NoGravity(Default::default()),
+ pose: Pose::default(),
+ ticks_frozen: TicksFrozen(Default::default()),
+ }
+ }
+}
+
+/// A metadata field for [AreaEffectCloud].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
+pub struct Radius(pub f32);
+/// 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 {
+ 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(Radius(d.value.into_float()?));
+ }
+ 9 => {
+ entity.insert(Waiting(d.value.into_boolean()?));
+ }
+ 10 => {
+ entity.insert(d.value.into_particle()?);
+ }
+ _ => {}
+ }
+ Ok(())
+ }
+}
+
+/// The metadata bundle for [AreaEffectCloud].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct AreaEffectCloudMetadataBundle {
+ _marker: AreaEffectCloud,
+ parent: AbstractEntityMetadataBundle,
+ radius: Radius,
+ waiting: Waiting,
+ particle: Particle,
+}
+impl Default for AreaEffectCloudMetadataBundle {
+ fn default() -> Self {
+ Self {
+ _marker: AreaEffectCloud,
+ parent: AbstractEntityMetadataBundle {
+ _marker: AbstractEntity,
+ on_fire: OnFire(false),
+ abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false),
+ sprinting: Sprinting(false),
+ swimming: Swimming(false),
+ currently_glowing: CurrentlyGlowing(false),
+ invisible: Invisible(false),
+ fall_flying: FallFlying(false),
+ air_supply: AirSupply(Default::default()),
+ custom_name: CustomName(Default::default()),
+ custom_name_visible: CustomNameVisible(Default::default()),
+ silent: Silent(Default::default()),
+ no_gravity: NoGravity(Default::default()),
+ pose: Pose::default(),
+ ticks_frozen: TicksFrozen(Default::default()),
},
+ radius: Radius(3.0),
+ waiting: Waiting(false),
+ particle: Particle::default(),
}
}
}
+/// 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 AcaciaChestBoat;
-impl AcaciaChestBoat {
+pub struct BreezeWindCharge;
+impl BreezeWindCharge {
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 [BreezeWindCharge].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct AcaciaChestBoatMetadataBundle {
- _marker: AcaciaChestBoat,
- parent: AbstractBoatMetadataBundle,
+pub struct BreezeWindChargeMetadataBundle {
+ _marker: BreezeWindCharge,
+ parent: AbstractEntityMetadataBundle,
}
-impl Default for AcaciaChestBoatMetadataBundle {
+impl Default for BreezeWindChargeMetadataBundle {
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),
+ _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()),
},
}
}
}
-#[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<Particle>);
-#[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<BlockPos>);
-#[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 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 Allay;
-impl Allay {
+pub struct DragonFireball;
+impl DragonFireball {
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..=7 => AbstractEntity::apply_metadata(entity, d)?,
+ _ => {}
+ }
+ Ok(())
+ }
+}
+
+/// The metadata bundle for [DragonFireball].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct DragonFireballMetadataBundle {
+ _marker: DragonFireball,
+ parent: AbstractEntityMetadataBundle,
+}
+impl Default for DragonFireballMetadataBundle {
+ 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()),
+ },
+ }
+ }
+}
+
+/// A metadata field for [EndCrystal].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
+pub struct BeamTarget(pub Option<BlockPos>);
+/// 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 EndCrystal;
+impl EndCrystal {
+ 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()?));
}
- 17 => {
- entity.insert(CanDuplicate(d.value.into_boolean()?));
+ 9 => {
+ entity.insert(ShowBottom(d.value.into_boolean()?));
}
_ => {}
}
@@ -231,67 +824,134 @@ impl Allay {
}
}
+/// The metadata bundle for [EndCrystal].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct AllayMetadataBundle {
- _marker: Allay,
- parent: AbstractCreatureMetadataBundle,
- dancing: Dancing,
- can_duplicate: CanDuplicate,
+pub struct EndCrystalMetadataBundle {
+ _marker: EndCrystal,
+ parent: AbstractEntityMetadataBundle,
+ beam_target: BeamTarget,
+ show_bottom: ShowBottom,
}
-impl Default for AllayMetadataBundle {
+impl Default for EndCrystalMetadataBundle {
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),
- },
+ _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()),
},
- dancing: Dancing(false),
- can_duplicate: CanDuplicate(true),
+ beam_target: BeamTarget(None),
+ show_bottom: ShowBottom(true),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct Radius(pub f32);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct Waiting(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 AreaEffectCloud;
-impl AreaEffectCloud {
+pub struct EvokerFangs;
+impl EvokerFangs {
+ 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(())
+ }
+}
+
+/// The metadata bundle for [EvokerFangs].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct EvokerFangsMetadataBundle {
+ _marker: EvokerFangs,
+ parent: AbstractEntityMetadataBundle,
+}
+impl Default for EvokerFangsMetadataBundle {
+ 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()),
+ },
+ }
+ }
+}
+
+/// 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 ExperienceOrb;
+impl ExperienceOrb {
pub fn apply_metadata(
entity: &mut bevy_ecs::system::EntityCommands,
d: EntityDataItem,
@@ -299,13 +959,325 @@ impl AreaEffectCloud {
match d.index {
0..=7 => AbstractEntity::apply_metadata(entity, d)?,
8 => {
- entity.insert(Radius(d.value.into_float()?));
+ 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 ExperienceOrbMetadataBundle {
+ _marker: ExperienceOrb,
+ parent: AbstractEntityMetadataBundle,
+ value: Value,
+}
+impl Default for ExperienceOrbMetadataBundle {
+ 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()),
+ },
+ 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 EyeOfEnder;
+impl EyeOfEnder {
+ 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()?));
+ }
+ _ => {}
+ }
+ Ok(())
+ }
+}
+
+/// The metadata bundle for [EyeOfEnder].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct EyeOfEnderMetadataBundle {
+ _marker: EyeOfEnder,
+ parent: AbstractEntityMetadataBundle,
+ eye_of_ender_item_stack: EyeOfEnderItemStack,
+}
+impl Default for EyeOfEnderMetadataBundle {
+ 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()),
+ },
+ eye_of_ender_item_stack: EyeOfEnderItemStack(Default::default()),
+ }
+ }
+}
+
+/// 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 FallingBlock;
+impl FallingBlock {
+ 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()?));
+ }
+ _ => {}
+ }
+ Ok(())
+ }
+}
+
+/// The metadata bundle for [FallingBlock].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct FallingBlockMetadataBundle {
+ _marker: FallingBlock,
+ parent: AbstractEntityMetadataBundle,
+ start_pos: StartPos,
+}
+impl Default for FallingBlockMetadataBundle {
+ 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()),
+ },
+ start_pos: StartPos(BlockPos::new(0, 0, 0)),
+ }
+ }
+}
+
+/// 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 Fireball;
+impl Fireball {
+ 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()?));
+ }
+ _ => {}
+ }
+ Ok(())
+ }
+}
+
+/// The metadata bundle for [Fireball].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct FireballMetadataBundle {
+ _marker: Fireball,
+ parent: AbstractEntityMetadataBundle,
+ fireball_item_stack: FireballItemStack,
+}
+impl Default for FireballMetadataBundle {
+ 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()),
+ },
+ 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 FireworkRocket;
+impl FireworkRocket {
+ 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(Waiting(d.value.into_boolean()?));
+ entity.insert(AttachedToTarget(d.value.into_optional_unsigned_int()?));
}
10 => {
- entity.insert(d.value.into_particle()?);
+ entity.insert(ShotAtAngle(d.value.into_boolean()?));
}
_ => {}
}
@@ -313,18 +1285,21 @@ impl AreaEffectCloud {
}
}
+/// The metadata bundle for [FireworkRocket].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct AreaEffectCloudMetadataBundle {
- _marker: AreaEffectCloud,
+pub struct FireworkRocketMetadataBundle {
+ _marker: FireworkRocket,
parent: AbstractEntityMetadataBundle,
- radius: Radius,
- waiting: Waiting,
- particle: Particle,
+ fireworks_item: FireworksItem,
+ attached_to_target: AttachedToTarget,
+ shot_at_angle: ShotAtAngle,
}
-impl Default for AreaEffectCloudMetadataBundle {
+impl Default for FireworkRocketMetadataBundle {
fn default() -> Self {
Self {
- _marker: AreaEffectCloud,
+ _marker: FireworkRocket,
parent: AbstractEntityMetadataBundle {
_marker: AbstractEntity,
on_fire: OnFire(false),
@@ -342,28 +1317,54 @@ impl Default for AreaEffectCloudMetadataBundle {
pose: Pose::default(),
ticks_frozen: TicksFrozen(Default::default()),
},
- radius: Radius(3.0),
- waiting: Waiting(false),
- particle: Particle::default(),
+ fireworks_item: FireworksItem(Default::default()),
+ attached_to_target: AttachedToTarget(OptionalUnsignedInt(None)),
+ shot_at_angle: ShotAtAngle(false),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct AbstractAgeableBaby(pub bool);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct ArmadilloState(pub ArmadilloStateKind);
+/// 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 Armadillo;
-impl Armadillo {
+pub struct FishingBobber;
+impl FishingBobber {
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)?,
+ 8 => {
+ entity.insert(HookedEntity(d.value.into_int()?));
+ }
+ 9 => {
+ entity.insert(Biting(d.value.into_boolean()?));
}
_ => {}
}
@@ -371,120 +1372,260 @@ impl Armadillo {
}
}
+/// The metadata bundle for [FishingBobber].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct ArmadilloMetadataBundle {
- _marker: Armadillo,
- parent: AbstractAnimalMetadataBundle,
- armadillo_state: ArmadilloState,
+pub struct FishingBobberMetadataBundle {
+ _marker: FishingBobber,
+ parent: AbstractEntityMetadataBundle,
+ hooked_entity: HookedEntity,
+ biting: Biting,
}
-impl Default for ArmadilloMetadataBundle {
+impl Default for FishingBobberMetadataBundle {
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: 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()),
},
- armadillo_state: ArmadilloState(Default::default()),
+ hooked_entity: HookedEntity(0),
+ biting: Biting(false),
}
}
}
-#[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);
+/// 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 ArmorStand;
-impl ArmorStand {
+pub struct Interaction;
+impl Interaction {
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));
+ 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
+ 8 => {
+ entity.insert(InteractionWidth(d.value.into_float()?));
}
- 16 => {
- entity.insert(HeadPose(d.value.into_rotations()?));
+ 9 => {
+ entity.insert(InteractionHeight(d.value.into_float()?));
}
- 17 => {
- entity.insert(BodyPose(d.value.into_rotations()?));
+ 10 => {
+ entity.insert(Response(d.value.into_boolean()?));
}
- 18 => {
- entity.insert(LeftArmPose(d.value.into_rotations()?));
+ _ => {}
+ }
+ Ok(())
+ }
+}
+
+/// The metadata bundle for [Interaction].
+///
+/// This type should generally not be used directly.
+#[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),
+ }
+ }
+}
+
+/// 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 Item;
+impl Item {
+ 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()?));
}
- 19 => {
- entity.insert(RightArmPose(d.value.into_rotations()?));
+ _ => {}
+ }
+ Ok(())
+ }
+}
+
+/// The metadata bundle for [Item].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct ItemMetadataBundle {
+ _marker: Item,
+ parent: AbstractEntityMetadataBundle,
+ item_item: ItemItem,
+}
+impl Default for ItemMetadataBundle {
+ 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()),
+ },
+ item_item: ItemItem(Default::default()),
+ }
+ }
+}
+
+/// 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 ItemFrame;
+impl ItemFrame {
+ 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()?));
}
- 20 => {
- entity.insert(LeftLegPose(d.value.into_rotations()?));
+ 9 => {
+ entity.insert(ItemFrameItem(d.value.into_item_stack()?));
}
- 21 => {
- entity.insert(RightLegPose(d.value.into_rotations()?));
+ 10 => {
+ entity.insert(Rotation(d.value.into_int()?));
}
_ => {}
}
@@ -492,27 +1633,92 @@ impl ArmorStand {
}
}
+/// The metadata bundle for [ItemFrame].
+///
+/// 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 ItemFrameMetadataBundle {
+ _marker: ItemFrame,
+ parent: AbstractEntityMetadataBundle,
+ item_frame_direction: ItemFrameDirection,
+ item_frame_item: ItemFrameItem,
+ rotation: Rotation,
}
-impl Default for ArmorStandMetadataBundle {
+impl Default for ItemFrameMetadataBundle {
fn default() -> Self {
Self {
- _marker: ArmorStand,
- parent: AbstractLivingMetadataBundle {
- _marker: AbstractLiving,
+ _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: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 GlowItemFrame;
+impl GlowItemFrame {
+ pub fn apply_metadata(
+ entity: &mut bevy_ecs::system::EntityCommands,
+ d: EntityDataItem,
+ ) -> Result<(), UpdateMetadataError> {
+ match d.index {
+ 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 GlowItemFrameMetadataBundle {
+ _marker: GlowItemFrame,
+ parent: ItemFrameMetadataBundle,
+}
+impl Default for GlowItemFrameMetadataBundle {
+ fn default() -> Self {
+ Self {
+ _marker: GlowItemFrame,
+ parent: ItemFrameMetadataBundle {
+ _marker: ItemFrame,
parent: AbstractEntityMetadataBundle {
_marker: AbstractEntity,
on_fire: OnFire(false),
@@ -530,50 +1736,308 @@ impl Default for ArmorStandMetadataBundle {
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),
+ item_frame_direction: ItemFrameDirection(Default::default()),
+ item_frame_item: ItemFrameItem(Default::default()),
+ rotation: Rotation(0),
},
- 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);
+/// 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 Arrow;
-impl Arrow {
+pub struct LeashKnot;
+impl LeashKnot {
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)?,
+ _ => {}
+ }
+ Ok(())
+ }
+}
+
+/// The metadata bundle for [LeashKnot].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct LeashKnotMetadataBundle {
+ _marker: LeashKnot,
+ parent: AbstractEntityMetadataBundle,
+}
+impl Default for LeashKnotMetadataBundle {
+ 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()),
+ },
+ }
+ }
+}
+
+/// 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 LightningBolt;
+impl LightningBolt {
+ 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(())
+ }
+}
+
+/// The metadata bundle for [LightningBolt].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct LightningBoltMetadataBundle {
+ _marker: LightningBolt,
+ parent: AbstractEntityMetadataBundle,
+}
+impl Default for LightningBoltMetadataBundle {
+ 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()),
+ },
+ }
+ }
+}
+
+/// 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 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(())
+ }
+}
+
+/// The metadata bundle for [LlamaSpit].
+///
+/// This type should generally not be used directly.
+#[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()),
+ },
+ }
+ }
+}
+
+/// 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 Marker;
+impl Marker {
+ 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(())
+ }
+}
+
+/// The metadata bundle for [Marker].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct MarkerMetadataBundle {
+ _marker: Marker,
+ parent: AbstractEntityMetadataBundle,
+}
+impl Default for MarkerMetadataBundle {
+ 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()),
+ },
+ }
+ }
+}
+
+/// 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 OminousItemSpawner;
+impl OminousItemSpawner {
+ 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()?));
}
_ => {}
}
@@ -581,68 +2045,225 @@ impl Arrow {
}
}
+/// The metadata bundle for [OminousItemSpawner].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct ArrowMetadataBundle {
- _marker: Arrow,
- parent: AbstractArrowMetadataBundle,
- effect_color: EffectColor,
+pub struct OminousItemSpawnerMetadataBundle {
+ _marker: OminousItemSpawner,
+ parent: AbstractEntityMetadataBundle,
+ ominous_item_spawner_item: OminousItemSpawnerItem,
}
-impl Default for ArrowMetadataBundle {
+impl Default for OminousItemSpawnerMetadataBundle {
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),
+ _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()),
},
- effect_color: EffectColor(-1),
+ ominous_item_spawner_item: OminousItemSpawnerItem(Default::default()),
}
}
}
-#[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);
+/// 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 Axolotl;
-impl Axolotl {
+pub struct Painting;
+impl Painting {
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()?));
+ 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
+ 8 => {
+ entity.insert(PaintingDirection(d.value.into_direction()?));
}
- 18 => {
- entity.insert(PlayingDead(d.value.into_boolean()?));
+ 9 => {
+ entity.insert(PaintingVariant(d.value.into_painting_variant()?));
}
- 19 => {
- entity.insert(AxolotlFromBucket(d.value.into_boolean()?));
+ _ => {}
+ }
+ Ok(())
+ }
+}
+
+/// The metadata bundle for [Painting].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct PaintingMetadataBundle {
+ _marker: Painting,
+ parent: AbstractEntityMetadataBundle,
+ painting_direction: PaintingDirection,
+ painting_variant: PaintingVariant,
+}
+impl Default for PaintingMetadataBundle {
+ 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()),
+ },
+ 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 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(())
+ }
+}
+
+/// The metadata bundle for [ShulkerBullet].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct ShulkerBulletMetadataBundle {
+ _marker: ShulkerBullet,
+ parent: AbstractEntityMetadataBundle,
+}
+impl Default for ShulkerBulletMetadataBundle {
+ 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()),
+ },
+ }
+ }
+}
+
+/// 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 SmallFireball;
+impl SmallFireball {
+ 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()?));
}
_ => {}
}
@@ -650,199 +2271,224 @@ impl Axolotl {
}
}
+/// The metadata bundle for [SmallFireball].
+///
+/// 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 SmallFireballMetadataBundle {
+ _marker: SmallFireball,
+ parent: AbstractEntityMetadataBundle,
+ small_fireball_item_stack: SmallFireballItemStack,
}
-impl Default for AxolotlMetadataBundle {
+impl Default for SmallFireballMetadataBundle {
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: 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()),
},
- axolotl_variant: AxolotlVariant(0),
- playing_dead: PlayingDead(false),
- axolotl_from_bucket: AxolotlFromBucket(false),
+ small_fireball_item_stack: SmallFireballItemStack(Default::default()),
}
}
}
+/// 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 BambooChestRaft;
-impl BambooChestRaft {
+pub struct Tnt;
+impl Tnt {
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(Fuse(d.value.into_int()?));
+ }
+ 9 => {
+ entity.insert(TntBlockState(d.value.into_block_state()?));
+ }
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [Tnt].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct BambooChestRaftMetadataBundle {
- _marker: BambooChestRaft,
- parent: AbstractBoatMetadataBundle,
+pub struct TntMetadataBundle {
+ _marker: Tnt,
+ parent: AbstractEntityMetadataBundle,
+ fuse: Fuse,
+ tnt_block_state: TntBlockState,
}
-impl Default for BambooChestRaftMetadataBundle {
+impl Default for TntMetadataBundle {
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: 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()),
},
+ fuse: Fuse(80),
+ tnt_block_state: TntBlockState(Default::default()),
}
}
}
+/// 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 BambooRaft;
-impl BambooRaft {
+pub struct WindCharge;
+impl WindCharge {
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 [WindCharge].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct BambooRaftMetadataBundle {
- _marker: BambooRaft,
- parent: AbstractBoatMetadataBundle,
+pub struct WindChargeMetadataBundle {
+ _marker: WindCharge,
+ parent: AbstractEntityMetadataBundle,
}
-impl Default for BambooRaftMetadataBundle {
+impl Default for WindChargeMetadataBundle {
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: 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, Copy, Deref, DerefMut, PartialEq)]
-pub struct Resting(pub bool);
+/// 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 Bat;
-impl Bat {
+pub struct WitherSkull;
+impl WitherSkull {
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(Dangerous(d.value.into_boolean()?));
}
_ => {}
}
@@ -850,80 +2496,97 @@ impl Bat {
}
}
+/// The metadata bundle for [WitherSkull].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct BatMetadataBundle {
- _marker: Bat,
- parent: AbstractInsentientMetadataBundle,
- resting: Resting,
+pub struct WitherSkullMetadataBundle {
+ _marker: WitherSkull,
+ parent: AbstractEntityMetadataBundle,
+ dangerous: Dangerous,
}
-impl Default for BatMetadataBundle {
+impl Default for WitherSkullMetadataBundle {
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: 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()),
},
- resting: Resting(false),
+ dangerous: Dangerous(false),
}
}
}
-#[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);
+#[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 Bee;
-impl Bee {
+pub struct AbstractArrow;
+impl AbstractArrow {
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 => {
+ 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
+ 8 => {
let bitfield = d.value.into_byte()?;
- entity.insert(HasNectar(bitfield & 0x8 != 0));
- entity.insert(HasStung(bitfield & 0x4 != 0));
- entity.insert(BeeRolling(bitfield & 0x2 != 0));
+ entity.insert(CritArrow(bitfield & 0x1 != 0));
+ entity.insert(NoPhysics(bitfield & 0x2 != 0));
}
- 18 => {
- entity.insert(BeeAngerEndTime(d.value.into_long()?));
+ 9 => {
+ entity.insert(PierceLevel(d.value.into_byte()?));
+ }
+ 10 => {
+ entity.insert(InGround(d.value.into_boolean()?));
}
_ => {}
}
@@ -931,201 +2594,244 @@ impl Bee {
}
}
+/// The metadata bundle for [AbstractArrow].
+///
+/// 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 AbstractArrowMetadataBundle {
+ _marker: AbstractArrow,
+ parent: AbstractEntityMetadataBundle,
+ crit_arrow: CritArrow,
+ no_physics: NoPhysics,
+ pierce_level: PierceLevel,
+ in_ground: InGround,
}
-impl Default for BeeMetadataBundle {
+impl Default for AbstractArrowMetadataBundle {
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: 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()),
},
- has_nectar: HasNectar(false),
- has_stung: HasStung(false),
- bee_rolling: BeeRolling(false),
- bee_anger_end_time: BeeAngerEndTime(-1),
+ crit_arrow: CritArrow(false),
+ no_physics: NoPhysics(false),
+ pierce_level: PierceLevel(0),
+ in_ground: InGround(false),
}
}
}
+/// 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 BirchBoat;
-impl BirchBoat {
+pub struct Arrow;
+impl Arrow {
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..=10 => AbstractArrow::apply_metadata(entity, d)?,
+ 11 => {
+ entity.insert(EffectColor(d.value.into_int()?));
+ }
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [Arrow].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct BirchBoatMetadataBundle {
- _marker: BirchBoat,
- parent: AbstractBoatMetadataBundle,
+pub struct ArrowMetadataBundle {
+ _marker: Arrow,
+ parent: AbstractArrowMetadataBundle,
+ effect_color: EffectColor,
}
-impl Default for BirchBoatMetadataBundle {
+impl Default for ArrowMetadataBundle {
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),
+ _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()),
},
- 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),
},
+ effect_color: EffectColor(-1),
}
}
}
+/// 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 BirchChestBoat;
-impl BirchChestBoat {
+pub struct SpectralArrow;
+impl SpectralArrow {
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..=10 => AbstractArrow::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [SpectralArrow].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct BirchChestBoatMetadataBundle {
- _marker: BirchChestBoat,
- parent: AbstractBoatMetadataBundle,
+pub struct SpectralArrowMetadataBundle {
+ _marker: SpectralArrow,
+ parent: AbstractArrowMetadataBundle,
}
-impl Default for BirchChestBoatMetadataBundle {
+impl Default for SpectralArrowMetadataBundle {
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),
+ _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()),
},
- 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),
},
}
}
}
-#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)]
-pub struct Charged(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 Blaze;
-impl Blaze {
+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 => {
- let bitfield = d.value.into_byte()?;
- entity.insert(Charged(bitfield & 0x1 != 0));
+ 0..=10 => AbstractArrow::apply_metadata(entity, d)?,
+ 11 => {
+ entity.insert(Loyalty(d.value.into_byte()?));
+ }
+ 12 => {
+ entity.insert(Foil(d.value.into_boolean()?));
}
_ => {}
}
@@ -1133,93 +2839,299 @@ impl Blaze {
}
}
+/// The metadata bundle for [Trident].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct BlazeMetadataBundle {
- _marker: Blaze,
- parent: AbstractMonsterMetadataBundle,
- charged: Charged,
+pub struct TridentMetadataBundle {
+ _marker: Trident,
+ parent: AbstractArrowMetadataBundle,
+ loyalty: Loyalty,
+ foil: Foil,
}
-impl Default for BlazeMetadataBundle {
+impl Default for TridentMetadataBundle {
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: 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),
},
- charged: Charged(false),
+ loyalty: Loyalty(0),
+ foil: Foil(false),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [AbstractDisplay].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct TransformationInterpolationStartDeltaTicks(pub i32);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [AbstractDisplay].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct TransformationInterpolationDuration(pub i32);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [AbstractDisplay].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct PosRotInterpolationDuration(pub i32);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [AbstractDisplay].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct Translation(pub Vec3f32);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [AbstractDisplay].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct Scale(pub Vec3f32);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [AbstractDisplay].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct LeftRotation(pub Quaternion);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [AbstractDisplay].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct RightRotation(pub Quaternion);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [AbstractDisplay].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct BillboardRenderConstraints(pub u8);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [AbstractDisplay].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct BrightnessOverride(pub i32);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [AbstractDisplay].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct ViewRange(pub f32);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [AbstractDisplay].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct ShadowRadius(pub f32);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [AbstractDisplay].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct ShadowStrength(pub f32);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [AbstractDisplay].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct AbstractDisplayWidth(pub f32);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [AbstractDisplay].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct AbstractDisplayHeight(pub f32);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [AbstractDisplay].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct GlowColorOverride(pub i32);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// 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 AbstractDisplay;
+impl AbstractDisplay {
+ 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()?));
+ }
+ _ => {}
+ }
+ Ok(())
+ }
+}
+
+/// The metadata bundle for [AbstractDisplay].
+///
+/// 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,
+}
+impl Default for AbstractDisplayMetadataBundle {
+ 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()),
+ },
+ 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 BlockDisplay;
impl BlockDisplay {
@@ -1238,6 +3150,9 @@ impl BlockDisplay {
}
}
+/// The metadata bundle for [BlockDisplay].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
pub struct BlockDisplayMetadataBundle {
_marker: BlockDisplay,
@@ -1307,19 +3222,48 @@ impl Default for BlockDisplayMetadataBundle {
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct BoggedSheared(pub bool);
+/// 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 Bogged;
-impl Bogged {
+pub struct ItemDisplay;
+impl ItemDisplay {
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..=22 => AbstractDisplay::apply_metadata(entity, d)?,
+ 23 => {
+ entity.insert(ItemDisplayItemStack(d.value.into_item_stack()?));
+ }
+ 24 => {
+ entity.insert(ItemDisplayItemDisplay(d.value.into_byte()?));
}
_ => {}
}
@@ -1327,153 +3271,444 @@ impl Bogged {
}
}
+/// The metadata bundle for [ItemDisplay].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct BoggedMetadataBundle {
- _marker: Bogged,
- parent: AbstractMonsterMetadataBundle,
- bogged_sheared: BoggedSheared,
+pub struct ItemDisplayMetadataBundle {
+ _marker: ItemDisplay,
+ parent: AbstractDisplayMetadataBundle,
+ item_display_item_stack: ItemDisplayItemStack,
+ item_display_item_display: ItemDisplayItemDisplay,
}
-impl Default for BoggedMetadataBundle {
+impl Default for ItemDisplayMetadataBundle {
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: 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()),
},
+ 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),
},
- bogged_sheared: BoggedSheared(false),
+ 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 Breeze;
-impl Breeze {
+pub struct TextDisplay;
+impl TextDisplay {
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..=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 BreezeMetadataBundle {
- _marker: Breeze,
- parent: AbstractMonsterMetadataBundle,
+pub struct TextDisplayMetadataBundle {
+ _marker: TextDisplay,
+ parent: AbstractDisplayMetadataBundle,
+ text: Text,
+ line_width: LineWidth,
+ background_color: BackgroundColor,
+ text_opacity: TextOpacity,
+ style_flags: StyleFlags,
}
-impl Default for BreezeMetadataBundle {
+impl Default for TextDisplayMetadataBundle {
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: 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(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<Particle>);
+/// 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<BlockPos>);
+/// 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 BreezeWindCharge;
-impl BreezeWindCharge {
+pub struct AbstractLiving;
+impl AbstractLiving {
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()?));
+ }
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [AbstractLiving].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct BreezeWindChargeMetadataBundle {
- _marker: BreezeWindCharge,
+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 BreezeWindChargeMetadataBundle {
+impl Default for AbstractLivingMetadataBundle {
fn default() -> Self {
Self {
- _marker: BreezeWindCharge,
+ _marker: AbstractLiving,
parent: AbstractEntityMetadataBundle {
_marker: AbstractEntity,
on_fire: OnFire(false),
@@ -1491,36 +3726,111 @@ impl Default for BreezeWindChargeMetadataBundle {
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, 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);
+#[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 Camel;
-impl Camel {
+pub struct ArmorStand;
+impl ArmorStand {
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..=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(CamelDash(d.value.into_boolean()?));
+ entity.insert(LeftArmPose(d.value.into_rotations()?));
}
19 => {
- entity.insert(LastPoseChangeTick(d.value.into_long()?));
+ entity.insert(RightArmPose(d.value.into_rotations()?));
+ }
+ 20 => {
+ entity.insert(LeftLegPose(d.value.into_rotations()?));
+ }
+ 21 => {
+ entity.insert(RightLegPose(d.value.into_rotations()?));
}
_ => {}
}
@@ -1528,197 +3838,336 @@ impl Camel {
}
}
+/// The metadata bundle for [ArmorStand].
+///
+/// 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 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 CamelMetadataBundle {
+impl Default for ArmorStandMetadataBundle {
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),
- },
+ _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()),
},
- tamed: Tamed(false),
- eating: Eating(false),
- abstract_horse_standing: AbstractHorseStanding(false),
- bred: Bred(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),
},
- camel_dash: CamelDash(false),
- last_pose_change_tick: LastPoseChangeTick(0),
+ 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()),
}
}
}
+/// 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 CamelHusk;
-impl CamelHusk {
+pub struct AbstractAvatar;
+impl AbstractAvatar {
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..=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 CamelHuskMetadataBundle {
- _marker: CamelHusk,
- parent: CamelMetadataBundle,
+pub struct AbstractAvatarMetadataBundle {
+ _marker: AbstractAvatar,
+ parent: AbstractLivingMetadataBundle,
+ player_main_hand: PlayerMainHand,
+ player_mode_customisation: PlayerModeCustomisation,
}
-impl Default for CamelHuskMetadataBundle {
+impl Default for AbstractAvatarMetadataBundle {
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),
+ _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()),
},
- camel_dash: CamelDash(false),
- last_pose_change_tick: LastPoseChangeTick(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, 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<Uuid>);
-#[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);
+/// 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<FormattedText>);
+/// 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 Cat;
-impl Cat {
+pub struct Mannequin;
+impl Mannequin {
pub fn apply_metadata(
entity: &mut bevy_ecs::system::EntityCommands,
d: EntityDataItem,
) -> Result<(), UpdateMetadataError> {
match d.index {
- 0..=18 => AbstractTameable::apply_metadata(entity, d)?,
+ 0..=16 => AbstractAvatar::apply_metadata(entity, d)?,
+ 17 => {
+ entity.insert(Profile(d.value.into_resolvable_profile()?));
+ }
+ 18 => {
+ entity.insert(Immovable(d.value.into_boolean()?));
+ }
19 => {
- entity.insert(CatVariant(d.value.into_cat_variant()?));
+ entity.insert(Description(d.value.into_optional_formatted_text()?));
}
- 20 => {
- entity.insert(IsLying(d.value.into_boolean()?));
+ _ => {}
+ }
+ Ok(())
+ }
+}
+
+/// The metadata bundle for [Mannequin].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct MannequinMetadataBundle {
+ _marker: Mannequin,
+ parent: AbstractAvatarMetadataBundle,
+ profile: Profile,
+ immovable: Immovable,
+ description: Description,
+}
+impl Default for MannequinMetadataBundle {
+ 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()),
+ },
+ 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),
+ },
+ profile: Profile(Default::default()),
+ immovable: Immovable(false),
+ description: Description(Default::default()),
+ }
+ }
+}
+
+/// 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 Player;
+impl Player {
+ pub fn apply_metadata(
+ entity: &mut bevy_ecs::system::EntityCommands,
+ d: EntityDataItem,
+ ) -> Result<(), UpdateMetadataError> {
+ match d.index {
+ 0..=16 => AbstractAvatar::apply_metadata(entity, d)?,
+ 17 => {
+ entity.insert(PlayerAbsorption(d.value.into_float()?));
}
- 21 => {
- entity.insert(RelaxStateOne(d.value.into_boolean()?));
+ 18 => {
+ entity.insert(Score(d.value.into_int()?));
}
- 22 => {
- entity.insert(CatCollarColor(d.value.into_int()?));
+ 19 => {
+ entity.insert(ShoulderParrotLeft(d.value.into_optional_unsigned_int()?));
+ }
+ 20 => {
+ entity.insert(ShoulderParrotRight(d.value.into_optional_unsigned_int()?));
}
_ => {}
}
@@ -1726,183 +4175,421 @@ impl Cat {
}
}
+/// The metadata bundle for [Player].
+///
+/// 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 PlayerMetadataBundle {
+ _marker: Player,
+ parent: AbstractAvatarMetadataBundle,
+ player_absorption: PlayerAbsorption,
+ score: Score,
+ shoulder_parrot_left: ShoulderParrotLeft,
+ shoulder_parrot_right: ShoulderParrotRight,
}
-impl Default for CatMetadataBundle {
+impl Default for PlayerMetadataBundle {
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),
+ _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()),
},
+ 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),
},
- tame: Tame(false),
- in_sitting_pose: InSittingPose(false),
- owneruuid: Owneruuid(None),
+ player_main_hand: PlayerMainHand(Default::default()),
+ player_mode_customisation: PlayerModeCustomisation(0),
},
- 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()),
+ player_absorption: PlayerAbsorption(0.0),
+ score: Score(0),
+ shoulder_parrot_left: ShoulderParrotLeft(OptionalUnsignedInt(None)),
+ shoulder_parrot_right: ShoulderParrotRight(OptionalUnsignedInt(None)),
}
}
}
-#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)]
-pub struct Climbing(pub bool);
+#[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 CaveSpider;
-impl CaveSpider {
+pub struct AbstractInsentient;
+impl AbstractInsentient {
pub fn apply_metadata(
entity: &mut bevy_ecs::system::EntityCommands,
d: EntityDataItem,
) -> Result<(), UpdateMetadataError> {
match d.index {
- 0..=16 => Spider::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 CaveSpiderMetadataBundle {
- _marker: CaveSpider,
- parent: SpiderMetadataBundle,
+pub struct AbstractInsentientMetadataBundle {
+ _marker: AbstractInsentient,
+ parent: AbstractLivingMetadataBundle,
+ no_ai: NoAi,
+ left_handed: LeftHanded,
+ aggressive: Aggressive,
}
-impl Default for CaveSpiderMetadataBundle {
+impl Default for AbstractInsentientMetadataBundle {
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),
- },
+ _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, 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 Bat;
+impl Bat {
+ 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));
+ }
+ _ => {}
+ }
+ 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),
},
- climbing: Climbing(false),
+ no_ai: NoAi(false),
+ left_handed: LeftHanded(false),
+ aggressive: Aggressive(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 CherryBoat;
-impl CherryBoat {
+pub struct EnderDragon;
+impl EnderDragon {
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 => 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 CherryBoatMetadataBundle {
- _marker: CherryBoat,
- parent: AbstractBoatMetadataBundle,
+pub struct EnderDragonMetadataBundle {
+ _marker: EnderDragon,
+ parent: AbstractInsentientMetadataBundle,
+ phase: Phase,
}
-impl Default for CherryBoatMetadataBundle {
+impl Default for EnderDragonMetadataBundle {
fn default() -> Self {
Self {
- _marker: CherryBoat,
- parent: AbstractBoatMetadataBundle {
- _marker: AbstractBoat,
- parent: AbstractVehicleMetadataBundle {
- _marker: AbstractVehicle,
+ _marker: EnderDragon,
+ parent: AbstractInsentientMetadataBundle {
+ _marker: AbstractInsentient,
+ parent: AbstractLivingMetadataBundle {
+ _marker: AbstractLiving,
parent: AbstractEntityMetadataBundle {
_marker: AbstractEntity,
on_fire: OnFire(false),
@@ -1920,46 +4607,83 @@ impl Default for CherryBoatMetadataBundle {
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),
+ no_ai: NoAi(false),
+ left_handed: LeftHanded(false),
+ aggressive: Aggressive(false),
},
+ phase: Phase(Default::default()),
}
}
}
+/// 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 CherryChestBoat;
-impl CherryChestBoat {
+pub struct Ghast;
+impl Ghast {
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 => 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 CherryChestBoatMetadataBundle {
- _marker: CherryChestBoat,
- parent: AbstractBoatMetadataBundle,
+pub struct GhastMetadataBundle {
+ _marker: Ghast,
+ parent: AbstractInsentientMetadataBundle,
+ is_charging: IsCharging,
}
-impl Default for CherryChestBoatMetadataBundle {
+impl Default for GhastMetadataBundle {
fn default() -> Self {
Self {
- _marker: CherryChestBoat,
- parent: AbstractBoatMetadataBundle {
- _marker: AbstractBoat,
- parent: AbstractVehicleMetadataBundle {
- _marker: AbstractVehicle,
+ _marker: Ghast,
+ parent: AbstractInsentientMetadataBundle {
+ _marker: AbstractInsentient,
+ parent: AbstractLivingMetadataBundle {
+ _marker: AbstractLiving,
parent: AbstractEntityMetadataBundle {
_marker: AbstractEntity,
on_fire: OnFire(false),
@@ -1977,50 +4701,83 @@ impl Default for CherryChestBoatMetadataBundle {
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),
+ no_ai: NoAi(false),
+ left_handed: LeftHanded(false),
+ aggressive: Aggressive(false),
},
+ is_charging: IsCharging(false),
}
}
}
-#[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 [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 ChestMinecart;
-impl ChestMinecart {
+pub struct Phantom;
+impl Phantom {
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..=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 ChestMinecartMetadataBundle {
- _marker: ChestMinecart,
- parent: AbstractMinecartMetadataBundle,
+pub struct PhantomMetadataBundle {
+ _marker: Phantom,
+ parent: AbstractInsentientMetadataBundle,
+ phantom_size: PhantomSize,
}
-impl Default for ChestMinecartMetadataBundle {
+impl Default for PhantomMetadataBundle {
fn default() -> Self {
Self {
- _marker: ChestMinecart,
- parent: AbstractMinecartMetadataBundle {
- _marker: AbstractMinecart,
- parent: AbstractVehicleMetadataBundle {
- _marker: AbstractVehicle,
+ _marker: Phantom,
+ parent: AbstractInsentientMetadataBundle {
+ _marker: AbstractInsentient,
+ parent: AbstractLivingMetadataBundle {
+ _marker: AbstractLiving,
parent: AbstractEntityMetadataBundle {
_marker: AbstractEntity,
on_fire: OnFire(false),
@@ -2038,30 +4795,59 @@ impl Default for ChestMinecartMetadataBundle {
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),
},
- custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR),
- display_offset: DisplayOffset(Default::default()),
+ no_ai: NoAi(false),
+ left_handed: LeftHanded(false),
+ aggressive: Aggressive(false),
},
+ phantom_size: PhantomSize(0),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct ChickenVariant(pub azalea_registry::data::PigVariant);
+/// 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 Chicken;
-impl Chicken {
+pub struct Slime;
+impl Slime {
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..=15 => AbstractInsentient::apply_metadata(entity, d)?,
+ 16 => {
+ entity.insert(SlimeSize(d.value.into_int()?));
}
_ => {}
}
@@ -2069,178 +4855,290 @@ impl Chicken {
}
}
+/// The metadata bundle for [Slime].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct ChickenMetadataBundle {
- _marker: Chicken,
- parent: AbstractAnimalMetadataBundle,
- chicken_variant: ChickenVariant,
+pub struct SlimeMetadataBundle {
+ _marker: Slime,
+ parent: AbstractInsentientMetadataBundle,
+ slime_size: SlimeSize,
}
-impl Default for ChickenMetadataBundle {
+impl Default for SlimeMetadataBundle {
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),
- },
+ _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()),
},
- 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),
},
- chicken_variant: ChickenVariant(azalea_registry::data::PigVariant::new_raw(0)),
+ slime_size: SlimeSize(1),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct AbstractFishFromBucket(pub bool);
+/// 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 Cod;
-impl Cod {
+pub struct MagmaCube;
+impl MagmaCube {
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..=16 => Slime::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [MagmaCube].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct CodMetadataBundle {
- _marker: Cod,
- parent: AbstractFishMetadataBundle,
+pub struct MagmaCubeMetadataBundle {
+ _marker: MagmaCube,
+ parent: SlimeMetadataBundle,
}
-impl Default for CodMetadataBundle {
+impl Default for MagmaCubeMetadataBundle {
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),
+ _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()),
},
- 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_fish_from_bucket: AbstractFishFromBucket(false),
+ slime_size: SlimeSize(1),
},
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct CommandName(pub String);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct LastOutput(pub FormattedText);
+/// 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 CommandBlockMinecart;
-impl CommandBlockMinecart {
+pub struct AbstractCreature;
+impl AbstractCreature {
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..=15 => AbstractInsentient::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [AbstractCreature].
+///
+/// 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 AbstractCreatureMetadataBundle {
+ _marker: AbstractCreature,
+ parent: AbstractInsentientMetadataBundle,
}
-impl Default for CommandBlockMinecartMetadataBundle {
+impl Default for AbstractCreatureMetadataBundle {
fn default() -> Self {
Self {
- _marker: CommandBlockMinecart,
- parent: AbstractMinecartMetadataBundle {
- _marker: AbstractMinecart,
- parent: AbstractVehicleMetadataBundle {
- _marker: AbstractVehicle,
+ _marker: AbstractCreature,
+ parent: AbstractInsentientMetadataBundle {
+ _marker: AbstractInsentient,
+ parent: AbstractLivingMetadataBundle {
+ _marker: AbstractLiving,
parent: AbstractEntityMetadataBundle {
_marker: AbstractEntity,
on_fire: OnFire(false),
@@ -2258,23 +5156,160 @@ impl Default for CommandBlockMinecartMetadataBundle {
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),
},
- custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR),
- display_offset: DisplayOffset(Default::default()),
+ no_ai: NoAi(false),
+ left_handed: LeftHanded(false),
+ aggressive: Aggressive(false),
},
- command_name: CommandName("".to_owned()),
- last_output: LastOutput(Default::default()),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// 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 Allay;
+impl Allay {
+ 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()?));
+ }
+ 17 => {
+ entity.insert(CanDuplicate(d.value.into_boolean()?));
+ }
+ _ => {}
+ }
+ Ok(())
+ }
+}
+
+/// The metadata bundle for [Allay].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct AllayMetadataBundle {
+ _marker: Allay,
+ parent: AbstractCreatureMetadataBundle,
+ dancing: Dancing,
+ can_duplicate: CanDuplicate,
+}
+impl Default for AllayMetadataBundle {
+ 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),
+ }
+ }
+}
+
+/// A metadata field for [CopperGolem].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct WeatherState(pub WeatheringCopperStateKind);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// 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 CopperGolem;
impl CopperGolem {
@@ -2296,6 +5331,9 @@ impl CopperGolem {
}
}
+/// The metadata bundle for [CopperGolem].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
pub struct CopperGolemMetadataBundle {
_marker: CopperGolem,
@@ -2350,19 +5388,44 @@ impl Default for CopperGolemMetadataBundle {
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct CowVariant(pub azalea_registry::data::ChickenVariant);
+#[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 Cow;
-impl Cow {
+pub struct IronGolem;
+impl IronGolem {
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..=15 => AbstractCreature::apply_metadata(entity, d)?,
+ 16 => {
+ let bitfield = d.value.into_byte()?;
+ entity.insert(PlayerCreated(bitfield & 0x1 != 0));
}
_ => {}
}
@@ -2370,95 +5433,105 @@ impl Cow {
}
}
+/// The metadata bundle for [IronGolem].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct CowMetadataBundle {
- _marker: Cow,
- parent: AbstractAnimalMetadataBundle,
- cow_variant: CowVariant,
+pub struct IronGolemMetadataBundle {
+ _marker: IronGolem,
+ parent: AbstractCreatureMetadataBundle,
+ player_created: PlayerCreated,
}
-impl Default for CowMetadataBundle {
+impl Default for IronGolemMetadataBundle {
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),
+ _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),
},
- abstract_ageable_baby: AbstractAgeableBaby(false),
+ no_ai: NoAi(false),
+ left_handed: LeftHanded(false),
+ aggressive: Aggressive(false),
},
},
- cow_variant: CowVariant(azalea_registry::data::ChickenVariant::new_raw(0)),
+ player_created: PlayerCreated(false),
}
}
}
-#[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<BlockPos>);
+/// 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 Creaking;
-impl Creaking {
+pub struct Pufferfish;
+impl Pufferfish {
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 => AbstractCreature::apply_metadata(entity, d)?,
16 => {
- entity.insert(CanMove(d.value.into_boolean()?));
+ entity.insert(PufferfishFromBucket(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()?));
+ entity.insert(PuffState(d.value.into_int()?));
}
_ => {}
}
@@ -2466,90 +5539,113 @@ impl Creaking {
}
}
+/// The metadata bundle for [Pufferfish].
+///
+/// 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 PufferfishMetadataBundle {
+ _marker: Pufferfish,
+ parent: AbstractCreatureMetadataBundle,
+ pufferfish_from_bucket: PufferfishFromBucket,
+ puff_state: PuffState,
}
-impl Default for CreakingMetadataBundle {
+impl Default for PufferfishMetadataBundle {
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),
+ _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()),
},
- 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),
},
},
- can_move: CanMove(true),
- is_active: IsActive(false),
- is_tearing_down: IsTearingDown(false),
- home_pos: HomePos(None),
+ pufferfish_from_bucket: PufferfishFromBucket(false),
+ puff_state: PuffState(0),
}
}
}
-#[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 [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 Creeper;
-impl Creeper {
+pub struct Shulker;
+impl Shulker {
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 => AbstractCreature::apply_metadata(entity, d)?,
16 => {
- entity.insert(SwellDir(d.value.into_int()?));
+ entity.insert(AttachFace(d.value.into_direction()?));
}
17 => {
- entity.insert(IsPowered(d.value.into_boolean()?));
+ entity.insert(Peek(d.value.into_byte()?));
}
18 => {
- entity.insert(IsIgnited(d.value.into_boolean()?));
+ entity.insert(Color(d.value.into_byte()?));
}
_ => {}
}
@@ -2557,183 +5653,435 @@ impl Creeper {
}
}
+/// The metadata bundle for [Shulker].
+///
+/// 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 ShulkerMetadataBundle {
+ _marker: Shulker,
+ parent: AbstractCreatureMetadataBundle,
+ attach_face: AttachFace,
+ peek: Peek,
+ color: Color,
}
-impl Default for CreeperMetadataBundle {
+impl Default for ShulkerMetadataBundle {
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),
+ _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()),
},
- 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),
},
},
- swell_dir: SwellDir(-1),
- is_powered: IsPowered(false),
- is_ignited: IsIgnited(false),
+ attach_face: AttachFace(Default::default()),
+ peek: Peek(0),
+ color: Color(16),
}
}
}
+#[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 DarkOakBoat;
-impl DarkOakBoat {
+pub struct SnowGolem;
+impl SnowGolem {
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 => AbstractCreature::apply_metadata(entity, d)?,
+ 16 => {
+ let bitfield = d.value.into_byte()?;
+ entity.insert(HasPumpkin(bitfield & 0x10 != 0));
+ }
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [SnowGolem].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct DarkOakBoatMetadataBundle {
- _marker: DarkOakBoat,
- parent: AbstractBoatMetadataBundle,
+pub struct SnowGolemMetadataBundle {
+ _marker: SnowGolem,
+ parent: AbstractCreatureMetadataBundle,
+ has_pumpkin: HasPumpkin,
}
-impl Default for DarkOakBoatMetadataBundle {
+impl Default for SnowGolemMetadataBundle {
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()),
+ _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),
},
- 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),
},
+ has_pumpkin: HasPumpkin(true),
}
}
}
+/// 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 DarkOakChestBoat;
-impl DarkOakChestBoat {
+pub struct Tadpole;
+impl Tadpole {
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 => AbstractCreature::apply_metadata(entity, d)?,
+ 16 => {
+ entity.insert(TadpoleFromBucket(d.value.into_boolean()?));
+ }
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [Tadpole].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct DarkOakChestBoatMetadataBundle {
- _marker: DarkOakChestBoat,
- parent: AbstractBoatMetadataBundle,
+pub struct TadpoleMetadataBundle {
+ _marker: Tadpole,
+ parent: AbstractCreatureMetadataBundle,
+ tadpole_from_bucket: TadpoleFromBucket,
}
-impl Default for DarkOakChestBoatMetadataBundle {
+impl Default for TadpoleMetadataBundle {
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()),
+ _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),
+ },
+ },
+ tadpole_from_bucket: TadpoleFromBucket(false),
+ }
+ }
+}
+
+/// 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 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(())
+ }
+}
+
+/// The metadata bundle for [AbstractAgeable].
+///
+/// This type should generally not be used directly.
+#[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),
+ },
+ no_ai: NoAi(false),
+ left_handed: LeftHanded(false),
+ aggressive: Aggressive(false),
},
- paddle_left: PaddleLeft(false),
- paddle_right: PaddleRight(false),
- bubble_time: BubbleTime(0),
},
+ abstract_ageable_baby: AbstractAgeableBaby(false),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [Dolphin].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct GotFish(pub bool);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// 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 Dolphin;
impl Dolphin {
@@ -2755,6 +6103,9 @@ impl Dolphin {
}
}
+/// The metadata bundle for [Dolphin].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
pub struct DolphinMetadataBundle {
_marker: Dolphin,
@@ -2813,173 +6164,162 @@ impl Default for DolphinMetadataBundle {
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct Chest(pub bool);
+/// 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 Donkey;
-impl Donkey {
+pub struct Squid;
+impl Squid {
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..=16 => AbstractAgeable::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [Squid].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct DonkeyMetadataBundle {
- _marker: Donkey,
- parent: AbstractChestedHorseMetadataBundle,
+pub struct SquidMetadataBundle {
+ _marker: Squid,
+ parent: AbstractAgeableMetadataBundle,
}
-impl Default for DonkeyMetadataBundle {
+impl Default for SquidMetadataBundle {
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),
- },
+ _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()),
},
- 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),
- },
- }
- }
-}
-
-#[derive(Component)]
-pub struct DragonFireball;
-impl DragonFireball {
- 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 DragonFireballMetadataBundle {
- _marker: DragonFireball,
- parent: AbstractEntityMetadataBundle,
-}
-impl Default for DragonFireballMetadataBundle {
- 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()),
+ abstract_ageable_baby: AbstractAgeableBaby(false),
},
}
}
}
-#[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);
+/// 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 Drowned;
-impl Drowned {
+pub struct GlowSquid;
+impl GlowSquid {
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 => Squid::apply_metadata(entity, d)?,
+ 17 => {
+ entity.insert(DarkTicksRemaining(d.value.into_int()?));
+ }
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [GlowSquid].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct DrownedMetadataBundle {
- _marker: Drowned,
- parent: ZombieMetadataBundle,
+pub struct GlowSquidMetadataBundle {
+ _marker: GlowSquid,
+ parent: SquidMetadataBundle,
+ dark_ticks_remaining: DarkTicksRemaining,
}
-impl Default for DrownedMetadataBundle {
+impl Default for GlowSquidMetadataBundle {
fn default() -> Self {
Self {
- _marker: Drowned,
- parent: ZombieMetadataBundle {
- _marker: Zombie,
- parent: AbstractMonsterMetadataBundle {
- _marker: AbstractMonster,
+ _marker: GlowSquid,
+ parent: SquidMetadataBundle {
+ _marker: Squid,
+ parent: AbstractAgeableMetadataBundle {
+ _marker: AbstractAgeable,
parent: AbstractCreatureMetadataBundle {
_marker: AbstractCreature,
parent: AbstractInsentientMetadataBundle {
@@ -3019,100 +6359,206 @@ impl Default for DrownedMetadataBundle {
aggressive: Aggressive(false),
},
},
+ abstract_ageable_baby: AbstractAgeableBaby(false),
},
- zombie_baby: ZombieBaby(false),
- special_type: SpecialType(0),
- drowned_conversion: DrownedConversion(false),
},
+ dark_ticks_remaining: DarkTicksRemaining(0),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct AbstractThrownItemProjectileItemStack(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 `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 Egg;
-impl Egg {
+pub struct AbstractAnimal;
+impl AbstractAnimal {
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 => AbstractAgeable::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [AbstractAnimal].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct EggMetadataBundle {
- _marker: Egg,
- parent: AbstractThrownItemProjectileMetadataBundle,
+pub struct AbstractAnimalMetadataBundle {
+ _marker: AbstractAnimal,
+ parent: AbstractAgeableMetadataBundle,
}
-impl Default for EggMetadataBundle {
+impl Default for AbstractAnimalMetadataBundle {
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()),
+ _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_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack(
- Default::default(),
- ),
+ abstract_ageable_baby: AbstractAgeableBaby(false),
},
}
}
}
-#[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 [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 ElderGuardian;
-impl ElderGuardian {
+pub struct Armadillo;
+impl Armadillo {
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..=16 => AbstractAnimal::apply_metadata(entity, d)?,
+ 17 => {
+ entity.insert(ArmadilloState(d.value.into_armadillo_state()?));
+ }
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [Armadillo].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct ElderGuardianMetadataBundle {
- _marker: ElderGuardian,
- parent: GuardianMetadataBundle,
+pub struct ArmadilloMetadataBundle {
+ _marker: Armadillo,
+ parent: AbstractAnimalMetadataBundle,
+ armadillo_state: ArmadilloState,
}
-impl Default for ElderGuardianMetadataBundle {
+impl Default for ArmadilloMetadataBundle {
fn default() -> Self {
Self {
- _marker: ElderGuardian,
- parent: GuardianMetadataBundle {
- _marker: Guardian,
- parent: AbstractMonsterMetadataBundle {
- _marker: AbstractMonster,
+ _marker: Armadillo,
+ parent: AbstractAnimalMetadataBundle {
+ _marker: AbstractAnimal,
+ parent: AbstractAgeableMetadataBundle {
+ _marker: AbstractAgeable,
parent: AbstractCreatureMetadataBundle {
_marker: AbstractCreature,
parent: AbstractInsentientMetadataBundle {
@@ -3152,86 +6598,66 @@ impl Default for ElderGuardianMetadataBundle {
aggressive: Aggressive(false),
},
},
+ abstract_ageable_baby: AbstractAgeableBaby(false),
},
- moving: Moving(false),
- attack_target: AttackTarget(0),
},
+ armadillo_state: ArmadilloState(Default::default()),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct BeamTarget(pub Option<BlockPos>);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct ShowBottom(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 EndCrystal;
-impl EndCrystal {
+pub struct Axolotl;
+impl Axolotl {
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()?));
+ 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
+ 17 => {
+ entity.insert(AxolotlVariant(d.value.into_int()?));
}
- 9 => {
- entity.insert(ShowBottom(d.value.into_boolean()?));
+ 18 => {
+ entity.insert(PlayingDead(d.value.into_boolean()?));
}
- _ => {}
- }
- Ok(())
- }
-}
-
-#[derive(Bundle)]
-pub struct EndCrystalMetadataBundle {
- _marker: EndCrystal,
- parent: AbstractEntityMetadataBundle,
- beam_target: BeamTarget,
- show_bottom: ShowBottom,
-}
-impl Default for EndCrystalMetadataBundle {
- 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()),
- },
- beam_target: BeamTarget(None),
- show_bottom: ShowBottom(true),
- }
- }
-}
-
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct Phase(pub i32);
-#[derive(Component)]
-pub struct EnderDragon;
-impl EnderDragon {
- 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()?));
+ 19 => {
+ entity.insert(AxolotlFromBucket(d.value.into_boolean()?));
}
_ => {}
}
@@ -3239,129 +6665,130 @@ impl EnderDragon {
}
}
+/// The metadata bundle for [Axolotl].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct EnderDragonMetadataBundle {
- _marker: EnderDragon,
- parent: AbstractInsentientMetadataBundle,
- phase: Phase,
+pub struct AxolotlMetadataBundle {
+ _marker: Axolotl,
+ parent: AbstractAnimalMetadataBundle,
+ axolotl_variant: AxolotlVariant,
+ playing_dead: PlayingDead,
+ axolotl_from_bucket: AxolotlFromBucket,
}
-impl Default for EnderDragonMetadataBundle {
+impl Default for AxolotlMetadataBundle {
fn default() -> Self {
Self {
- _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()),
+ _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),
+ },
},
- 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(Component)]
-pub struct EnderPearl;
-impl EnderPearl {
- 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(())
- }
-}
-
-#[derive(Bundle)]
-pub struct EnderPearlMetadataBundle {
- _marker: EnderPearl,
- parent: AbstractThrownItemProjectileMetadataBundle,
-}
-impl Default for EnderPearlMetadataBundle {
- fn default() -> Self {
- Self {
- _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_ageable_baby: AbstractAgeableBaby(false),
},
- abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack(
- Default::default(),
- ),
},
+ axolotl_variant: AxolotlVariant(0),
+ playing_dead: PlayingDead(false),
+ axolotl_from_bucket: AxolotlFromBucket(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 [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 Enderman;
-impl Enderman {
+pub struct Bee;
+impl Bee {
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()?));
- }
+ 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
17 => {
- entity.insert(Creepy(d.value.into_boolean()?));
+ 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(StaredAt(d.value.into_boolean()?));
+ entity.insert(BeeAngerEndTime(d.value.into_long()?));
}
_ => {}
}
@@ -3369,664 +6796,357 @@ impl Enderman {
}
}
+/// The metadata bundle for [Bee].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct EndermanMetadataBundle {
- _marker: Enderman,
- parent: AbstractMonsterMetadataBundle,
- carry_state: CarryState,
- creepy: Creepy,
- stared_at: StaredAt,
+pub struct BeeMetadataBundle {
+ _marker: Bee,
+ parent: AbstractAnimalMetadataBundle,
+ has_nectar: HasNectar,
+ has_stung: HasStung,
+ bee_rolling: BeeRolling,
+ bee_anger_end_time: BeeAngerEndTime,
}
-impl Default for EndermanMetadataBundle {
+impl Default for BeeMetadataBundle {
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()),
+ _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),
},
- 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),
},
},
- carry_state: CarryState(azalea_block::BlockState::AIR),
- creepy: Creepy(false),
- stared_at: StaredAt(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 Endermite;
-impl Endermite {
+pub struct Chicken;
+impl Chicken {
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 => 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 EndermiteMetadataBundle {
- _marker: Endermite,
- parent: AbstractMonsterMetadataBundle,
+pub struct ChickenMetadataBundle {
+ _marker: Chicken,
+ parent: AbstractAnimalMetadataBundle,
+ chicken_variant: ChickenVariant,
}
-impl Default for EndermiteMetadataBundle {
+impl Default for ChickenMetadataBundle {
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()),
+ _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),
},
- 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),
},
},
+ chicken_variant: ChickenVariant(azalea_registry::data::PigVariant::new_raw(0)),
}
}
}
-#[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 [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 Evoker;
-impl Evoker {
+pub struct Cow;
+impl Cow {
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(CowVariant(d.value.into_chicken_variant()?));
+ }
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [Cow].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct EvokerMetadataBundle {
- _marker: Evoker,
- parent: AbstractSpellcasterIllagerMetadataBundle,
+pub struct CowMetadataBundle {
+ _marker: Cow,
+ parent: AbstractAnimalMetadataBundle,
+ cow_variant: CowVariant,
}
-impl Default for EvokerMetadataBundle {
+impl Default for CowMetadataBundle {
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),
+ _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()),
},
- 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),
- },
- spell_casting: SpellCasting(0),
- },
- }
- }
-}
-
-#[derive(Component)]
-pub struct EvokerFangs;
-impl EvokerFangs {
- 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 EvokerFangsMetadataBundle {
- _marker: EvokerFangs,
- parent: AbstractEntityMetadataBundle,
-}
-impl Default for EvokerFangsMetadataBundle {
- 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()),
- },
- }
- }
-}
-
-#[derive(Component)]
-pub struct ExperienceBottle;
-impl ExperienceBottle {
- 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(())
- }
-}
-
-#[derive(Bundle)]
-pub struct ExperienceBottleMetadataBundle {
- _marker: ExperienceBottle,
- parent: AbstractThrownItemProjectileMetadataBundle,
-}
-impl Default for ExperienceBottleMetadataBundle {
- 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()),
+ abstract_ageable_baby: AbstractAgeableBaby(false),
},
- abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack(
- Default::default(),
- ),
},
+ cow_variant: CowVariant(azalea_registry::data::ChickenVariant::new_raw(0)),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct Value(pub i32);
-#[derive(Component)]
-pub struct ExperienceOrb;
-impl ExperienceOrb {
- 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()?));
- }
- _ => {}
- }
- Ok(())
- }
-}
-
-#[derive(Bundle)]
-pub struct ExperienceOrbMetadataBundle {
- _marker: ExperienceOrb,
- parent: AbstractEntityMetadataBundle,
- value: Value,
-}
-impl Default for ExperienceOrbMetadataBundle {
- 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()),
- },
- value: Value(0),
- }
- }
-}
-
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct EyeOfEnderItemStack(pub ItemStack);
-#[derive(Component)]
-pub struct EyeOfEnder;
-impl EyeOfEnder {
- 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()?));
- }
- _ => {}
- }
- Ok(())
- }
-}
-
-#[derive(Bundle)]
-pub struct EyeOfEnderMetadataBundle {
- _marker: EyeOfEnder,
- parent: AbstractEntityMetadataBundle,
- eye_of_ender_item_stack: EyeOfEnderItemStack,
-}
-impl Default for EyeOfEnderMetadataBundle {
- 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()),
- },
- eye_of_ender_item_stack: EyeOfEnderItemStack(Default::default()),
- }
- }
-}
-
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct StartPos(pub BlockPos);
-#[derive(Component)]
-pub struct FallingBlock;
-impl FallingBlock {
- 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()?));
- }
- _ => {}
- }
- Ok(())
- }
-}
-
-#[derive(Bundle)]
-pub struct FallingBlockMetadataBundle {
- _marker: FallingBlock,
- parent: AbstractEntityMetadataBundle,
- start_pos: StartPos,
-}
-impl Default for FallingBlockMetadataBundle {
- 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()),
- },
- start_pos: StartPos(BlockPos::new(0, 0, 0)),
- }
- }
-}
-
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct FireballItemStack(pub ItemStack);
-#[derive(Component)]
-pub struct Fireball;
-impl Fireball {
- 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()?));
- }
- _ => {}
- }
- Ok(())
- }
-}
-
-#[derive(Bundle)]
-pub struct FireballMetadataBundle {
- _marker: Fireball,
- parent: AbstractEntityMetadataBundle,
- fireball_item_stack: FireballItemStack,
-}
-impl Default for FireballMetadataBundle {
- 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()),
- },
- fireball_item_stack: FireballItemStack(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)]
-pub struct FireworkRocket;
-impl FireworkRocket {
- 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()?));
- }
- _ => {}
- }
- Ok(())
- }
-}
-
-#[derive(Bundle)]
-pub struct FireworkRocketMetadataBundle {
- _marker: FireworkRocket,
- parent: AbstractEntityMetadataBundle,
- fireworks_item: FireworksItem,
- attached_to_target: AttachedToTarget,
- shot_at_angle: ShotAtAngle,
-}
-impl Default for FireworkRocketMetadataBundle {
- 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()),
- },
- fireworks_item: FireworksItem(Default::default()),
- attached_to_target: AttachedToTarget(OptionalUnsignedInt(None)),
- shot_at_angle: ShotAtAngle(false),
- }
- }
-}
-
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct HookedEntity(pub i32);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct Biting(pub bool);
-#[derive(Component)]
-pub struct FishingBobber;
-impl FishingBobber {
- 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()?));
- }
- 9 => {
- entity.insert(Biting(d.value.into_boolean()?));
- }
- _ => {}
- }
- Ok(())
- }
-}
-
-#[derive(Bundle)]
-pub struct FishingBobberMetadataBundle {
- _marker: FishingBobber,
- parent: AbstractEntityMetadataBundle,
- hooked_entity: HookedEntity,
- biting: Biting,
-}
-impl Default for FishingBobberMetadataBundle {
- 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()),
- },
- hooked_entity: HookedEntity(0),
- biting: Biting(false),
- }
- }
-}
-
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [Fox].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct FoxKind(pub i32);
-#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)]
+#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
+/// A metadata field for [Fox].
pub struct FoxSitting(pub bool);
-#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)]
+#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
+/// A metadata field for [Fox].
pub struct Faceplanted(pub bool);
-#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)]
+#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
+/// A metadata field for [Fox].
pub struct Defending(pub bool);
-#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)]
+#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
+/// A metadata field for [Fox].
pub struct Sleeping(pub bool);
-#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)]
+#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
+/// A metadata field for [Fox].
pub struct Pouncing(pub bool);
-#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)]
+#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
+/// A metadata field for [Fox].
pub struct FoxCrouching(pub bool);
-#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)]
+#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
+/// A metadata field for [Fox].
pub struct FoxInterested(pub bool);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [Fox].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct TrustedId0(pub Option<Uuid>);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [Fox].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct TrustedId1(pub Option<Uuid>);
+/// 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 Fox;
impl Fox {
@@ -4061,6 +7181,9 @@ impl Fox {
}
}
+/// The metadata bundle for [Fox].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
pub struct FoxMetadataBundle {
_marker: Fox,
@@ -4140,10 +7263,37 @@ impl Default for FoxMetadataBundle {
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [Frog].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct FrogVariant(pub azalea_registry::data::WolfSoundVariant);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// 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 Frog;
impl Frog {
@@ -4165,6 +7315,9 @@ impl Frog {
}
}
+/// The metadata bundle for [Frog].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
pub struct FrogMetadataBundle {
_marker: Frog,
@@ -4228,19 +7381,58 @@ impl Default for FrogMetadataBundle {
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct Fuel(pub bool);
+/// 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 FurnaceMinecart;
-impl FurnaceMinecart {
+pub struct Goat;
+impl Goat {
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..=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()?));
}
_ => {}
}
@@ -4248,62 +7440,120 @@ impl FurnaceMinecart {
}
}
+/// The metadata bundle for [Goat].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct FurnaceMinecartMetadataBundle {
- _marker: FurnaceMinecart,
- parent: AbstractMinecartMetadataBundle,
- fuel: Fuel,
+pub struct GoatMetadataBundle {
+ _marker: Goat,
+ parent: AbstractAnimalMetadataBundle,
+ is_screaming_goat: IsScreamingGoat,
+ has_left_horn: HasLeftHorn,
+ has_right_horn: HasRightHorn,
}
-impl Default for FurnaceMinecartMetadataBundle {
+impl Default for GoatMetadataBundle {
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: 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),
+ },
},
- 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()),
},
- fuel: Fuel(false),
+ is_screaming_goat: IsScreamingGoat(false),
+ has_left_horn: HasLeftHorn(true),
+ has_right_horn: HasRightHorn(true),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct IsCharging(pub bool);
+/// 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 Ghast;
-impl Ghast {
+pub struct HappyGhast;
+impl HappyGhast {
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(IsCharging(d.value.into_boolean()?));
+ 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
+ 17 => {
+ entity.insert(IsLeashHolder(d.value.into_boolean()?));
+ }
+ 18 => {
+ entity.insert(StaysStill(d.value.into_boolean()?));
}
_ => {}
}
@@ -4311,193 +7561,329 @@ impl Ghast {
}
}
+/// The metadata bundle for [HappyGhast].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct GhastMetadataBundle {
- _marker: Ghast,
- parent: AbstractInsentientMetadataBundle,
- is_charging: IsCharging,
+pub struct HappyGhastMetadataBundle {
+ _marker: HappyGhast,
+ parent: AbstractAnimalMetadataBundle,
+ is_leash_holder: IsLeashHolder,
+ stays_still: StaysStill,
}
-impl Default for GhastMetadataBundle {
+impl Default for HappyGhastMetadataBundle {
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()),
+ _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),
+ },
},
- 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),
},
- is_charging: IsCharging(false),
+ 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 Giant;
-impl Giant {
+pub struct Hoglin;
+impl Hoglin {
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 => 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 GiantMetadataBundle {
- _marker: Giant,
- parent: AbstractMonsterMetadataBundle,
+pub struct HoglinMetadataBundle {
+ _marker: Hoglin,
+ parent: AbstractAnimalMetadataBundle,
+ hoglin_immune_to_zombification: HoglinImmuneToZombification,
}
-impl Default for GiantMetadataBundle {
+impl Default for HoglinMetadataBundle {
fn default() -> Self {
Self {
- _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()),
+ _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),
},
- 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),
},
},
+ hoglin_immune_to_zombification: HoglinImmuneToZombification(false),
}
}
}
-#[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);
+/// 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 GlowItemFrame;
-impl GlowItemFrame {
+pub struct Mooshroom;
+impl Mooshroom {
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 => 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 GlowItemFrameMetadataBundle {
- _marker: GlowItemFrame,
- parent: ItemFrameMetadataBundle,
+pub struct MooshroomMetadataBundle {
+ _marker: Mooshroom,
+ parent: AbstractAnimalMetadataBundle,
+ mooshroom_kind: MooshroomKind,
}
-impl Default for GlowItemFrameMetadataBundle {
+impl Default for MooshroomMetadataBundle {
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: 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),
},
- item_frame_direction: ItemFrameDirection(Default::default()),
- item_frame_item: ItemFrameItem(Default::default()),
- rotation: Rotation(0),
},
+ mooshroom_kind: MooshroomKind(Default::default()),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct DarkTicksRemaining(pub i32);
+/// 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 GlowSquid;
-impl GlowSquid {
+pub struct Ocelot;
+impl Ocelot {
pub fn apply_metadata(
entity: &mut bevy_ecs::system::EntityCommands,
d: EntityDataItem,
) -> Result<(), UpdateMetadataError> {
match d.index {
- 0..=16 => Squid::apply_metadata(entity, d)?,
+ 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
17 => {
- entity.insert(DarkTicksRemaining(d.value.into_int()?));
+ entity.insert(Trusting(d.value.into_boolean()?));
}
_ => {}
}
@@ -4505,18 +7891,21 @@ impl GlowSquid {
}
}
+/// The metadata bundle for [Ocelot].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct GlowSquidMetadataBundle {
- _marker: GlowSquid,
- parent: SquidMetadataBundle,
- dark_ticks_remaining: DarkTicksRemaining,
+pub struct OcelotMetadataBundle {
+ _marker: Ocelot,
+ parent: AbstractAnimalMetadataBundle,
+ trusting: Trusting,
}
-impl Default for GlowSquidMetadataBundle {
+impl Default for OcelotMetadataBundle {
fn default() -> Self {
Self {
- _marker: GlowSquid,
- parent: SquidMetadataBundle {
- _marker: Squid,
+ _marker: Ocelot,
+ parent: AbstractAnimalMetadataBundle {
+ _marker: AbstractAnimal,
parent: AbstractAgeableMetadataBundle {
_marker: AbstractAgeable,
parent: AbstractCreatureMetadataBundle {
@@ -4561,20 +7950,73 @@ impl Default for GlowSquidMetadataBundle {
abstract_ageable_baby: AbstractAgeableBaby(false),
},
},
- dark_ticks_remaining: DarkTicksRemaining(0),
+ trusting: Trusting(false),
}
}
}
-#[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);
+/// 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 Goat;
-impl Goat {
+pub struct Panda;
+impl Panda {
pub fn apply_metadata(
entity: &mut bevy_ecs::system::EntityCommands,
d: EntityDataItem,
@@ -4582,13 +8024,26 @@ impl Goat {
match d.index {
0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
17 => {
- entity.insert(IsScreamingGoat(d.value.into_boolean()?));
+ entity.insert(PandaUnhappyCounter(d.value.into_int()?));
}
18 => {
- entity.insert(HasLeftHorn(d.value.into_boolean()?));
+ entity.insert(SneezeCounter(d.value.into_int()?));
}
19 => {
- entity.insert(HasRightHorn(d.value.into_boolean()?));
+ 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()?));
}
_ => {}
}
@@ -4596,18 +8051,27 @@ impl Goat {
}
}
+/// The metadata bundle for [Panda].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct GoatMetadataBundle {
- _marker: Goat,
+pub struct PandaMetadataBundle {
+ _marker: Panda,
parent: AbstractAnimalMetadataBundle,
- is_screaming_goat: IsScreamingGoat,
- has_left_horn: HasLeftHorn,
- has_right_horn: HasRightHorn,
+ 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 GoatMetadataBundle {
+impl Default for PandaMetadataBundle {
fn default() -> Self {
Self {
- _marker: Goat,
+ _marker: Panda,
parent: AbstractAnimalMetadataBundle {
_marker: AbstractAnimal,
parent: AbstractAgeableMetadataBundle {
@@ -4654,27 +8118,64 @@ impl Default for GoatMetadataBundle {
abstract_ageable_baby: AbstractAgeableBaby(false),
},
},
- is_screaming_goat: IsScreamingGoat(false),
- has_left_horn: HasLeftHorn(true),
- has_right_horn: HasRightHorn(true),
+ 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),
}
}
}
+/// 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 Guardian;
-impl Guardian {
+pub struct Pig;
+impl Pig {
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()?));
- }
+ 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
17 => {
- entity.insert(AttackTarget(d.value.into_int()?));
+ entity.insert(PigBoostTime(d.value.into_int()?));
+ }
+ 18 => {
+ entity.insert(PigVariant(d.value.into_frog_variant()?));
}
_ => {}
}
@@ -4682,70 +8183,103 @@ impl Guardian {
}
}
+/// The metadata bundle for [Pig].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct GuardianMetadataBundle {
- _marker: Guardian,
- parent: AbstractMonsterMetadataBundle,
- moving: Moving,
- attack_target: AttackTarget,
+pub struct PigMetadataBundle {
+ _marker: Pig,
+ parent: AbstractAnimalMetadataBundle,
+ pig_boost_time: PigBoostTime,
+ pig_variant: PigVariant,
}
-impl Default for GuardianMetadataBundle {
+impl Default for PigMetadataBundle {
fn default() -> Self {
Self {
- _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()),
+ _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),
},
- 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),
},
},
- moving: Moving(false),
- attack_target: AttackTarget(0),
+ pig_boost_time: PigBoostTime(0),
+ pig_variant: PigVariant(azalea_registry::data::FrogVariant::new_raw(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 [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 HappyGhast;
-impl HappyGhast {
+pub struct PolarBear;
+impl PolarBear {
pub fn apply_metadata(
entity: &mut bevy_ecs::system::EntityCommands,
d: EntityDataItem,
@@ -4753,10 +8287,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(PolarBearStanding(d.value.into_boolean()?));
}
_ => {}
}
@@ -4764,17 +8295,19 @@ impl HappyGhast {
}
}
+/// The metadata bundle for [PolarBear].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct HappyGhastMetadataBundle {
- _marker: HappyGhast,
+pub struct PolarBearMetadataBundle {
+ _marker: PolarBear,
parent: AbstractAnimalMetadataBundle,
- is_leash_holder: IsLeashHolder,
- stays_still: StaysStill,
+ polar_bear_standing: PolarBearStanding,
}
-impl Default for HappyGhastMetadataBundle {
+impl Default for PolarBearMetadataBundle {
fn default() -> Self {
Self {
- _marker: HappyGhast,
+ _marker: PolarBear,
parent: AbstractAnimalMetadataBundle {
_marker: AbstractAnimal,
parent: AbstractAgeableMetadataBundle {
@@ -4821,17 +8354,41 @@ impl Default for HappyGhastMetadataBundle {
abstract_ageable_baby: AbstractAgeableBaby(false),
},
},
- is_leash_holder: IsLeashHolder(false),
- stays_still: StaysStill(false),
+ polar_bear_standing: PolarBearStanding(false),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct HoglinImmuneToZombification(pub bool);
+/// 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 Hoglin;
-impl Hoglin {
+pub struct Rabbit;
+impl Rabbit {
pub fn apply_metadata(
entity: &mut bevy_ecs::system::EntityCommands,
d: EntityDataItem,
@@ -4839,7 +8396,7 @@ impl Hoglin {
match d.index {
0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
17 => {
- entity.insert(HoglinImmuneToZombification(d.value.into_boolean()?));
+ entity.insert(RabbitKind(d.value.into_int()?));
}
_ => {}
}
@@ -4847,16 +8404,19 @@ impl Hoglin {
}
}
+/// The metadata bundle for [Rabbit].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct HoglinMetadataBundle {
- _marker: Hoglin,
+pub struct RabbitMetadataBundle {
+ _marker: Rabbit,
parent: AbstractAnimalMetadataBundle,
- hoglin_immune_to_zombification: HoglinImmuneToZombification,
+ rabbit_kind: RabbitKind,
}
-impl Default for HoglinMetadataBundle {
+impl Default for RabbitMetadataBundle {
fn default() -> Self {
Self {
- _marker: Hoglin,
+ _marker: Rabbit,
parent: AbstractAnimalMetadataBundle {
_marker: AbstractAnimal,
parent: AbstractAgeableMetadataBundle {
@@ -4903,80 +8463,166 @@ impl Default for HoglinMetadataBundle {
abstract_ageable_baby: AbstractAgeableBaby(false),
},
},
- hoglin_immune_to_zombification: HoglinImmuneToZombification(false),
+ 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 HopperMinecart;
-impl HopperMinecart {
+pub struct Sheep;
+impl Sheep {
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 => {
+ 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 HopperMinecartMetadataBundle {
- _marker: HopperMinecart,
- parent: AbstractMinecartMetadataBundle,
+pub struct SheepMetadataBundle {
+ _marker: Sheep,
+ parent: AbstractAnimalMetadataBundle,
+ sheep_sheared: SheepSheared,
}
-impl Default for HopperMinecartMetadataBundle {
+impl Default for SheepMetadataBundle {
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()),
+ _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),
},
- custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR),
- display_offset: DisplayOffset(Default::default()),
},
+ sheep_sheared: SheepSheared(false),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct HorseTypeVariant(pub i32);
+/// 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 Horse;
-impl Horse {
+pub struct Sniffer;
+impl Sniffer {
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..=16 => AbstractAnimal::apply_metadata(entity, d)?,
+ 17 => {
+ entity.insert(SnifferState(d.value.into_sniffer_state()?));
+ }
18 => {
- entity.insert(HorseTypeVariant(d.value.into_int()?));
+ entity.insert(DropSeedAtTick(d.value.into_int()?));
}
_ => {}
}
@@ -4984,102 +8630,142 @@ impl Horse {
}
}
+/// The metadata bundle for [Sniffer].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct HorseMetadataBundle {
- _marker: Horse,
- parent: AbstractHorseMetadataBundle,
- horse_type_variant: HorseTypeVariant,
+pub struct SnifferMetadataBundle {
+ _marker: Sniffer,
+ parent: AbstractAnimalMetadataBundle,
+ sniffer_state: SnifferState,
+ drop_seed_at_tick: DropSeedAtTick,
}
-impl Default for HorseMetadataBundle {
+impl Default for SnifferMetadataBundle {
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),
+ _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()),
},
- 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),
},
- tamed: Tamed(false),
- eating: Eating(false),
- abstract_horse_standing: AbstractHorseStanding(false),
- bred: Bred(false),
},
- horse_type_variant: HorseTypeVariant(0),
+ 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 Husk;
-impl Husk {
+pub struct Strider;
+impl Strider {
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 => {
+ 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 HuskMetadataBundle {
- _marker: Husk,
- parent: ZombieMetadataBundle,
+pub struct StriderMetadataBundle {
+ _marker: Strider,
+ parent: AbstractAnimalMetadataBundle,
+ strider_boost_time: StriderBoostTime,
+ suffocating: Suffocating,
}
-impl Default for HuskMetadataBundle {
+impl Default for StriderMetadataBundle {
fn default() -> Self {
Self {
- _marker: Husk,
- parent: ZombieMetadataBundle {
- _marker: Zombie,
- parent: AbstractMonsterMetadataBundle {
- _marker: AbstractMonster,
+ _marker: Strider,
+ parent: AbstractAnimalMetadataBundle {
+ _marker: AbstractAnimal,
+ parent: AbstractAgeableMetadataBundle {
+ _marker: AbstractAgeable,
parent: AbstractCreatureMetadataBundle {
_marker: AbstractCreature,
parent: AbstractInsentientMetadataBundle {
@@ -5119,173 +8805,197 @@ impl Default for HuskMetadataBundle {
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),
}
}
}
+/// 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 Illusioner;
-impl Illusioner {
+pub struct Turtle;
+impl Turtle {
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(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 IllusionerMetadataBundle {
- _marker: Illusioner,
- parent: AbstractSpellcasterIllagerMetadataBundle,
+pub struct TurtleMetadataBundle {
+ _marker: Turtle,
+ parent: AbstractAnimalMetadataBundle,
+ has_egg: HasEgg,
+ laying_egg: LayingEgg,
}
-impl Default for IllusionerMetadataBundle {
+impl Default for TurtleMetadataBundle {
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: 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()),
},
- 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),
},
+ has_egg: HasEgg(false),
+ laying_egg: LayingEgg(false),
}
}
}
-#[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),
- }
- }
-}
-
-#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)]
-pub struct PlayerCreated(pub bool);
+#[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 IronGolem;
-impl IronGolem {
+pub struct AbstractHorse;
+impl AbstractHorse {
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 => {
+ 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
+ 17 => {
let bitfield = d.value.into_byte()?;
- entity.insert(PlayerCreated(bitfield & 0x1 != 0));
+ entity.insert(Tamed(bitfield & 0x2 != 0));
+ entity.insert(Eating(bitfield & 0x10 != 0));
+ entity.insert(AbstractHorseStanding(bitfield & 0x20 != 0));
+ entity.insert(Bred(bitfield & 0x8 != 0));
}
_ => {}
}
@@ -5293,128 +9003,122 @@ impl IronGolem {
}
}
+/// The metadata bundle for [AbstractHorse].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct IronGolemMetadataBundle {
- _marker: IronGolem,
- parent: AbstractCreatureMetadataBundle,
- player_created: PlayerCreated,
+pub struct AbstractHorseMetadataBundle {
+ _marker: AbstractHorse,
+ parent: AbstractAnimalMetadataBundle,
+ tamed: Tamed,
+ eating: Eating,
+ abstract_horse_standing: AbstractHorseStanding,
+ bred: Bred,
}
-impl Default for IronGolemMetadataBundle {
+impl Default for AbstractHorseMetadataBundle {
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: 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),
},
- 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),
- }
- }
-}
-
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct ItemItem(pub ItemStack);
-#[derive(Component)]
-pub struct Item;
-impl Item {
- 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()?));
- }
- _ => {}
- }
- Ok(())
- }
-}
-
-#[derive(Bundle)]
-pub struct ItemMetadataBundle {
- _marker: Item,
- parent: AbstractEntityMetadataBundle,
- item_item: ItemItem,
-}
-impl Default for ItemMetadataBundle {
- 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()),
- },
- item_item: ItemItem(Default::default()),
+ tamed: Tamed(false),
+ eating: Eating(false),
+ abstract_horse_standing: AbstractHorseStanding(false),
+ bred: Bred(false),
}
}
}
-#[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 [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 ItemDisplay;
-impl ItemDisplay {
+pub struct Camel;
+impl Camel {
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..=17 => AbstractHorse::apply_metadata(entity, d)?,
+ 18 => {
+ entity.insert(CamelDash(d.value.into_boolean()?));
}
- 24 => {
- entity.insert(ItemDisplayItemDisplay(d.value.into_byte()?));
+ 19 => {
+ entity.insert(LastPoseChangeTick(d.value.into_long()?));
}
_ => {}
}
@@ -5422,396 +9126,791 @@ impl ItemDisplay {
}
}
+/// The metadata bundle for [Camel].
+///
+/// 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 CamelMetadataBundle {
+ _marker: Camel,
+ parent: AbstractHorseMetadataBundle,
+ camel_dash: CamelDash,
+ last_pose_change_tick: LastPoseChangeTick,
}
-impl Default for ItemDisplayMetadataBundle {
+impl Default for CamelMetadataBundle {
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: 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),
+ },
},
- 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),
+ tamed: Tamed(false),
+ eating: Eating(false),
+ abstract_horse_standing: AbstractHorseStanding(false),
+ bred: Bred(false),
},
- item_display_item_stack: ItemDisplayItemStack(Default::default()),
- item_display_item_display: ItemDisplayItemDisplay(Default::default()),
+ 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 ItemFrame;
-impl ItemFrame {
+pub struct CamelHusk;
+impl CamelHusk {
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()?));
- }
- 9 => {
- entity.insert(ItemFrameItem(d.value.into_item_stack()?));
- }
- 10 => {
- entity.insert(Rotation(d.value.into_int()?));
- }
+ 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 ItemFrameMetadataBundle {
- _marker: ItemFrame,
- parent: AbstractEntityMetadataBundle,
- item_frame_direction: ItemFrameDirection,
- item_frame_item: ItemFrameItem,
- rotation: Rotation,
+pub struct CamelHuskMetadataBundle {
+ _marker: CamelHusk,
+ parent: CamelMetadataBundle,
}
-impl Default for ItemFrameMetadataBundle {
+impl Default for CamelHuskMetadataBundle {
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: 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),
},
- item_frame_direction: ItemFrameDirection(Default::default()),
- item_frame_item: ItemFrameItem(Default::default()),
- rotation: Rotation(0),
}
}
}
+/// 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 JungleBoat;
-impl JungleBoat {
+pub struct Horse;
+impl Horse {
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)?,
+ 18 => {
+ entity.insert(HorseTypeVariant(d.value.into_int()?));
+ }
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [Horse].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct JungleBoatMetadataBundle {
- _marker: JungleBoat,
- parent: AbstractBoatMetadataBundle,
+pub struct HorseMetadataBundle {
+ _marker: Horse,
+ parent: AbstractHorseMetadataBundle,
+ horse_type_variant: HorseTypeVariant,
}
-impl Default for JungleBoatMetadataBundle {
+impl Default for HorseMetadataBundle {
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: 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),
},
- 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),
},
+ 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 JungleChestBoat;
-impl JungleChestBoat {
+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 JungleChestBoatMetadataBundle {
- _marker: JungleChestBoat,
- parent: AbstractBoatMetadataBundle,
+pub struct SkeletonHorseMetadataBundle {
+ _marker: SkeletonHorse,
+ parent: AbstractHorseMetadataBundle,
}
-impl Default for JungleChestBoatMetadataBundle {
+impl Default for SkeletonHorseMetadataBundle {
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: 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 LeashKnot;
-impl LeashKnot {
+pub struct ZombieHorse;
+impl ZombieHorse {
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..=17 => AbstractHorse::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [ZombieHorse].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct LeashKnotMetadataBundle {
- _marker: LeashKnot,
- parent: AbstractEntityMetadataBundle,
+pub struct ZombieHorseMetadataBundle {
+ _marker: ZombieHorse,
+ parent: AbstractHorseMetadataBundle,
}
-impl Default for LeashKnotMetadataBundle {
+impl Default for ZombieHorseMetadataBundle {
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: 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),
+ },
+ },
+ tamed: Tamed(false),
+ eating: Eating(false),
+ abstract_horse_standing: AbstractHorseStanding(false),
+ bred: Bred(false),
},
}
}
}
+/// 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 LightningBolt;
-impl LightningBolt {
+pub struct AbstractChestedHorse;
+impl AbstractChestedHorse {
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..=17 => AbstractHorse::apply_metadata(entity, d)?,
+ 18 => {
+ entity.insert(Chest(d.value.into_boolean()?));
+ }
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [AbstractChestedHorse].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct LightningBoltMetadataBundle {
- _marker: LightningBolt,
- parent: AbstractEntityMetadataBundle,
+pub struct AbstractChestedHorseMetadataBundle {
+ _marker: AbstractChestedHorse,
+ parent: AbstractHorseMetadataBundle,
+ chest: Chest,
}
-impl Default for LightningBoltMetadataBundle {
+impl Default for AbstractChestedHorseMetadataBundle {
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: 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),
}
}
}
+/// 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 LingeringPotion;
-impl LingeringPotion {
+pub struct Donkey;
+impl Donkey {
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..=18 => AbstractChestedHorse::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [Donkey].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct LingeringPotionMetadataBundle {
- _marker: LingeringPotion,
- parent: AbstractThrownItemProjectileMetadataBundle,
+pub struct DonkeyMetadataBundle {
+ _marker: Donkey,
+ parent: AbstractChestedHorseMetadataBundle,
}
-impl Default for LingeringPotionMetadataBundle {
+impl Default for DonkeyMetadataBundle {
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: 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),
},
- abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack(
- Default::default(),
- ),
+ chest: Chest(false),
},
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// A metadata field for [Llama].
+#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct Strength(pub i32);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// 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 Llama;
impl Llama {
@@ -5833,6 +9932,9 @@ impl Llama {
}
}
+/// The metadata bundle for [Llama].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
pub struct LlamaMetadataBundle {
_marker: Llama,
@@ -5908,501 +10010,151 @@ impl Default for LlamaMetadataBundle {
}
}
+/// 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 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()),
- },
- }
- }
-}
-
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct SlimeSize(pub i32);
-#[derive(Component)]
-pub struct MagmaCube;
-impl MagmaCube {
- pub fn apply_metadata(
- entity: &mut bevy_ecs::system::EntityCommands,
- d: EntityDataItem,
- ) -> Result<(), UpdateMetadataError> {
- match d.index {
- 0..=16 => Slime::apply_metadata(entity, d)?,
- _ => {}
- }
- Ok(())
- }
-}
-
-#[derive(Bundle)]
-pub struct MagmaCubeMetadataBundle {
- _marker: MagmaCube,
- parent: SlimeMetadataBundle,
-}
-impl Default for MagmaCubeMetadataBundle {
- 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()),
- },
- 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),
- },
- }
- }
-}
-
-#[derive(Component)]
-pub struct MangroveBoat;
-impl MangroveBoat {
- 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 MangroveBoatMetadataBundle {
- _marker: MangroveBoat,
- parent: AbstractBoatMetadataBundle,
-}
-impl Default for MangroveBoatMetadataBundle {
- 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()),
- },
- 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 MangroveChestBoat;
-impl MangroveChestBoat {
- 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 MangroveChestBoatMetadataBundle {
- _marker: MangroveChestBoat,
- parent: AbstractBoatMetadataBundle,
-}
-impl Default for MangroveChestBoatMetadataBundle {
- 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()),
- },
- 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, 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<FormattedText>);
-#[derive(Component)]
-pub struct Mannequin;
-impl Mannequin {
- pub fn apply_metadata(
- entity: &mut bevy_ecs::system::EntityCommands,
- d: EntityDataItem,
- ) -> Result<(), UpdateMetadataError> {
- match d.index {
- 0..=16 => AbstractAvatar::apply_metadata(entity, d)?,
- 17 => {
- entity.insert(Profile(d.value.into_resolvable_profile()?));
- }
- 18 => {
- entity.insert(Immovable(d.value.into_boolean()?));
- }
- 19 => {
- entity.insert(Description(d.value.into_optional_formatted_text()?));
- }
- _ => {}
- }
- Ok(())
- }
-}
-
-#[derive(Bundle)]
-pub struct MannequinMetadataBundle {
- _marker: Mannequin,
- parent: AbstractAvatarMetadataBundle,
- profile: Profile,
- immovable: Immovable,
- description: Description,
-}
-impl Default for MannequinMetadataBundle {
- 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()),
- },
- 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),
- },
- profile: Profile(Default::default()),
- immovable: Immovable(false),
- description: Description(Default::default()),
- }
- }
-}
-
-#[derive(Component)]
-pub struct Marker;
-impl Marker {
- 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 MarkerMetadataBundle {
- _marker: Marker,
- parent: AbstractEntityMetadataBundle,
-}
-impl Default for MarkerMetadataBundle {
- 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()),
- },
- }
- }
-}
-
-#[derive(Component)]
-pub struct Minecart;
-impl Minecart {
- 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 MinecartMetadataBundle {
- _marker: Minecart,
- parent: AbstractMinecartMetadataBundle,
-}
-impl Default for MinecartMetadataBundle {
- 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()),
- },
- 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 MooshroomKind(pub i32);
-#[derive(Component)]
-pub struct Mooshroom;
-impl Mooshroom {
+pub struct TraderLlama;
+impl TraderLlama {
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(MooshroomKind(d.value.into_int()?));
- }
+ 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 MooshroomMetadataBundle {
- _marker: Mooshroom,
- parent: AbstractAnimalMetadataBundle,
- mooshroom_kind: MooshroomKind,
+pub struct TraderLlamaMetadataBundle {
+ _marker: TraderLlama,
+ parent: LlamaMetadataBundle,
}
-impl Default for MooshroomMetadataBundle {
+impl Default for TraderLlamaMetadataBundle {
fn default() -> Self {
Self {
- _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()),
+ _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),
+ },
},
- 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),
},
- mooshroom_kind: MooshroomKind(Default::default()),
}
}
}
+/// 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 Mule;
impl Mule {
@@ -6418,6 +10170,9 @@ impl Mule {
}
}
+/// The metadata bundle for [Mule].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
pub struct MuleMetadataBundle {
_marker: Mule,
@@ -6489,212 +10244,49 @@ impl Default for MuleMetadataBundle {
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct NautilusDash(pub bool);
-#[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(())
- }
-}
-
-#[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(Component)]
-pub struct OakBoat;
-impl OakBoat {
- 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 OakBoatMetadataBundle {
- _marker: OakBoat,
- parent: AbstractBoatMetadataBundle,
-}
-impl Default for OakBoatMetadataBundle {
- 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()),
- },
- 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 OakChestBoat;
-impl OakChestBoat {
- 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 OakChestBoatMetadataBundle {
- _marker: OakChestBoat,
- parent: AbstractBoatMetadataBundle,
-}
-impl Default for OakChestBoatMetadataBundle {
- 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()),
- },
- 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, Deref, DerefMut, PartialEq)]
-pub struct Trusting(pub bool);
+#[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<Uuid>);
+/// 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 Ocelot;
-impl Ocelot {
+pub struct AbstractTameable;
+impl AbstractTameable {
pub fn apply_metadata(
entity: &mut bevy_ecs::system::EntityCommands,
d: EntityDataItem,
@@ -6702,7 +10294,12 @@ impl Ocelot {
match d.index {
0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
17 => {
- entity.insert(Trusting(d.value.into_boolean()?));
+ 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()?));
}
_ => {}
}
@@ -6710,16 +10307,21 @@ impl Ocelot {
}
}
+/// The metadata bundle for [AbstractTameable].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct OcelotMetadataBundle {
- _marker: Ocelot,
+pub struct AbstractTameableMetadataBundle {
+ _marker: AbstractTameable,
parent: AbstractAnimalMetadataBundle,
- trusting: Trusting,
+ tame: Tame,
+ in_sitting_pose: InSittingPose,
+ owneruuid: Owneruuid,
}
-impl Default for OcelotMetadataBundle {
+impl Default for AbstractTameableMetadataBundle {
fn default() -> Self {
Self {
- _marker: Ocelot,
+ _marker: AbstractTameable,
parent: AbstractAnimalMetadataBundle {
_marker: AbstractAnimal,
parent: AbstractAgeableMetadataBundle {
@@ -6766,284 +10368,73 @@ impl Default for OcelotMetadataBundle {
abstract_ageable_baby: AbstractAgeableBaby(false),
},
},
- trusting: Trusting(false),
- }
- }
-}
-
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct OminousItemSpawnerItem(pub ItemStack);
-#[derive(Component)]
-pub struct OminousItemSpawner;
-impl OminousItemSpawner {
- 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()?));
- }
- _ => {}
- }
- Ok(())
- }
-}
-
-#[derive(Bundle)]
-pub struct OminousItemSpawnerMetadataBundle {
- _marker: OminousItemSpawner,
- parent: AbstractEntityMetadataBundle,
- ominous_item_spawner_item: OminousItemSpawnerItem,
-}
-impl Default for OminousItemSpawnerMetadataBundle {
- 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()),
- },
- 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);
-#[derive(Component)]
-pub struct Painting;
-impl Painting {
- 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()?));
- }
- 9 => {
- entity.insert(PaintingVariant(d.value.into_painting_variant()?));
- }
- _ => {}
- }
- Ok(())
- }
-}
-
-#[derive(Bundle)]
-pub struct PaintingMetadataBundle {
- _marker: Painting,
- parent: AbstractEntityMetadataBundle,
- painting_direction: PaintingDirection,
- painting_variant: PaintingVariant,
-}
-impl Default for PaintingMetadataBundle {
- 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()),
- },
- painting_direction: PaintingDirection(Default::default()),
- painting_variant: PaintingVariant(azalea_registry::data::PaintingVariant::new_raw(0)),
- }
- }
-}
-
-#[derive(Component)]
-pub struct PaleOakBoat;
-impl PaleOakBoat {
- 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 PaleOakBoatMetadataBundle {
- _marker: PaleOakBoat,
- parent: AbstractBoatMetadataBundle,
-}
-impl Default for PaleOakBoatMetadataBundle {
- 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()),
- },
- 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 PaleOakChestBoat;
-impl PaleOakChestBoat {
- 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 PaleOakChestBoatMetadataBundle {
- _marker: PaleOakChestBoat,
- parent: AbstractBoatMetadataBundle,
-}
-impl Default for PaleOakChestBoatMetadataBundle {
- 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()),
- },
- hurt: Hurt(0),
- hurtdir: Hurtdir(1),
- damage: Damage(0.0),
- },
- paddle_left: PaddleLeft(false),
- paddle_right: PaddleRight(false),
- bubble_time: BubbleTime(0),
- },
+ tame: Tame(false),
+ in_sitting_pose: InSittingPose(false),
+ owneruuid: Owneruuid(None),
}
}
}
-#[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);
+/// 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 Panda;
-impl Panda {
+pub struct Cat;
+impl Cat {
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(PandaUnhappyCounter(d.value.into_int()?));
- }
- 18 => {
- entity.insert(SneezeCounter(d.value.into_int()?));
- }
+ 0..=18 => AbstractTameable::apply_metadata(entity, d)?,
19 => {
- entity.insert(EatCounter(d.value.into_int()?));
+ entity.insert(CatVariant(d.value.into_cat_variant()?));
}
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));
+ entity.insert(IsLying(d.value.into_boolean()?));
}
21 => {
- entity.insert(HiddenGene(d.value.into_byte()?));
+ entity.insert(RelaxStateOne(d.value.into_boolean()?));
}
22 => {
- entity.insert(PandaFlags(d.value.into_byte()?));
+ entity.insert(CatCollarColor(d.value.into_int()?));
}
_ => {}
}
@@ -7051,153 +10442,227 @@ impl Panda {
}
}
+/// The metadata bundle for [Cat].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-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,
+pub struct CatMetadataBundle {
+ _marker: Cat,
+ parent: AbstractTameableMetadataBundle,
+ cat_variant: CatVariant,
+ is_lying: IsLying,
+ relax_state_one: RelaxStateOne,
+ cat_collar_color: CatCollarColor,
}
-impl Default for PandaMetadataBundle {
+impl Default for CatMetadataBundle {
fn default() -> Self {
Self {
- _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()),
+ _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),
},
- 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),
},
+ tame: Tame(false),
+ in_sitting_pose: InSittingPose(false),
+ owneruuid: Owneruuid(None),
},
- 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),
+ 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 Parched;
-impl Parched {
+pub struct Nautilus;
+impl Nautilus {
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(NautilusDash(d.value.into_boolean()?));
+ }
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [Nautilus].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct ParchedMetadataBundle {
- _marker: Parched,
- parent: AbstractMonsterMetadataBundle,
+pub struct NautilusMetadataBundle {
+ _marker: Nautilus,
+ parent: AbstractTameableMetadataBundle,
+ nautilus_dash: NautilusDash,
}
-impl Default for ParchedMetadataBundle {
+impl Default for NautilusMetadataBundle {
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: 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),
},
- 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,93 +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()?));
}
- _ => {}
- }
- Ok(())
- }
-}
-
-#[derive(Bundle)]
-pub struct PhantomMetadataBundle {
- _marker: Phantom,
- parent: AbstractInsentientMetadataBundle,
- phantom_size: PhantomSize,
-}
-impl Default for PhantomMetadataBundle {
- 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()),
- },
- 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),
- }
- }
-}
-
-#[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);
-#[derive(Component)]
-pub struct Pig;
-impl Pig {
- 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()?));
+ 20 => {
+ entity.insert(WolfCollarColor(d.value.into_int()?));
}
- 18 => {
- entity.insert(PigVariant(d.value.into_frog_variant()?));
+ 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()?));
}
_ => {}
}
@@ -7377,94 +10825,133 @@ impl Pig {
}
}
+/// The metadata bundle for [Wolf].
+///
+/// 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 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 PigMetadataBundle {
+impl Default for WolfMetadataBundle {
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()),
+ _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),
},
- 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),
},
+ tame: Tame(false),
+ in_sitting_pose: InSittingPose(false),
+ owneruuid: Owneruuid(None),
},
- pig_boost_time: PigBoostTime(0),
- pig_variant: PigVariant(azalea_registry::data::FrogVariant::new_raw(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 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 [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 Piglin;
-impl Piglin {
+pub struct ZombieNautilus;
+impl ZombieNautilus {
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()?));
- }
- 18 => {
- entity.insert(PiglinIsChargingCrossbow(d.value.into_boolean()?));
- }
+ 0..=18 => AbstractTameable::apply_metadata(entity, d)?,
19 => {
- entity.insert(IsDancing(d.value.into_boolean()?));
+ entity.insert(ZombieNautilusDash(d.value.into_boolean()?));
+ }
+ 20 => {
+ entity.insert(ZombieNautilusVariant(
+ d.value.into_zombie_nautilus_variant()?,
+ ));
}
_ => {}
}
@@ -7472,158 +10959,224 @@ impl Piglin {
}
}
+/// The metadata bundle for [ZombieNautilus].
+///
+/// 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 ZombieNautilusMetadataBundle {
+ _marker: ZombieNautilus,
+ parent: AbstractTameableMetadataBundle,
+ zombie_nautilus_dash: ZombieNautilusDash,
+ zombie_nautilus_variant: ZombieNautilusVariant,
}
-impl Default for PiglinMetadataBundle {
+impl Default for ZombieNautilusMetadataBundle {
fn default() -> Self {
Self {
- _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()),
+ _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),
},
- 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_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification(false),
+ tame: Tame(false),
+ in_sitting_pose: InSittingPose(false),
+ owneruuid: Owneruuid(None),
},
- piglin_baby: PiglinBaby(false),
- piglin_is_charging_crossbow: PiglinIsChargingCrossbow(false),
- is_dancing: IsDancing(false),
+ 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 PiglinBrute;
-impl PiglinBrute {
+pub struct AbstractVillager;
+impl AbstractVillager {
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..=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 PiglinBruteMetadataBundle {
- _marker: PiglinBrute,
- parent: AbstractPiglinMetadataBundle,
+pub struct AbstractVillagerMetadataBundle {
+ _marker: AbstractVillager,
+ parent: AbstractAgeableMetadataBundle,
+ abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter,
}
-impl Default for PiglinBruteMetadataBundle {
+impl Default for AbstractVillagerMetadataBundle {
fn default() -> Self {
Self {
- _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()),
- },
- 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_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification(false),
+ abstract_ageable_baby: AbstractAgeableBaby(false),
},
+ abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter(0),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct PillagerIsChargingCrossbow(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 Pillager;
-impl Pillager {
+pub struct Villager;
+impl Villager {
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..=17 => AbstractVillager::apply_metadata(entity, d)?,
+ 18 => {
+ entity.insert(VillagerVillagerData(d.value.into_villager_data()?));
}
_ => {}
}
@@ -7631,20 +11184,23 @@ impl Pillager {
}
}
+/// The metadata bundle for [Villager].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct PillagerMetadataBundle {
- _marker: Pillager,
- parent: AbstractRaiderMetadataBundle,
- pillager_is_charging_crossbow: PillagerIsChargingCrossbow,
+pub struct VillagerMetadataBundle {
+ _marker: Villager,
+ parent: AbstractVillagerMetadataBundle,
+ villager_villager_data: VillagerVillagerData,
}
-impl Default for PillagerMetadataBundle {
+impl Default for VillagerMetadataBundle {
fn default() -> Self {
Self {
- _marker: Pillager,
- parent: AbstractRaiderMetadataBundle {
- _marker: AbstractRaider,
- parent: AbstractMonsterMetadataBundle {
- _marker: AbstractMonster,
+ _marker: Villager,
+ parent: AbstractVillagerMetadataBundle {
+ _marker: AbstractVillager,
+ parent: AbstractAgeableMetadataBundle {
+ _marker: AbstractAgeable,
parent: AbstractCreatureMetadataBundle {
_marker: AbstractCreature,
parent: AbstractInsentientMetadataBundle {
@@ -7684,135 +11240,70 @@ impl Default for PillagerMetadataBundle {
aggressive: Aggressive(false),
},
},
+ abstract_ageable_baby: AbstractAgeableBaby(false),
},
- is_celebrating: IsCelebrating(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);
-#[derive(Component)]
-pub struct Player;
-impl Player {
- pub fn apply_metadata(
- entity: &mut bevy_ecs::system::EntityCommands,
- d: EntityDataItem,
- ) -> Result<(), UpdateMetadataError> {
- match d.index {
- 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()?));
- }
- _ => {}
- }
- Ok(())
- }
-}
-
-#[derive(Bundle)]
-pub struct PlayerMetadataBundle {
- _marker: Player,
- parent: AbstractAvatarMetadataBundle,
- player_absorption: PlayerAbsorption,
- score: Score,
- shoulder_parrot_left: ShoulderParrotLeft,
- shoulder_parrot_right: ShoulderParrotRight,
-}
-impl Default for PlayerMetadataBundle {
- 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()),
- },
- 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_villager_unhappy_counter: AbstractVillagerUnhappyCounter(0),
},
- player_absorption: PlayerAbsorption(0.0),
- score: Score(0),
- shoulder_parrot_left: ShoulderParrotLeft(OptionalUnsignedInt(None)),
- shoulder_parrot_right: ShoulderParrotRight(OptionalUnsignedInt(None)),
+ villager_villager_data: VillagerVillagerData(VillagerData {
+ kind: azalea_registry::builtin::VillagerKind::Plains,
+ profession: azalea_registry::builtin::VillagerProfession::None,
+ level: 0,
+ }),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct PolarBearStanding(pub bool);
+/// 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 PolarBear;
-impl PolarBear {
+pub struct WanderingTrader;
+impl WanderingTrader {
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(PolarBearStanding(d.value.into_boolean()?));
- }
+ 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 PolarBearMetadataBundle {
- _marker: PolarBear,
- parent: AbstractAnimalMetadataBundle,
- polar_bear_standing: PolarBearStanding,
+pub struct WanderingTraderMetadataBundle {
+ _marker: WanderingTrader,
+ parent: AbstractVillagerMetadataBundle,
}
-impl Default for PolarBearMetadataBundle {
+impl Default for WanderingTraderMetadataBundle {
fn default() -> Self {
Self {
- _marker: PolarBear,
- parent: AbstractAnimalMetadataBundle {
- _marker: AbstractAnimal,
+ _marker: WanderingTrader,
+ parent: AbstractVillagerMetadataBundle {
+ _marker: AbstractVillager,
parent: AbstractAgeableMetadataBundle {
_marker: AbstractAgeable,
parent: AbstractCreatureMetadataBundle {
@@ -7856,19 +11347,43 @@ impl Default for PolarBearMetadataBundle {
},
abstract_ageable_baby: AbstractAgeableBaby(false),
},
+ abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter(0),
},
- polar_bear_standing: PolarBearStanding(false),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct PufferfishFromBucket(pub bool);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct PuffState(pub i32);
+/// 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 Pufferfish;
-impl Pufferfish {
+pub struct AbstractFish;
+impl AbstractFish {
pub fn apply_metadata(
entity: &mut bevy_ecs::system::EntityCommands,
d: EntityDataItem,
@@ -7876,10 +11391,7 @@ impl Pufferfish {
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()?));
+ entity.insert(AbstractFishFromBucket(d.value.into_boolean()?));
}
_ => {}
}
@@ -7887,17 +11399,19 @@ impl Pufferfish {
}
}
+/// The metadata bundle for [AbstractFish].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct PufferfishMetadataBundle {
- _marker: Pufferfish,
+pub struct AbstractFishMetadataBundle {
+ _marker: AbstractFish,
parent: AbstractCreatureMetadataBundle,
- pufferfish_from_bucket: PufferfishFromBucket,
- puff_state: PuffState,
+ abstract_fish_from_bucket: AbstractFishFromBucket,
}
-impl Default for PufferfishMetadataBundle {
+impl Default for AbstractFishMetadataBundle {
fn default() -> Self {
Self {
- _marker: Pufferfish,
+ _marker: AbstractFish,
parent: AbstractCreatureMetadataBundle {
_marker: AbstractCreature,
parent: AbstractInsentientMetadataBundle {
@@ -7935,169 +11449,130 @@ 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)]
-pub struct Rabbit;
-impl Rabbit {
- 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()?));
- }
- _ => {}
- }
- Ok(())
- }
-}
-
-#[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()),
+ 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 Ravager;
-impl Ravager {
+pub struct Cod;
+impl Cod {
pub fn apply_metadata(
entity: &mut bevy_ecs::system::EntityCommands,
d: EntityDataItem,
) -> Result<(), UpdateMetadataError> {
match d.index {
- 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
+ 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 RavagerMetadataBundle {
- _marker: Ravager,
- parent: AbstractRaiderMetadataBundle,
+pub struct CodMetadataBundle {
+ _marker: Cod,
+ parent: AbstractFishMetadataBundle,
}
-impl Default for RavagerMetadataBundle {
+impl Default for CodMetadataBundle {
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: 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),
},
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
+/// 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 Salmon;
impl Salmon {
@@ -8116,6 +11591,9 @@ impl Salmon {
}
}
+/// The metadata bundle for [Salmon].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
pub struct SalmonMetadataBundle {
_marker: Salmon,
@@ -8172,20 +11650,44 @@ impl Default for SalmonMetadataBundle {
}
}
-#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)]
-pub struct SheepSheared(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 Sheep;
-impl Sheep {
+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 => {
- let bitfield = d.value.into_byte()?;
- entity.insert(SheepSheared(bitfield & 0x10 != 0));
+ entity.insert(TropicalFishTypeVariant(d.value.into_int()?));
}
_ => {}
}
@@ -8193,109 +11695,148 @@ impl Sheep {
}
}
+/// The metadata bundle for [TropicalFish].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct SheepMetadataBundle {
- _marker: Sheep,
- parent: AbstractAnimalMetadataBundle,
- sheep_sheared: SheepSheared,
+pub struct TropicalFishMetadataBundle {
+ _marker: TropicalFish,
+ parent: AbstractFishMetadataBundle,
+ tropical_fish_type_variant: TropicalFishTypeVariant,
}
-impl Default for SheepMetadataBundle {
+impl Default for TropicalFishMetadataBundle {
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: 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),
},
- sheep_sheared: SheepSheared(false),
+ tropical_fish_type_variant: TropicalFishTypeVariant(Default::default()),
}
}
}
-#[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);
+/// 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 Shulker;
-impl Shulker {
+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(AttachFace(d.value.into_direction()?));
- }
- 17 => {
- entity.insert(Peek(d.value.into_byte()?));
- }
- 18 => {
- entity.insert(Color(d.value.into_byte()?));
- }
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [AbstractMonster].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct ShulkerMetadataBundle {
- _marker: Shulker,
+pub struct AbstractMonsterMetadataBundle {
+ _marker: AbstractMonster,
parent: AbstractCreatureMetadataBundle,
- attach_face: AttachFace,
- peek: Peek,
- color: Color,
}
-impl Default for ShulkerMetadataBundle {
+impl Default for AbstractMonsterMetadataBundle {
fn default() -> Self {
Self {
- _marker: Shulker,
+ _marker: AbstractMonster,
parent: AbstractCreatureMetadataBundle {
_marker: AbstractCreature,
parent: AbstractInsentientMetadataBundle {
@@ -8333,82 +11874,68 @@ impl Default for ShulkerMetadataBundle {
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,
-}
-impl Default for ShulkerBulletMetadataBundle {
- 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()),
- },
}
}
}
+#[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 Silverfish;
-impl Silverfish {
+pub struct Blaze;
+impl Blaze {
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));
+ }
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [Blaze].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct SilverfishMetadataBundle {
- _marker: Silverfish,
+pub struct BlazeMetadataBundle {
+ _marker: Blaze,
parent: AbstractMonsterMetadataBundle,
+ charged: Charged,
}
-impl Default for SilverfishMetadataBundle {
+impl Default for BlazeMetadataBundle {
fn default() -> Self {
Self {
- _marker: Silverfish,
+ _marker: Blaze,
parent: AbstractMonsterMetadataBundle {
_marker: AbstractMonster,
parent: AbstractCreatureMetadataBundle {
@@ -8449,15 +11976,40 @@ impl Default for SilverfishMetadataBundle {
},
},
},
+ charged: Charged(false),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct StrayConversion(pub bool);
+/// 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 Skeleton;
-impl Skeleton {
+pub struct Bogged;
+impl Bogged {
pub fn apply_metadata(
entity: &mut bevy_ecs::system::EntityCommands,
d: EntityDataItem,
@@ -8465,7 +12017,7 @@ impl Skeleton {
match d.index {
0..=15 => AbstractMonster::apply_metadata(entity, d)?,
16 => {
- entity.insert(StrayConversion(d.value.into_boolean()?));
+ entity.insert(BoggedSheared(d.value.into_boolean()?));
}
_ => {}
}
@@ -8473,16 +12025,19 @@ impl Skeleton {
}
}
+/// The metadata bundle for [Bogged].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct SkeletonMetadataBundle {
- _marker: Skeleton,
+pub struct BoggedMetadataBundle {
+ _marker: Bogged,
parent: AbstractMonsterMetadataBundle,
- stray_conversion: StrayConversion,
+ bogged_sheared: BoggedSheared,
}
-impl Default for SkeletonMetadataBundle {
+impl Default for BoggedMetadataBundle {
fn default() -> Self {
Self {
- _marker: Skeleton,
+ _marker: Bogged,
parent: AbstractMonsterMetadataBundle {
_marker: AbstractMonster,
parent: AbstractCreatureMetadataBundle {
@@ -8523,103 +12078,162 @@ impl Default for SkeletonMetadataBundle {
},
},
},
- stray_conversion: StrayConversion(false),
+ bogged_sheared: BoggedSheared(false),
}
}
}
+/// 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 SkeletonHorse;
-impl SkeletonHorse {
+pub struct Breeze;
+impl Breeze {
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 [Breeze].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct SkeletonHorseMetadataBundle {
- _marker: SkeletonHorse,
- parent: AbstractHorseMetadataBundle,
+pub struct BreezeMetadataBundle {
+ _marker: Breeze,
+ parent: AbstractMonsterMetadataBundle,
}
-impl Default for SkeletonHorseMetadataBundle {
+impl Default for BreezeMetadataBundle {
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: 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),
},
- 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),
},
}
}
}
+/// 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<BlockPos>);
+/// 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 Slime;
-impl Slime {
+pub struct Creaking;
+impl Creaking {
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 => AbstractMonster::apply_metadata(entity, d)?,
16 => {
- entity.insert(SlimeSize(d.value.into_int()?));
+ 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()?));
}
_ => {}
}
@@ -8627,125 +12241,121 @@ impl Slime {
}
}
+/// The metadata bundle for [Creaking].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct SlimeMetadataBundle {
- _marker: Slime,
- parent: AbstractInsentientMetadataBundle,
- slime_size: SlimeSize,
+pub struct CreakingMetadataBundle {
+ _marker: Creaking,
+ parent: AbstractMonsterMetadataBundle,
+ can_move: CanMove,
+ is_active: IsActive,
+ is_tearing_down: IsTearingDown,
+ home_pos: HomePos,
}
-impl Default for SlimeMetadataBundle {
+impl Default for CreakingMetadataBundle {
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()),
+ _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),
},
- 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),
+ 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 SmallFireballItemStack(pub ItemStack);
+/// 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 SmallFireball;
-impl SmallFireball {
+pub struct Creeper;
+impl Creeper {
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(SwellDir(d.value.into_int()?));
}
- _ => {}
- }
- Ok(())
- }
-}
-
-#[derive(Bundle)]
-pub struct SmallFireballMetadataBundle {
- _marker: SmallFireball,
- parent: AbstractEntityMetadataBundle,
- small_fireball_item_stack: SmallFireballItemStack,
-}
-impl Default for SmallFireballMetadataBundle {
- 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()),
- },
- small_fireball_item_stack: SmallFireballItemStack(Default::default()),
- }
- }
-}
-
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct SnifferState(pub SnifferStateKind);
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct DropSeedAtTick(pub i32);
-#[derive(Component)]
-pub struct Sniffer;
-impl Sniffer {
- 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()?));
+ entity.insert(IsPowered(d.value.into_boolean()?));
}
18 => {
- entity.insert(DropSeedAtTick(d.value.into_int()?));
+ entity.insert(IsIgnited(d.value.into_boolean()?));
}
_ => {}
}
@@ -8753,83 +12363,120 @@ impl Sniffer {
}
}
+/// The metadata bundle for [Creeper].
+///
+/// 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 CreeperMetadataBundle {
+ _marker: Creeper,
+ parent: AbstractMonsterMetadataBundle,
+ swell_dir: SwellDir,
+ is_powered: IsPowered,
+ is_ignited: IsIgnited,
}
-impl Default for SnifferMetadataBundle {
+impl Default for CreeperMetadataBundle {
fn default() -> Self {
Self {
- _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),
+ _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()),
},
- 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),
},
},
- sniffer_state: SnifferState(Default::default()),
- drop_seed_at_tick: DropSeedAtTick(0),
+ swell_dir: SwellDir(-1),
+ is_powered: IsPowered(false),
+ is_ignited: IsIgnited(false),
}
}
}
-#[derive(Clone, Component, Copy, Deref, DerefMut, PartialEq)]
-pub struct HasPumpkin(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 SnowGolem;
-impl SnowGolem {
+pub struct Enderman;
+impl Enderman {
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(CarryState(d.value.into_optional_block_state()?));
+ }
+ 17 => {
+ entity.insert(Creepy(d.value.into_boolean()?));
+ }
+ 18 => {
+ entity.insert(StaredAt(d.value.into_boolean()?));
}
_ => {}
}
@@ -8837,220 +12484,286 @@ impl SnowGolem {
}
}
+/// The metadata bundle for [Enderman].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct SnowGolemMetadataBundle {
- _marker: SnowGolem,
- parent: AbstractCreatureMetadataBundle,
- has_pumpkin: HasPumpkin,
+pub struct EndermanMetadataBundle {
+ _marker: Enderman,
+ parent: AbstractMonsterMetadataBundle,
+ carry_state: CarryState,
+ creepy: Creepy,
+ stared_at: StaredAt,
}
-impl Default for SnowGolemMetadataBundle {
+impl Default for EndermanMetadataBundle {
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: 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),
},
- 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),
- }
- }
-}
-
-#[derive(Component)]
-pub struct Snowball;
-impl Snowball {
- 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(())
- }
-}
-
-#[derive(Bundle)]
-pub struct SnowballMetadataBundle {
- _marker: Snowball,
- parent: AbstractThrownItemProjectileMetadataBundle,
-}
-impl Default for SnowballMetadataBundle {
- 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()),
- },
- abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack(
- Default::default(),
- ),
- },
+ 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 SpawnerMinecart;
-impl SpawnerMinecart {
+pub struct Endermite;
+impl Endermite {
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..=15 => AbstractMonster::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [Endermite].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct SpawnerMinecartMetadataBundle {
- _marker: SpawnerMinecart,
- parent: AbstractMinecartMetadataBundle,
+pub struct EndermiteMetadataBundle {
+ _marker: Endermite,
+ parent: AbstractMonsterMetadataBundle,
}
-impl Default for SpawnerMinecartMetadataBundle {
+impl Default for EndermiteMetadataBundle {
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: 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),
},
- hurt: Hurt(0),
- hurtdir: Hurtdir(1),
- damage: Damage(0.0),
},
- custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR),
- display_offset: DisplayOffset(Default::default()),
},
}
}
}
+/// 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 SpectralArrow;
-impl SpectralArrow {
+pub struct Giant;
+impl Giant {
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 [Giant].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct SpectralArrowMetadataBundle {
- _marker: SpectralArrow,
- parent: AbstractArrowMetadataBundle,
+pub struct GiantMetadataBundle {
+ _marker: Giant,
+ parent: AbstractMonsterMetadataBundle,
}
-impl Default for SpectralArrowMetadataBundle {
+impl Default for GiantMetadataBundle {
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: 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),
+ },
},
- crit_arrow: CritArrow(false),
- no_physics: NoPhysics(false),
- pierce_level: PierceLevel(0),
- in_ground: InGround(false),
},
}
}
}
+/// 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 Spider;
-impl Spider {
+pub struct Guardian;
+impl Guardian {
pub fn apply_metadata(
entity: &mut bevy_ecs::system::EntityCommands,
d: EntityDataItem,
@@ -9058,8 +12771,10 @@ 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(Moving(d.value.into_boolean()?));
+ }
+ 17 => {
+ entity.insert(AttackTarget(d.value.into_int()?));
}
_ => {}
}
@@ -9067,16 +12782,20 @@ impl Spider {
}
}
+/// The metadata bundle for [Guardian].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct SpiderMetadataBundle {
- _marker: Spider,
+pub struct GuardianMetadataBundle {
+ _marker: Guardian,
parent: AbstractMonsterMetadataBundle,
- climbing: Climbing,
+ moving: Moving,
+ attack_target: AttackTarget,
}
-impl Default for SpiderMetadataBundle {
+impl Default for GuardianMetadataBundle {
fn default() -> Self {
Self {
- _marker: Spider,
+ _marker: Guardian,
parent: AbstractMonsterMetadataBundle {
_marker: AbstractMonster,
parent: AbstractCreatureMetadataBundle {
@@ -9117,202 +12836,356 @@ impl Default for SpiderMetadataBundle {
},
},
},
- climbing: Climbing(false),
+ moving: Moving(false),
+ attack_target: AttackTarget(0),
}
}
}
+/// 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 SplashPotion;
-impl SplashPotion {
+pub struct ElderGuardian;
+impl ElderGuardian {
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..=17 => Guardian::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [ElderGuardian].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct SplashPotionMetadataBundle {
- _marker: SplashPotion,
- parent: AbstractThrownItemProjectileMetadataBundle,
+pub struct ElderGuardianMetadataBundle {
+ _marker: ElderGuardian,
+ parent: GuardianMetadataBundle,
}
-impl Default for SplashPotionMetadataBundle {
+impl Default for ElderGuardianMetadataBundle {
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: 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),
+ },
+ },
},
- abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack(
- Default::default(),
- ),
+ 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 SpruceBoat;
-impl SpruceBoat {
+pub struct Parched;
+impl Parched {
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 [Parched].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct SpruceBoatMetadataBundle {
- _marker: SpruceBoat,
- parent: AbstractBoatMetadataBundle,
+pub struct ParchedMetadataBundle {
+ _marker: Parched,
+ parent: AbstractMonsterMetadataBundle,
}
-impl Default for SpruceBoatMetadataBundle {
+impl Default for ParchedMetadataBundle {
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()),
+ _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),
},
- 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: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 SpruceChestBoat;
-impl SpruceChestBoat {
+pub struct Silverfish;
+impl Silverfish {
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 [Silverfish].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct SpruceChestBoatMetadataBundle {
- _marker: SpruceChestBoat,
- parent: AbstractBoatMetadataBundle,
+pub struct SilverfishMetadataBundle {
+ _marker: Silverfish,
+ parent: AbstractMonsterMetadataBundle,
}
-impl Default for SpruceChestBoatMetadataBundle {
+impl Default for SilverfishMetadataBundle {
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: 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),
},
- 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 [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 Squid;
-impl Squid {
+pub struct Skeleton;
+impl Skeleton {
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(StrayConversion(d.value.into_boolean()?));
+ }
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [Skeleton].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct SquidMetadataBundle {
- _marker: Squid,
- parent: AbstractAgeableMetadataBundle,
+pub struct SkeletonMetadataBundle {
+ _marker: Skeleton,
+ parent: AbstractMonsterMetadataBundle,
+ stray_conversion: StrayConversion,
}
-impl Default for SquidMetadataBundle {
+impl Default for SkeletonMetadataBundle {
fn default() -> Self {
Self {
- _marker: Squid,
- parent: AbstractAgeableMetadataBundle {
- _marker: AbstractAgeable,
+ _marker: Skeleton,
+ parent: AbstractMonsterMetadataBundle {
+ _marker: AbstractMonster,
parent: AbstractCreatureMetadataBundle {
_marker: AbstractCreature,
parent: AbstractInsentientMetadataBundle {
@@ -9350,36 +13223,70 @@ impl Default for SquidMetadataBundle {
aggressive: Aggressive(false),
},
},
- abstract_ageable_baby: AbstractAgeableBaby(false),
},
+ 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 Stray;
-impl Stray {
+pub struct Spider;
+impl Spider {
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(Climbing(bitfield & 0x1 != 0));
+ }
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [Spider].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct StrayMetadataBundle {
- _marker: Stray,
+pub struct SpiderMetadataBundle {
+ _marker: Spider,
parent: AbstractMonsterMetadataBundle,
+ climbing: Climbing,
}
-impl Default for StrayMetadataBundle {
+impl Default for SpiderMetadataBundle {
fn default() -> Self {
Self {
- _marker: Stray,
+ _marker: Spider,
parent: AbstractMonsterMetadataBundle {
_marker: AbstractMonster,
parent: AbstractCreatureMetadataBundle {
@@ -9420,50 +13327,64 @@ impl Default for StrayMetadataBundle {
},
},
},
+ climbing: Climbing(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: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 Strider;
-impl Strider {
+pub struct CaveSpider;
+impl CaveSpider {
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..=16 => Spider::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [CaveSpider].
+///
+/// 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 CaveSpiderMetadataBundle {
+ _marker: CaveSpider,
+ parent: SpiderMetadataBundle,
}
-impl Default for StriderMetadataBundle {
+impl Default for CaveSpiderMetadataBundle {
fn default() -> Self {
Self {
- _marker: Strider,
- parent: AbstractAnimalMetadataBundle {
- _marker: AbstractAnimal,
- parent: AbstractAgeableMetadataBundle {
- _marker: AbstractAgeable,
+ _marker: CaveSpider,
+ parent: SpiderMetadataBundle {
+ _marker: Spider,
+ parent: AbstractMonsterMetadataBundle {
+ _marker: AbstractMonster,
parent: AbstractCreatureMetadataBundle {
_marker: AbstractCreature,
parent: AbstractInsentientMetadataBundle {
@@ -9503,120 +13424,142 @@ impl Default for StriderMetadataBundle {
aggressive: Aggressive(false),
},
},
- abstract_ageable_baby: AbstractAgeableBaby(false),
},
+ climbing: Climbing(false),
},
- strider_boost_time: StriderBoostTime(0),
- suffocating: Suffocating(false),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct TadpoleFromBucket(pub bool);
+/// 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 Tadpole;
-impl Tadpole {
+pub struct Stray;
+impl Stray {
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..=15 => AbstractMonster::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [Stray].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct TadpoleMetadataBundle {
- _marker: Tadpole,
- parent: AbstractCreatureMetadataBundle,
- tadpole_from_bucket: TadpoleFromBucket,
+pub struct StrayMetadataBundle {
+ _marker: Stray,
+ parent: AbstractMonsterMetadataBundle,
}
-impl Default for TadpoleMetadataBundle {
+impl Default for StrayMetadataBundle {
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: 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),
},
- 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),
},
},
- tadpole_from_bucket: TadpoleFromBucket(false),
}
}
}
-#[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);
+/// 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 TextDisplay;
-impl TextDisplay {
+pub struct Vex;
+impl Vex {
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..=15 => AbstractMonster::apply_metadata(entity, d)?,
+ 16 => {
+ entity.insert(VexFlags(d.value.into_byte()?));
}
_ => {}
}
@@ -9624,101 +13567,101 @@ impl TextDisplay {
}
}
+/// The metadata bundle for [Vex].
+///
+/// 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 VexMetadataBundle {
+ _marker: Vex,
+ parent: AbstractMonsterMetadataBundle,
+ vex_flags: VexFlags,
}
-impl Default for TextDisplayMetadataBundle {
+impl Default for VexMetadataBundle {
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: 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()),
+ },
+ 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),
},
- text: Text(Default::default()),
- line_width: LineWidth(200),
- background_color: BackgroundColor(1073741824),
- text_opacity: TextOpacity(127),
- style_flags: StyleFlags(0),
+ vex_flags: VexFlags(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 [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 Tnt;
-impl Tnt {
+pub struct Warden;
+impl Warden {
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(ClientAngerLevel(d.value.into_int()?));
}
_ => {}
}
@@ -9726,207 +13669,322 @@ impl Tnt {
}
}
+/// The metadata bundle for [Warden].
+///
+/// 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 WardenMetadataBundle {
+ _marker: Warden,
+ parent: AbstractMonsterMetadataBundle,
+ client_anger_level: ClientAngerLevel,
}
-impl Default for TntMetadataBundle {
+impl Default for WardenMetadataBundle {
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: 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),
+ },
+ },
},
- fuse: Fuse(80),
- tnt_block_state: TntBlockState(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 TntMinecart;
-impl TntMinecart {
+pub struct Wither;
+impl Wither {
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..=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(())
}
}
+/// The metadata bundle for [Wither].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct TntMinecartMetadataBundle {
- _marker: TntMinecart,
- parent: AbstractMinecartMetadataBundle,
+pub struct WitherMetadataBundle {
+ _marker: Wither,
+ parent: AbstractMonsterMetadataBundle,
+ target_a: TargetA,
+ target_b: TargetB,
+ target_c: TargetC,
+ inv: Inv,
}
-impl Default for TntMinecartMetadataBundle {
+impl Default for WitherMetadataBundle {
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: 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),
},
- custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR),
- display_offset: DisplayOffset(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: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 TraderLlama;
-impl TraderLlama {
+pub struct WitherSkeleton;
+impl WitherSkeleton {
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..=15 => AbstractMonster::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [WitherSkeleton].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct TraderLlamaMetadataBundle {
- _marker: TraderLlama,
- parent: LlamaMetadataBundle,
+pub struct WitherSkeletonMetadataBundle {
+ _marker: WitherSkeleton,
+ parent: AbstractMonsterMetadataBundle,
}
-impl Default for TraderLlamaMetadataBundle {
+impl Default for WitherSkeletonMetadataBundle {
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),
- },
- },
- abstract_ageable_baby: AbstractAgeableBaby(false),
+ _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),
},
- tamed: Tamed(false),
- eating: Eating(false),
- abstract_horse_standing: AbstractHorseStanding(false),
- bred: Bred(false),
+ no_ai: NoAi(false),
+ left_handed: LeftHanded(false),
+ aggressive: Aggressive(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);
+/// 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 Trident;
-impl Trident {
+pub struct Zoglin;
+impl Zoglin {
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()?));
+ 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
+ 16 => {
+ entity.insert(ZoglinBaby(d.value.into_boolean()?));
}
_ => {}
}
@@ -9934,60 +13992,118 @@ impl Trident {
}
}
+/// The metadata bundle for [Zoglin].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct TridentMetadataBundle {
- _marker: Trident,
- parent: AbstractArrowMetadataBundle,
- loyalty: Loyalty,
- foil: Foil,
+pub struct ZoglinMetadataBundle {
+ _marker: Zoglin,
+ parent: AbstractMonsterMetadataBundle,
+ zoglin_baby: ZoglinBaby,
}
-impl Default for TridentMetadataBundle {
+impl Default for ZoglinMetadataBundle {
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()),
+ _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),
+ },
},
- crit_arrow: CritArrow(false),
- no_physics: NoPhysics(false),
- pierce_level: PierceLevel(0),
- in_ground: InGround(false),
},
- loyalty: Loyalty(0),
- foil: Foil(false),
+ zoglin_baby: ZoglinBaby(false),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct TropicalFishTypeVariant(pub i32);
+/// 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 TropicalFish;
-impl TropicalFish {
+pub struct Zombie;
+impl Zombie {
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..=15 => AbstractMonster::apply_metadata(entity, d)?,
+ 16 => {
+ entity.insert(ZombieBaby(d.value.into_boolean()?));
+ }
17 => {
- entity.insert(TropicalFishTypeVariant(d.value.into_int()?));
+ entity.insert(SpecialType(d.value.into_int()?));
+ }
+ 18 => {
+ entity.insert(DrownedConversion(d.value.into_boolean()?));
}
_ => {}
}
@@ -9995,18 +14111,23 @@ impl TropicalFish {
}
}
+/// The metadata bundle for [Zombie].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct TropicalFishMetadataBundle {
- _marker: TropicalFish,
- parent: AbstractFishMetadataBundle,
- tropical_fish_type_variant: TropicalFishTypeVariant,
+pub struct ZombieMetadataBundle {
+ _marker: Zombie,
+ parent: AbstractMonsterMetadataBundle,
+ zombie_baby: ZombieBaby,
+ special_type: SpecialType,
+ drowned_conversion: DrownedConversion,
}
-impl Default for TropicalFishMetadataBundle {
+impl Default for ZombieMetadataBundle {
fn default() -> Self {
Self {
- _marker: TropicalFish,
- parent: AbstractFishMetadataBundle {
- _marker: AbstractFish,
+ _marker: Zombie,
+ parent: AbstractMonsterMetadataBundle {
+ _marker: AbstractMonster,
parent: AbstractCreatureMetadataBundle {
_marker: AbstractCreature,
parent: AbstractInsentientMetadataBundle {
@@ -10044,53 +14165,67 @@ impl Default for TropicalFishMetadataBundle {
aggressive: Aggressive(false),
},
},
- abstract_fish_from_bucket: AbstractFishFromBucket(false),
},
- tropical_fish_type_variant: TropicalFishTypeVariant(Default::default()),
+ zombie_baby: ZombieBaby(false),
+ special_type: SpecialType(0),
+ drowned_conversion: DrownedConversion(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: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 Turtle;
-impl Turtle {
+pub struct Drowned;
+impl Drowned {
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..=18 => Zombie::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [Drowned].
+///
+/// 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 DrownedMetadataBundle {
+ _marker: Drowned,
+ parent: ZombieMetadataBundle,
}
-impl Default for TurtleMetadataBundle {
+impl Default for DrownedMetadataBundle {
fn default() -> Self {
Self {
- _marker: Turtle,
- parent: AbstractAnimalMetadataBundle {
- _marker: AbstractAnimal,
- parent: AbstractAgeableMetadataBundle {
- _marker: AbstractAgeable,
+ _marker: Drowned,
+ parent: ZombieMetadataBundle {
+ _marker: Zombie,
+ parent: AbstractMonsterMetadataBundle {
+ _marker: AbstractMonster,
parent: AbstractCreatureMetadataBundle {
_marker: AbstractCreature,
parent: AbstractInsentientMetadataBundle {
@@ -10130,126 +14265,68 @@ impl Default for TurtleMetadataBundle {
aggressive: Aggressive(false),
},
},
- abstract_ageable_baby: AbstractAgeableBaby(false),
- },
- },
- has_egg: HasEgg(false),
- laying_egg: LayingEgg(false),
- }
- }
-}
-
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct VexFlags(pub u8);
-#[derive(Component)]
-pub struct Vex;
-impl Vex {
- 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()?));
- }
- _ => {}
- }
- Ok(())
- }
-}
-
-#[derive(Bundle)]
-pub struct VexMetadataBundle {
- _marker: Vex,
- parent: AbstractMonsterMetadataBundle,
- vex_flags: VexFlags,
-}
-impl Default for VexMetadataBundle {
- 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()),
- },
- 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),
},
- 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);
+/// 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 Villager;
-impl Villager {
+pub struct Husk;
+impl Husk {
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..=18 => Zombie::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [Husk].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct VillagerMetadataBundle {
- _marker: Villager,
- parent: AbstractVillagerMetadataBundle,
- villager_villager_data: VillagerVillagerData,
+pub struct HuskMetadataBundle {
+ _marker: Husk,
+ parent: ZombieMetadataBundle,
}
-impl Default for VillagerMetadataBundle {
+impl Default for HuskMetadataBundle {
fn default() -> Self {
Self {
- _marker: Villager,
- parent: AbstractVillagerMetadataBundle {
- _marker: AbstractVillager,
- parent: AbstractAgeableMetadataBundle {
- _marker: AbstractAgeable,
+ _marker: Husk,
+ parent: ZombieMetadataBundle {
+ _marker: Zombie,
+ parent: AbstractMonsterMetadataBundle {
+ _marker: AbstractMonster,
parent: AbstractCreatureMetadataBundle {
_marker: AbstractCreature,
parent: AbstractInsentientMetadataBundle {
@@ -10289,45 +14366,84 @@ impl Default for VillagerMetadataBundle {
aggressive: Aggressive(false),
},
},
- abstract_ageable_baby: AbstractAgeableBaby(false),
},
- abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter(0),
+ zombie_baby: ZombieBaby(false),
+ special_type: SpecialType(0),
+ drowned_conversion: DrownedConversion(false),
},
- villager_villager_data: VillagerVillagerData(VillagerData {
- kind: azalea_registry::builtin::VillagerKind::Plains,
- profession: azalea_registry::builtin::VillagerProfession::None,
- level: 0,
- }),
}
}
}
+/// 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 Vindicator;
-impl Vindicator {
+pub struct ZombieVillager;
+impl ZombieVillager {
pub fn apply_metadata(
entity: &mut bevy_ecs::system::EntityCommands,
d: EntityDataItem,
) -> Result<(), UpdateMetadataError> {
match d.index {
- 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
+ 0..=18 => Zombie::apply_metadata(entity, d)?,
+ 19 => {
+ entity.insert(Converting(d.value.into_boolean()?));
+ }
+ 20 => {
+ entity.insert(ZombieVillagerVillagerData(d.value.into_villager_data()?));
+ }
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [ZombieVillager].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct VindicatorMetadataBundle {
- _marker: Vindicator,
- parent: AbstractRaiderMetadataBundle,
+pub struct ZombieVillagerMetadataBundle {
+ _marker: ZombieVillager,
+ parent: ZombieMetadataBundle,
+ converting: Converting,
+ zombie_villager_villager_data: ZombieVillagerVillagerData,
}
-impl Default for VindicatorMetadataBundle {
+impl Default for ZombieVillagerMetadataBundle {
fn default() -> Self {
Self {
- _marker: Vindicator,
- parent: AbstractRaiderMetadataBundle {
- _marker: AbstractRaider,
+ _marker: ZombieVillager,
+ parent: ZombieMetadataBundle {
+ _marker: Zombie,
parent: AbstractMonsterMetadataBundle {
_marker: AbstractMonster,
parent: AbstractCreatureMetadataBundle {
@@ -10370,40 +14486,73 @@ impl Default for VindicatorMetadataBundle {
},
},
},
- is_celebrating: IsCelebrating(false),
+ zombie_baby: ZombieBaby(false),
+ special_type: SpecialType(0),
+ drowned_conversion: DrownedConversion(false),
},
+ 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: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 WanderingTrader;
-impl WanderingTrader {
+pub struct ZombifiedPiglin;
+impl ZombifiedPiglin {
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..=18 => Zombie::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [ZombifiedPiglin].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct WanderingTraderMetadataBundle {
- _marker: WanderingTrader,
- parent: AbstractVillagerMetadataBundle,
+pub struct ZombifiedPiglinMetadataBundle {
+ _marker: ZombifiedPiglin,
+ parent: ZombieMetadataBundle,
}
-impl Default for WanderingTraderMetadataBundle {
+impl Default for ZombifiedPiglinMetadataBundle {
fn default() -> Self {
Self {
- _marker: WanderingTrader,
- parent: AbstractVillagerMetadataBundle {
- _marker: AbstractVillager,
- parent: AbstractAgeableMetadataBundle {
- _marker: AbstractAgeable,
+ _marker: ZombifiedPiglin,
+ parent: ZombieMetadataBundle {
+ _marker: Zombie,
+ parent: AbstractMonsterMetadataBundle {
+ _marker: AbstractMonster,
parent: AbstractCreatureMetadataBundle {
_marker: AbstractCreature,
parent: AbstractInsentientMetadataBundle {
@@ -10443,19 +14592,46 @@ impl Default for WanderingTraderMetadataBundle {
aggressive: Aggressive(false),
},
},
- abstract_ageable_baby: AbstractAgeableBaby(false),
},
- abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter(0),
+ zombie_baby: ZombieBaby(false),
+ special_type: SpecialType(0),
+ drowned_conversion: DrownedConversion(false),
},
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct ClientAngerLevel(pub i32);
+/// 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 Warden;
-impl Warden {
+pub struct AbstractPiglin;
+impl AbstractPiglin {
pub fn apply_metadata(
entity: &mut bevy_ecs::system::EntityCommands,
d: EntityDataItem,
@@ -10463,7 +14639,7 @@ impl Warden {
match d.index {
0..=15 => AbstractMonster::apply_metadata(entity, d)?,
16 => {
- entity.insert(ClientAngerLevel(d.value.into_int()?));
+ entity.insert(AbstractPiglinImmuneToZombification(d.value.into_boolean()?));
}
_ => {}
}
@@ -10471,16 +14647,19 @@ impl Warden {
}
}
+/// The metadata bundle for [AbstractPiglin].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct WardenMetadataBundle {
- _marker: Warden,
+pub struct AbstractPiglinMetadataBundle {
+ _marker: AbstractPiglin,
parent: AbstractMonsterMetadataBundle,
- client_anger_level: ClientAngerLevel,
+ abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification,
}
-impl Default for WardenMetadataBundle {
+impl Default for AbstractPiglinMetadataBundle {
fn default() -> Self {
Self {
- _marker: Warden,
+ _marker: AbstractPiglin,
parent: AbstractMonsterMetadataBundle {
_marker: AbstractMonster,
parent: AbstractCreatureMetadataBundle {
@@ -10521,88 +14700,189 @@ impl Default for WardenMetadataBundle {
},
},
},
- client_anger_level: ClientAngerLevel(0),
+ 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 WindCharge;
-impl WindCharge {
+pub struct Piglin;
+impl Piglin {
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 => 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 WindChargeMetadataBundle {
- _marker: WindCharge,
- parent: AbstractEntityMetadataBundle,
+pub struct PiglinMetadataBundle {
+ _marker: Piglin,
+ parent: AbstractPiglinMetadataBundle,
+ piglin_baby: PiglinBaby,
+ piglin_is_charging_crossbow: PiglinIsChargingCrossbow,
+ is_dancing: IsDancing,
}
-impl Default for WindChargeMetadataBundle {
+impl Default for PiglinMetadataBundle {
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: 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),
+ },
+ },
+ },
+ abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification(false),
},
+ piglin_baby: PiglinBaby(false),
+ piglin_is_charging_crossbow: PiglinIsChargingCrossbow(false),
+ is_dancing: IsDancing(false),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct WitchUsingItem(pub bool);
+/// 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 Witch;
-impl Witch {
+pub struct PiglinBrute;
+impl PiglinBrute {
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..=16 => AbstractPiglin::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [PiglinBrute].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct WitchMetadataBundle {
- _marker: Witch,
- parent: AbstractRaiderMetadataBundle,
- witch_using_item: WitchUsingItem,
+pub struct PiglinBruteMetadataBundle {
+ _marker: PiglinBrute,
+ parent: AbstractPiglinMetadataBundle,
}
-impl Default for WitchMetadataBundle {
+impl Default for PiglinBruteMetadataBundle {
fn default() -> Self {
Self {
- _marker: Witch,
- parent: AbstractRaiderMetadataBundle {
- _marker: AbstractRaider,
+ _marker: PiglinBrute,
+ parent: AbstractPiglinMetadataBundle {
+ _marker: AbstractPiglin,
parent: AbstractMonsterMetadataBundle {
_marker: AbstractMonster,
parent: AbstractCreatureMetadataBundle {
@@ -10645,24 +14925,48 @@ impl Default for WitchMetadataBundle {
},
},
},
- is_celebrating: IsCelebrating(false),
+ abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification(false),
},
- 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);
+/// 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 Wither;
-impl Wither {
+pub struct AbstractRaider;
+impl AbstractRaider {
pub fn apply_metadata(
entity: &mut bevy_ecs::system::EntityCommands,
d: EntityDataItem,
@@ -10670,16 +14974,7 @@ impl Wither {
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()?));
+ entity.insert(IsCelebrating(d.value.into_boolean()?));
}
_ => {}
}
@@ -10687,19 +14982,19 @@ impl Wither {
}
}
+/// The metadata bundle for [AbstractRaider].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct WitherMetadataBundle {
- _marker: Wither,
+pub struct AbstractRaiderMetadataBundle {
+ _marker: AbstractRaider,
parent: AbstractMonsterMetadataBundle,
- target_a: TargetA,
- target_b: TargetB,
- target_c: TargetC,
- inv: Inv,
+ is_celebrating: IsCelebrating,
}
-impl Default for WitherMetadataBundle {
+impl Default for AbstractRaiderMetadataBundle {
fn default() -> Self {
Self {
- _marker: Wither,
+ _marker: AbstractRaider,
parent: AbstractMonsterMetadataBundle {
_marker: AbstractMonster,
parent: AbstractCreatureMetadataBundle {
@@ -10740,262 +15035,357 @@ impl Default for WitherMetadataBundle {
},
},
},
- target_a: TargetA(0),
- target_b: TargetB(0),
- target_c: TargetC(0),
- inv: Inv(0),
+ 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 WitherSkeleton;
-impl WitherSkeleton {
+pub struct Pillager;
+impl Pillager {
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 => 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 WitherSkeletonMetadataBundle {
- _marker: WitherSkeleton,
- parent: AbstractMonsterMetadataBundle,
+pub struct PillagerMetadataBundle {
+ _marker: Pillager,
+ parent: AbstractRaiderMetadataBundle,
+ pillager_is_charging_crossbow: PillagerIsChargingCrossbow,
}
-impl Default for WitherSkeletonMetadataBundle {
+impl Default for PillagerMetadataBundle {
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()),
+ _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),
},
- 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),
},
+ pillager_is_charging_crossbow: PillagerIsChargingCrossbow(false),
}
}
}
-#[derive(Clone, Component, Deref, DerefMut, PartialEq)]
-pub struct Dangerous(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 WitherSkull;
-impl WitherSkull {
+pub struct Ravager;
+impl Ravager {
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(Dangerous(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 WitherSkullMetadataBundle {
- _marker: WitherSkull,
- parent: AbstractEntityMetadataBundle,
- dangerous: Dangerous,
+pub struct RavagerMetadataBundle {
+ _marker: Ravager,
+ parent: AbstractRaiderMetadataBundle,
}
-impl Default for WitherSkullMetadataBundle {
+impl Default for RavagerMetadataBundle {
fn default() -> Self {
Self {
- _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()),
+ _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),
+ },
+ no_ai: NoAi(false),
+ left_handed: LeftHanded(false),
+ aggressive: Aggressive(false),
+ },
+ },
+ },
+ is_celebrating: IsCelebrating(false),
},
- dangerous: Dangerous(false),
}
}
}
-#[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);
+/// 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 Wolf;
-impl Wolf {
+pub struct Vindicator;
+impl Vindicator {
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()?));
- }
- 22 => {
- entity.insert(WolfVariant(d.value.into_cow_variant()?));
- }
- 23 => {
- entity.insert(SoundVariant(d.value.into_wolf_variant()?));
- }
+ 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 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 VindicatorMetadataBundle {
+ _marker: Vindicator,
+ parent: AbstractRaiderMetadataBundle,
}
-impl Default for WolfMetadataBundle {
+impl Default for VindicatorMetadataBundle {
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),
+ _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()),
},
- 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),
+ is_celebrating: IsCelebrating(false),
},
- 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 ZoglinBaby(pub bool);
+/// 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 Zoglin;
-impl Zoglin {
+pub struct Witch;
+impl Witch {
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..=16 => AbstractRaider::apply_metadata(entity, d)?,
+ 17 => {
+ entity.insert(WitchUsingItem(d.value.into_boolean()?));
}
_ => {}
}
@@ -11003,78 +15393,110 @@ impl Zoglin {
}
}
+/// The metadata bundle for [Witch].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct ZoglinMetadataBundle {
- _marker: Zoglin,
- parent: AbstractMonsterMetadataBundle,
- zoglin_baby: ZoglinBaby,
+pub struct WitchMetadataBundle {
+ _marker: Witch,
+ parent: AbstractRaiderMetadataBundle,
+ witch_using_item: WitchUsingItem,
}
-impl Default for ZoglinMetadataBundle {
+impl Default for WitchMetadataBundle {
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()),
+ _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),
},
- 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),
},
- zoglin_baby: ZoglinBaby(false),
+ 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 Zombie;
-impl Zombie {
+pub struct AbstractSpellcasterIllager;
+impl AbstractSpellcasterIllager {
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()?));
- }
+ 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
17 => {
- entity.insert(SpecialType(d.value.into_int()?));
- }
- 18 => {
- entity.insert(DrownedConversion(d.value.into_boolean()?));
+ entity.insert(SpellCasting(d.value.into_byte()?));
}
_ => {}
}
@@ -11082,95 +15504,126 @@ impl Zombie {
}
}
+/// The metadata bundle for [AbstractSpellcasterIllager].
+///
+/// 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 AbstractSpellcasterIllagerMetadataBundle {
+ _marker: AbstractSpellcasterIllager,
+ parent: AbstractRaiderMetadataBundle,
+ spell_casting: SpellCasting,
}
-impl Default for ZombieMetadataBundle {
+impl Default for AbstractSpellcasterIllagerMetadataBundle {
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()),
+ _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),
},
},
+ is_celebrating: IsCelebrating(false),
},
- zombie_baby: ZombieBaby(false),
- special_type: SpecialType(0),
- drowned_conversion: DrownedConversion(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 ZombieHorse;
-impl ZombieHorse {
+pub struct Evoker;
+impl Evoker {
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..=17 => AbstractSpellcasterIllager::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [Evoker].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct ZombieHorseMetadataBundle {
- _marker: ZombieHorse,
- parent: AbstractHorseMetadataBundle,
+pub struct EvokerMetadataBundle {
+ _marker: Evoker,
+ parent: AbstractSpellcasterIllagerMetadataBundle,
}
-impl Default for ZombieHorseMetadataBundle {
+impl Default for EvokerMetadataBundle {
fn default() -> Self {
Self {
- _marker: ZombieHorse,
- parent: AbstractHorseMetadataBundle {
- _marker: AbstractHorse,
- parent: AbstractAnimalMetadataBundle {
- _marker: AbstractAnimal,
- parent: AbstractAgeableMetadataBundle {
- _marker: AbstractAgeable,
+ _marker: Evoker,
+ parent: AbstractSpellcasterIllagerMetadataBundle {
+ _marker: AbstractSpellcasterIllager,
+ parent: AbstractRaiderMetadataBundle {
+ _marker: AbstractRaider,
+ parent: AbstractMonsterMetadataBundle {
+ _marker: AbstractMonster,
parent: AbstractCreatureMetadataBundle {
_marker: AbstractCreature,
parent: AbstractInsentientMetadataBundle {
@@ -11210,62 +15663,71 @@ impl Default for ZombieHorseMetadataBundle {
aggressive: Aggressive(false),
},
},
- abstract_ageable_baby: AbstractAgeableBaby(false),
},
+ is_celebrating: IsCelebrating(false),
},
- tamed: Tamed(false),
- eating: Eating(false),
- abstract_horse_standing: AbstractHorseStanding(false),
- bred: Bred(false),
+ spell_casting: SpellCasting(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: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 ZombieNautilus;
-impl ZombieNautilus {
+pub struct Illusioner;
+impl Illusioner {
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..=17 => AbstractSpellcasterIllager::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [Illusioner].
+///
+/// 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 IllusionerMetadataBundle {
+ _marker: Illusioner,
+ parent: AbstractSpellcasterIllagerMetadataBundle,
}
-impl Default for ZombieNautilusMetadataBundle {
+impl Default for IllusionerMetadataBundle {
fn default() -> Self {
Self {
- _marker: ZombieNautilus,
- parent: AbstractTameableMetadataBundle {
- _marker: AbstractTameable,
- parent: AbstractAnimalMetadataBundle {
- _marker: AbstractAnimal,
- parent: AbstractAgeableMetadataBundle {
- _marker: AbstractAgeable,
+ _marker: Illusioner,
+ parent: AbstractSpellcasterIllagerMetadataBundle {
+ _marker: AbstractSpellcasterIllager,
+ parent: AbstractRaiderMetadataBundle {
+ _marker: AbstractRaider,
+ parent: AbstractMonsterMetadataBundle {
+ _marker: AbstractMonster,
parent: AbstractCreatureMetadataBundle {
_marker: AbstractCreature,
parent: AbstractInsentientMetadataBundle {
@@ -11305,39 +15767,56 @@ impl Default for ZombieNautilusMetadataBundle {
aggressive: Aggressive(false),
},
},
- abstract_ageable_baby: AbstractAgeableBaby(false),
},
+ is_celebrating: IsCelebrating(false),
},
- tame: Tame(false),
- in_sitting_pose: InSittingPose(false),
- owneruuid: Owneruuid(None),
+ spell_casting: SpellCasting(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);
+/// 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 ZombieVillager;
-impl ZombieVillager {
+pub struct AbstractThrownItemProjectile;
+impl AbstractThrownItemProjectile {
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..=7 => AbstractEntity::apply_metadata(entity, d)?,
+ 8 => {
+ entity.insert(AbstractThrownItemProjectileItemStack(
+ d.value.into_item_stack()?,
+ ));
}
_ => {}
}
@@ -11345,388 +15824,450 @@ impl ZombieVillager {
}
}
+/// The metadata bundle for [AbstractThrownItemProjectile].
+///
+/// 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 AbstractThrownItemProjectileMetadataBundle {
+ _marker: AbstractThrownItemProjectile,
+ parent: AbstractEntityMetadataBundle,
+ abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack,
}
-impl Default for ZombieVillagerMetadataBundle {
+impl Default for AbstractThrownItemProjectileMetadataBundle {
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: 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()),
},
- zombie_baby: ZombieBaby(false),
- special_type: SpecialType(0),
- drowned_conversion: DrownedConversion(false),
+ abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack(
+ Default::default(),
+ ),
},
- 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: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 ZombifiedPiglin;
-impl ZombifiedPiglin {
+pub struct EnderPearl;
+impl EnderPearl {
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..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [EnderPearl].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct ZombifiedPiglinMetadataBundle {
- _marker: ZombifiedPiglin,
- parent: ZombieMetadataBundle,
+pub struct EnderPearlMetadataBundle {
+ _marker: EnderPearl,
+ parent: AbstractThrownItemProjectileMetadataBundle,
}
-impl Default for ZombifiedPiglinMetadataBundle {
+impl Default for EnderPearlMetadataBundle {
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: 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()),
},
- zombie_baby: ZombieBaby(false),
- special_type: SpecialType(0),
- drowned_conversion: DrownedConversion(false),
+ abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack(
+ Default::default(),
+ ),
},
}
}
}
+/// 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 AbstractAgeable;
-impl AbstractAgeable {
+pub struct ExperienceBottle;
+impl ExperienceBottle {
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()?));
- }
+ 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 AbstractAgeableMetadataBundle {
- _marker: AbstractAgeable,
- parent: AbstractCreatureMetadataBundle,
- abstract_ageable_baby: AbstractAgeableBaby,
+pub struct ExperienceBottleMetadataBundle {
+ _marker: ExperienceBottle,
+ parent: AbstractThrownItemProjectileMetadataBundle,
}
-impl Default for AbstractAgeableMetadataBundle {
+impl Default for ExperienceBottleMetadataBundle {
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),
- },
- no_ai: NoAi(false),
- left_handed: LeftHanded(false),
- aggressive: Aggressive(false),
+ _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(),
+ ),
},
- abstract_ageable_baby: AbstractAgeableBaby(false),
}
}
}
+/// 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 AbstractAnimal;
-impl AbstractAnimal {
+pub struct LingeringPotion;
+impl LingeringPotion {
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..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [LingeringPotion].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct AbstractAnimalMetadataBundle {
- _marker: AbstractAnimal,
- parent: AbstractAgeableMetadataBundle,
+pub struct LingeringPotionMetadataBundle {
+ _marker: LingeringPotion,
+ parent: AbstractThrownItemProjectileMetadataBundle,
}
-impl Default for AbstractAnimalMetadataBundle {
+impl Default for LingeringPotionMetadataBundle {
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: 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()),
},
- abstract_ageable_baby: AbstractAgeableBaby(false),
+ abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack(
+ Default::default(),
+ ),
},
}
}
}
+/// 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 AbstractArrow;
-impl AbstractArrow {
+pub struct Snowball;
+impl Snowball {
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..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [Snowball].
+///
+/// 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 SnowballMetadataBundle {
+ _marker: Snowball,
+ parent: AbstractThrownItemProjectileMetadataBundle,
}
-impl Default for AbstractArrowMetadataBundle {
+impl Default for SnowballMetadataBundle {
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: 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(),
+ ),
},
- crit_arrow: CritArrow(false),
- no_physics: NoPhysics(false),
- pierce_level: PierceLevel(0),
- in_ground: InGround(false),
}
}
}
+/// 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 AbstractAvatar;
-impl AbstractAvatar {
+pub struct SplashPotion;
+impl SplashPotion {
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..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [SplashPotion].
+///
+/// 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 SplashPotionMetadataBundle {
+ _marker: SplashPotion,
+ parent: AbstractThrownItemProjectileMetadataBundle,
}
-impl Default for AbstractAvatarMetadataBundle {
+impl Default for SplashPotionMetadataBundle {
fn default() -> Self {
Self {
- _marker: AbstractAvatar,
- parent: AbstractLivingMetadataBundle {
- _marker: AbstractLiving,
+ _marker: SplashPotion,
+ parent: AbstractThrownItemProjectileMetadataBundle {
+ _marker: AbstractThrownItemProjectile,
parent: AbstractEntityMetadataBundle {
_marker: AbstractEntity,
on_fire: OnFire(false),
@@ -11744,21 +16285,187 @@ impl Default for AbstractAvatarMetadataBundle {
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(),
+ ),
},
- player_main_hand: PlayerMainHand(Default::default()),
- player_mode_customisation: PlayerModeCustomisation(0),
}
}
}
+/// 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 AbstractVehicle;
+impl AbstractVehicle {
+ 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()?));
+ }
+ _ => {}
+ }
+ Ok(())
+ }
+}
+
+/// The metadata bundle for [AbstractVehicle].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct AbstractVehicleMetadataBundle {
+ _marker: AbstractVehicle,
+ parent: AbstractEntityMetadataBundle,
+ hurt: Hurt,
+ hurtdir: Hurtdir,
+ damage: Damage,
+}
+impl Default for AbstractVehicleMetadataBundle {
+ 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()),
+ },
+ hurt: Hurt(0),
+ hurtdir: Hurtdir(1),
+ damage: Damage(0.0),
+ }
+ }
+}
+
+/// 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 AbstractBoat;
impl AbstractBoat {
@@ -11783,6 +16490,9 @@ impl AbstractBoat {
}
}
+/// The metadata bundle for [AbstractBoat].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
pub struct AbstractBoatMetadataBundle {
_marker: AbstractBoat,
@@ -11825,120 +16535,135 @@ impl Default for AbstractBoatMetadataBundle {
}
}
+/// 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 AbstractChestedHorse;
-impl AbstractChestedHorse {
+pub struct AcaciaBoat;
+impl AcaciaBoat {
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 [AcaciaBoat].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct AbstractChestedHorseMetadataBundle {
- _marker: AbstractChestedHorse,
- parent: AbstractHorseMetadataBundle,
- chest: Chest,
+pub struct AcaciaBoatMetadataBundle {
+ _marker: AcaciaBoat,
+ parent: AbstractBoatMetadataBundle,
}
-impl Default for AbstractChestedHorseMetadataBundle {
+impl Default for AcaciaBoatMetadataBundle {
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: 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),
},
- 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: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 AbstractCreature;
-impl AbstractCreature {
+pub struct AcaciaChestBoat;
+impl AcaciaChestBoat {
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 [AcaciaChestBoat].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct AbstractCreatureMetadataBundle {
- _marker: AbstractCreature,
- parent: AbstractInsentientMetadataBundle,
+pub struct AcaciaChestBoatMetadataBundle {
+ _marker: AcaciaChestBoat,
+ parent: AbstractBoatMetadataBundle,
}
-impl Default for AbstractCreatureMetadataBundle {
+impl Default for AcaciaChestBoatMetadataBundle {
fn default() -> Self {
Self {
- _marker: AbstractCreature,
- parent: AbstractInsentientMetadataBundle {
- _marker: AbstractInsentient,
- parent: AbstractLivingMetadataBundle {
- _marker: AbstractLiving,
+ _marker: AcaciaChestBoat,
+ parent: AbstractBoatMetadataBundle {
+ _marker: AbstractBoat,
+ parent: AbstractVehicleMetadataBundle {
+ _marker: AbstractVehicle,
parent: AbstractEntityMetadataBundle {
_marker: AbstractEntity,
on_fire: OnFire(false),
@@ -11956,560 +16681,1474 @@ 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),
},
}
}
}
+/// 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 AbstractDisplay;
-impl AbstractDisplay {
+pub struct BambooChestRaft;
+impl BambooChestRaft {
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 [BambooChestRaft].
+///
+/// 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 BambooChestRaftMetadataBundle {
+ _marker: BambooChestRaft,
+ parent: AbstractBoatMetadataBundle,
}
-impl Default for AbstractDisplayMetadataBundle {
+impl Default for BambooChestRaftMetadataBundle {
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: 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),
},
- 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: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 AbstractEntity;
-impl AbstractEntity {
+pub struct BambooRaft;
+impl BambooRaft {
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 [BambooRaft].
+///
+/// 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 BambooRaftMetadataBundle {
+ _marker: BambooRaft,
+ parent: AbstractBoatMetadataBundle,
}
-impl Default for AbstractEntityMetadataBundle {
+impl Default for BambooRaftMetadataBundle {
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: 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),
+ },
}
}
}
+/// 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 AbstractFish;
-impl AbstractFish {
+pub struct BirchBoat;
+impl BirchBoat {
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 [BirchBoat].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct AbstractFishMetadataBundle {
- _marker: AbstractFish,
- parent: AbstractCreatureMetadataBundle,
- abstract_fish_from_bucket: AbstractFishFromBucket,
+pub struct BirchBoatMetadataBundle {
+ _marker: BirchBoat,
+ parent: AbstractBoatMetadataBundle,
}
-impl Default for AbstractFishMetadataBundle {
+impl Default for BirchBoatMetadataBundle {
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: 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()),
},
- 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: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 AbstractHorse;
-impl AbstractHorse {
+pub struct BirchChestBoat;
+impl BirchChestBoat {
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 [BirchChestBoat].
+///
+/// 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 BirchChestBoatMetadataBundle {
+ _marker: BirchChestBoat,
+ parent: AbstractBoatMetadataBundle,
}
-impl Default for AbstractHorseMetadataBundle {
+impl Default for BirchChestBoatMetadataBundle {
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: 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()),
},
- 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: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 AbstractInsentient;
-impl AbstractInsentient {
+pub struct CherryBoat;
+impl CherryBoat {
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 [CherryBoat].
+///
+/// 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 CherryBoatMetadataBundle {
+ _marker: CherryBoat,
+ parent: AbstractBoatMetadataBundle,
}
-impl Default for AbstractInsentientMetadataBundle {
+impl Default for CherryBoatMetadataBundle {
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()),
+ _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),
},
- 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),
},
- no_ai: NoAi(false),
- left_handed: LeftHanded(false),
- aggressive: Aggressive(false),
}
}
}
+/// 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 AbstractLiving;
-impl AbstractLiving {
+pub struct CherryChestBoat;
+impl CherryChestBoat {
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 [CherryChestBoat].
+///
+/// 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 CherryChestBoatMetadataBundle {
+ _marker: CherryChestBoat,
+ parent: AbstractBoatMetadataBundle,
}
-impl Default for AbstractLivingMetadataBundle {
+impl Default for CherryChestBoatMetadataBundle {
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: 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),
+ },
+ }
+ }
+}
+
+/// 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 DarkOakBoat;
+impl DarkOakBoat {
+ 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 [DarkOakBoat].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct DarkOakBoatMetadataBundle {
+ _marker: DarkOakBoat,
+ parent: AbstractBoatMetadataBundle,
+}
+impl Default for DarkOakBoatMetadataBundle {
+ 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),
},
- 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: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 DarkOakChestBoat;
+impl DarkOakChestBoat {
+ 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 [DarkOakChestBoat].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct DarkOakChestBoatMetadataBundle {
+ _marker: DarkOakChestBoat,
+ parent: AbstractBoatMetadataBundle,
+}
+impl Default for DarkOakChestBoatMetadataBundle {
+ 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),
+ },
+ paddle_left: PaddleLeft(false),
+ paddle_right: PaddleRight(false),
+ bubble_time: BubbleTime(0),
+ },
+ }
+ }
+}
+
+/// 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 JungleBoat;
+impl JungleBoat {
+ 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 [JungleBoat].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct JungleBoatMetadataBundle {
+ _marker: JungleBoat,
+ parent: AbstractBoatMetadataBundle,
+}
+impl Default for JungleBoatMetadataBundle {
+ 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()),
+ },
+ 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: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 JungleChestBoat;
+impl JungleChestBoat {
+ 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 [JungleChestBoat].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct JungleChestBoatMetadataBundle {
+ _marker: JungleChestBoat,
+ parent: AbstractBoatMetadataBundle,
+}
+impl Default for JungleChestBoatMetadataBundle {
+ 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()),
+ },
+ 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: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 MangroveBoat;
+impl MangroveBoat {
+ 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 [MangroveBoat].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct MangroveBoatMetadataBundle {
+ _marker: MangroveBoat,
+ parent: AbstractBoatMetadataBundle,
+}
+impl Default for MangroveBoatMetadataBundle {
+ 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()),
+ },
+ 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: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 MangroveChestBoat;
+impl MangroveChestBoat {
+ 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 [MangroveChestBoat].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct MangroveChestBoatMetadataBundle {
+ _marker: MangroveChestBoat,
+ parent: AbstractBoatMetadataBundle,
+}
+impl Default for MangroveChestBoatMetadataBundle {
+ 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()),
+ },
+ 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: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..=13 => AbstractBoat::apply_metadata(entity, d)?,
+ _ => {}
+ }
+ Ok(())
+ }
+}
+
+/// The metadata bundle for [OakBoat].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct OakBoatMetadataBundle {
+ _marker: OakBoat,
+ parent: AbstractBoatMetadataBundle,
+}
+impl Default for OakBoatMetadataBundle {
+ 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()),
+ },
+ 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: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 OakChestBoat;
+impl OakChestBoat {
+ 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 [OakChestBoat].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct OakChestBoatMetadataBundle {
+ _marker: OakChestBoat,
+ parent: AbstractBoatMetadataBundle,
+}
+impl Default for OakChestBoatMetadataBundle {
+ 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()),
+ },
+ 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 PaleOakBoat;
+impl PaleOakBoat {
+ 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 [PaleOakBoat].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct PaleOakBoatMetadataBundle {
+ _marker: PaleOakBoat,
+ parent: AbstractBoatMetadataBundle,
+}
+impl Default for PaleOakBoatMetadataBundle {
+ 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()),
+ },
+ 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_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 PaleOakChestBoat;
+impl PaleOakChestBoat {
+ 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 [PaleOakChestBoat].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct PaleOakChestBoatMetadataBundle {
+ _marker: PaleOakChestBoat,
+ parent: AbstractBoatMetadataBundle,
+}
+impl Default for PaleOakChestBoatMetadataBundle {
+ 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()),
+ },
+ 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: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 SpruceBoat;
+impl SpruceBoat {
+ 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 [SpruceBoat].
+///
+/// This type should generally not be used directly.
+#[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()),
+ },
+ 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: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 SpruceChestBoat;
+impl SpruceChestBoat {
+ 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 [SpruceChestBoat].
+///
+/// This type should generally not be used directly.
+#[derive(Bundle)]
+pub struct SpruceChestBoatMetadataBundle {
+ _marker: SpruceChestBoat,
+ parent: AbstractBoatMetadataBundle,
+}
+impl Default for SpruceChestBoatMetadataBundle {
+ 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()),
+ },
+ 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 [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,82 +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 struct ChestMinecart;
+impl ChestMinecart {
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..=12 => AbstractMinecart::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [ChestMinecart].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct AbstractMonsterMetadataBundle {
- _marker: AbstractMonster,
- parent: AbstractCreatureMetadataBundle,
+pub struct ChestMinecartMetadataBundle {
+ _marker: ChestMinecart,
+ parent: AbstractMinecartMetadataBundle,
}
-impl Default for AbstractMonsterMetadataBundle {
+impl Default for ChestMinecartMetadataBundle {
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),
+ _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()),
},
- 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()),
},
}
}
}
+/// 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 AbstractPiglin;
-impl AbstractPiglin {
+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(AbstractPiglinImmuneToZombification(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()?));
}
_ => {}
}
@@ -12654,72 +18342,90 @@ impl AbstractPiglin {
}
}
+/// The metadata bundle for [CommandBlockMinecart].
+///
+/// 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 CommandBlockMinecartMetadataBundle {
+ _marker: CommandBlockMinecart,
+ parent: AbstractMinecartMetadataBundle,
+ command_name: CommandName,
+ last_output: LastOutput,
}
-impl Default for AbstractPiglinMetadataBundle {
+impl Default for CommandBlockMinecartMetadataBundle {
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: 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()),
},
- abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification(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 AbstractRaider;
-impl AbstractRaider {
+pub struct FurnaceMinecart;
+impl FurnaceMinecart {
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(Fuel(d.value.into_boolean()?));
}
_ => {}
}
@@ -12727,412 +18433,360 @@ impl AbstractRaider {
}
}
+/// The metadata bundle for [FurnaceMinecart].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct AbstractRaiderMetadataBundle {
- _marker: AbstractRaider,
- parent: AbstractMonsterMetadataBundle,
- is_celebrating: IsCelebrating,
+pub struct FurnaceMinecartMetadataBundle {
+ _marker: FurnaceMinecart,
+ parent: AbstractMinecartMetadataBundle,
+ fuel: Fuel,
}
-impl Default for AbstractRaiderMetadataBundle {
+impl Default for FurnaceMinecartMetadataBundle {
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: 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),
},
+ custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR),
+ display_offset: DisplayOffset(Default::default()),
},
- is_celebrating: IsCelebrating(false),
+ 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 AbstractSpellcasterIllager;
-impl AbstractSpellcasterIllager {
+pub struct HopperMinecart;
+impl HopperMinecart {
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)?,
_ => {}
}
Ok(())
}
}
+/// The metadata bundle for [HopperMinecart].
+///
+/// This type should generally not be used directly.
#[derive(Bundle)]
-pub struct AbstractSpellcasterIllagerMetadataBundle {
- _marker: AbstractSpellcasterIllager,
- parent: AbstractRaiderMetadataBundle,
- spell_casting: SpellCasting,
+pub struct HopperMinecartMetadataBundle {
+ _marker: HopperMinecart,
+ parent: AbstractMinecartMetadataBundle,
}
-impl Default for AbstractSpellcasterIllagerMetadataBundle {
+impl Default for HopperMinecartMetadataBundle {
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: 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),
},
- is_celebrating: IsCelebrating(false),
+ custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR),
+ display_offset: DisplayOffset(Default::default()),
},
- spell_casting: SpellCasting(0),
}
}
}
+/// 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 AbstractTameable;
-impl AbstractTameable {
+pub struct Minecart;
+impl Minecart {
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 [Minecart].
+///
+/// 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 MinecartMetadataBundle {
+ _marker: Minecart,
+ parent: AbstractMinecartMetadataBundle,
}
-impl Default for AbstractTameableMetadataBundle {
+impl Default for MinecartMetadataBundle {
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: 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()),
},
- 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),
- }
- }
-}
-
-#[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(())
- }
-}
-
-#[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: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<AbstractMonster>`.
+//!
+//! 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<EntityDataValue> 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<EntityDataValue> 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<EntityDataValue> 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<EntityDataValue> 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<EntityDataValue> 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<EntityDataValue> 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<EntityDataValue> 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<EntityDataValue> 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<EntityDataValue> 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),