1#![allow(clippy::single_match)]
197
198use azalea_chat::FormattedText;
199use azalea_core::{
200 direction::Direction,
201 position::{BlockPos, Vec3f32},
202};
203use azalea_inventory::{ItemStack, components};
204use azalea_registry::{DataRegistry, builtin::EntityKind};
205use bevy_ecs::{bundle::Bundle, component::Component};
206use derive_more::{Deref, DerefMut};
207use thiserror::Error;
208use uuid::Uuid;
209
210use super::{
211 ArmadilloStateKind, CopperGolemStateKind, EntityDataItem, EntityDataValue, OptionalUnsignedInt,
212 Pose, Quaternion, Rotations, SnifferStateKind, VillagerData, WeatheringCopperStateKind,
213};
214use crate::{HumanoidArm, particle::Particle};
215
216#[derive(Error, Debug)]
217pub enum UpdateMetadataError {
218 #[error("Wrong type ({0:?})")]
219 WrongType(EntityDataValue),
220}
221impl From<EntityDataValue> for UpdateMetadataError {
222 fn from(value: EntityDataValue) -> Self {
223 Self::WrongType(value)
224 }
225}
226
227#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
228pub struct OnFire(pub bool);
230#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
231pub struct AbstractEntityShiftKeyDown(pub bool);
233#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
234pub struct Sprinting(pub bool);
236#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
237pub struct Swimming(pub bool);
239#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
240pub struct CurrentlyGlowing(pub bool);
242#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
243pub struct Invisible(pub bool);
245#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
246pub struct FallFlying(pub bool);
248#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
250pub struct AirSupply(pub i32);
251#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
253pub struct CustomName(pub Option<Box<FormattedText>>);
254#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
256pub struct CustomNameVisible(pub bool);
257#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
259pub struct Silent(pub bool);
260#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
262pub struct NoGravity(pub bool);
263#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
265pub struct TicksFrozen(pub i32);
266#[derive(Component)]
472pub struct AbstractEntity;
473impl AbstractEntity {
474 fn apply_metadata(
475 entity: &mut bevy_ecs::system::EntityCommands,
476 d: EntityDataItem,
477 ) -> Result<(), UpdateMetadataError> {
478 match d.index {
479 0 => {
480 let bitfield = d.value.into_byte()?;
481 entity.insert(OnFire(bitfield & 0x1 != 0));
482 entity.insert(AbstractEntityShiftKeyDown(bitfield & 0x2 != 0));
483 entity.insert(Sprinting(bitfield & 0x8 != 0));
484 entity.insert(Swimming(bitfield & 0x10 != 0));
485 entity.insert(CurrentlyGlowing(bitfield & 0x40 != 0));
486 entity.insert(Invisible(bitfield & 0x20 != 0));
487 entity.insert(FallFlying(bitfield & 0x80 != 0));
488 }
489 1 => {
490 entity.insert(AirSupply(d.value.into_int()?));
491 }
492 2 => {
493 entity.insert(CustomName(d.value.into_optional_formatted_text()?));
494 }
495 3 => {
496 entity.insert(CustomNameVisible(d.value.into_boolean()?));
497 }
498 4 => {
499 entity.insert(Silent(d.value.into_boolean()?));
500 }
501 5 => {
502 entity.insert(NoGravity(d.value.into_boolean()?));
503 }
504 6 => {
505 entity.insert(d.value.into_pose()?);
506 }
507 7 => {
508 entity.insert(TicksFrozen(d.value.into_int()?));
509 }
510 _ => {}
511 }
512 Ok(())
513 }
514}
515
516#[derive(Bundle)]
520pub struct AbstractEntityMetadataBundle {
521 _marker: AbstractEntity,
522 on_fire: OnFire,
523 abstract_entity_shift_key_down: AbstractEntityShiftKeyDown,
524 sprinting: Sprinting,
525 swimming: Swimming,
526 currently_glowing: CurrentlyGlowing,
527 invisible: Invisible,
528 fall_flying: FallFlying,
529 air_supply: AirSupply,
530 custom_name: CustomName,
531 custom_name_visible: CustomNameVisible,
532 silent: Silent,
533 no_gravity: NoGravity,
534 pose: Pose,
535 ticks_frozen: TicksFrozen,
536}
537impl Default for AbstractEntityMetadataBundle {
538 fn default() -> Self {
539 Self {
540 _marker: AbstractEntity,
541 on_fire: OnFire(false),
542 abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false),
543 sprinting: Sprinting(false),
544 swimming: Swimming(false),
545 currently_glowing: CurrentlyGlowing(false),
546 invisible: Invisible(false),
547 fall_flying: FallFlying(false),
548 air_supply: AirSupply(Default::default()),
549 custom_name: CustomName(Default::default()),
550 custom_name_visible: CustomNameVisible(Default::default()),
551 silent: Silent(Default::default()),
552 no_gravity: NoGravity(Default::default()),
553 pose: Pose::default(),
554 ticks_frozen: TicksFrozen(Default::default()),
555 }
556 }
557}
558
559#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
561pub struct Radius(pub f32);
562#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
564pub struct Waiting(pub bool);
565#[derive(Component)]
587pub struct AreaEffectCloud;
588impl AreaEffectCloud {
589 fn apply_metadata(
590 entity: &mut bevy_ecs::system::EntityCommands,
591 d: EntityDataItem,
592 ) -> Result<(), UpdateMetadataError> {
593 match d.index {
594 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
595 8 => {
596 entity.insert(Radius(d.value.into_float()?));
597 }
598 9 => {
599 entity.insert(Waiting(d.value.into_boolean()?));
600 }
601 10 => {
602 entity.insert(d.value.into_particle()?);
603 }
604 _ => {}
605 }
606 Ok(())
607 }
608}
609
610#[derive(Bundle)]
614pub struct AreaEffectCloudMetadataBundle {
615 _marker: AreaEffectCloud,
616 parent: AbstractEntityMetadataBundle,
617 radius: Radius,
618 waiting: Waiting,
619 particle: Particle,
620}
621impl Default for AreaEffectCloudMetadataBundle {
622 fn default() -> Self {
623 Self {
624 _marker: AreaEffectCloud,
625 parent: Default::default(),
626 radius: Radius(3.0),
627 waiting: Waiting(false),
628 particle: Particle::default(),
629 }
630 }
631}
632
633#[derive(Component)]
651pub struct BreezeWindCharge;
652impl BreezeWindCharge {
653 fn apply_metadata(
654 entity: &mut bevy_ecs::system::EntityCommands,
655 d: EntityDataItem,
656 ) -> Result<(), UpdateMetadataError> {
657 match d.index {
658 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
659 _ => {}
660 }
661 Ok(())
662 }
663}
664
665#[derive(Bundle)]
669pub struct BreezeWindChargeMetadataBundle {
670 _marker: BreezeWindCharge,
671 parent: AbstractEntityMetadataBundle,
672}
673impl Default for BreezeWindChargeMetadataBundle {
674 fn default() -> Self {
675 Self {
676 _marker: BreezeWindCharge,
677 parent: Default::default(),
678 }
679 }
680}
681
682#[derive(Component)]
700pub struct DragonFireball;
701impl DragonFireball {
702 fn apply_metadata(
703 entity: &mut bevy_ecs::system::EntityCommands,
704 d: EntityDataItem,
705 ) -> Result<(), UpdateMetadataError> {
706 match d.index {
707 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
708 _ => {}
709 }
710 Ok(())
711 }
712}
713
714#[derive(Bundle)]
718pub struct DragonFireballMetadataBundle {
719 _marker: DragonFireball,
720 parent: AbstractEntityMetadataBundle,
721}
722impl Default for DragonFireballMetadataBundle {
723 fn default() -> Self {
724 Self {
725 _marker: DragonFireball,
726 parent: Default::default(),
727 }
728 }
729}
730
731#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
733pub struct BeamTarget(pub Option<BlockPos>);
734#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
736pub struct ShowBottom(pub bool);
737#[derive(Component)]
759pub struct EndCrystal;
760impl EndCrystal {
761 fn apply_metadata(
762 entity: &mut bevy_ecs::system::EntityCommands,
763 d: EntityDataItem,
764 ) -> Result<(), UpdateMetadataError> {
765 match d.index {
766 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
767 8 => {
768 entity.insert(BeamTarget(d.value.into_optional_block_pos()?));
769 }
770 9 => {
771 entity.insert(ShowBottom(d.value.into_boolean()?));
772 }
773 _ => {}
774 }
775 Ok(())
776 }
777}
778
779#[derive(Bundle)]
783pub struct EndCrystalMetadataBundle {
784 _marker: EndCrystal,
785 parent: AbstractEntityMetadataBundle,
786 beam_target: BeamTarget,
787 show_bottom: ShowBottom,
788}
789impl Default for EndCrystalMetadataBundle {
790 fn default() -> Self {
791 Self {
792 _marker: EndCrystal,
793 parent: Default::default(),
794 beam_target: BeamTarget(None),
795 show_bottom: ShowBottom(true),
796 }
797 }
798}
799
800#[derive(Component)]
818pub struct EvokerFangs;
819impl EvokerFangs {
820 fn apply_metadata(
821 entity: &mut bevy_ecs::system::EntityCommands,
822 d: EntityDataItem,
823 ) -> Result<(), UpdateMetadataError> {
824 match d.index {
825 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
826 _ => {}
827 }
828 Ok(())
829 }
830}
831
832#[derive(Bundle)]
836pub struct EvokerFangsMetadataBundle {
837 _marker: EvokerFangs,
838 parent: AbstractEntityMetadataBundle,
839}
840impl Default for EvokerFangsMetadataBundle {
841 fn default() -> Self {
842 Self {
843 _marker: EvokerFangs,
844 parent: Default::default(),
845 }
846 }
847}
848
849#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
851pub struct Value(pub i32);
852#[derive(Component)]
873pub struct ExperienceOrb;
874impl ExperienceOrb {
875 fn apply_metadata(
876 entity: &mut bevy_ecs::system::EntityCommands,
877 d: EntityDataItem,
878 ) -> Result<(), UpdateMetadataError> {
879 match d.index {
880 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
881 8 => {
882 entity.insert(Value(d.value.into_int()?));
883 }
884 _ => {}
885 }
886 Ok(())
887 }
888}
889
890#[derive(Bundle)]
894pub struct ExperienceOrbMetadataBundle {
895 _marker: ExperienceOrb,
896 parent: AbstractEntityMetadataBundle,
897 value: Value,
898}
899impl Default for ExperienceOrbMetadataBundle {
900 fn default() -> Self {
901 Self {
902 _marker: ExperienceOrb,
903 parent: Default::default(),
904 value: Value(0),
905 }
906 }
907}
908
909#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
911pub struct EyeOfEnderItemStack(pub ItemStack);
912#[derive(Component)]
933pub struct EyeOfEnder;
934impl EyeOfEnder {
935 fn apply_metadata(
936 entity: &mut bevy_ecs::system::EntityCommands,
937 d: EntityDataItem,
938 ) -> Result<(), UpdateMetadataError> {
939 match d.index {
940 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
941 8 => {
942 entity.insert(EyeOfEnderItemStack(d.value.into_item_stack()?));
943 }
944 _ => {}
945 }
946 Ok(())
947 }
948}
949
950#[derive(Bundle)]
954pub struct EyeOfEnderMetadataBundle {
955 _marker: EyeOfEnder,
956 parent: AbstractEntityMetadataBundle,
957 eye_of_ender_item_stack: EyeOfEnderItemStack,
958}
959impl Default for EyeOfEnderMetadataBundle {
960 fn default() -> Self {
961 Self {
962 _marker: EyeOfEnder,
963 parent: Default::default(),
964 eye_of_ender_item_stack: EyeOfEnderItemStack(Default::default()),
965 }
966 }
967}
968
969#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
971pub struct StartPos(pub BlockPos);
972#[derive(Component)]
993pub struct FallingBlock;
994impl FallingBlock {
995 fn apply_metadata(
996 entity: &mut bevy_ecs::system::EntityCommands,
997 d: EntityDataItem,
998 ) -> Result<(), UpdateMetadataError> {
999 match d.index {
1000 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1001 8 => {
1002 entity.insert(StartPos(d.value.into_block_pos()?));
1003 }
1004 _ => {}
1005 }
1006 Ok(())
1007 }
1008}
1009
1010#[derive(Bundle)]
1014pub struct FallingBlockMetadataBundle {
1015 _marker: FallingBlock,
1016 parent: AbstractEntityMetadataBundle,
1017 start_pos: StartPos,
1018}
1019impl Default for FallingBlockMetadataBundle {
1020 fn default() -> Self {
1021 Self {
1022 _marker: FallingBlock,
1023 parent: Default::default(),
1024 start_pos: StartPos(BlockPos::new(0, 0, 0)),
1025 }
1026 }
1027}
1028
1029#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1031pub struct FireballItemStack(pub ItemStack);
1032#[derive(Component)]
1053pub struct Fireball;
1054impl Fireball {
1055 fn apply_metadata(
1056 entity: &mut bevy_ecs::system::EntityCommands,
1057 d: EntityDataItem,
1058 ) -> Result<(), UpdateMetadataError> {
1059 match d.index {
1060 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1061 8 => {
1062 entity.insert(FireballItemStack(d.value.into_item_stack()?));
1063 }
1064 _ => {}
1065 }
1066 Ok(())
1067 }
1068}
1069
1070#[derive(Bundle)]
1074pub struct FireballMetadataBundle {
1075 _marker: Fireball,
1076 parent: AbstractEntityMetadataBundle,
1077 fireball_item_stack: FireballItemStack,
1078}
1079impl Default for FireballMetadataBundle {
1080 fn default() -> Self {
1081 Self {
1082 _marker: Fireball,
1083 parent: Default::default(),
1084 fireball_item_stack: FireballItemStack(Default::default()),
1085 }
1086 }
1087}
1088
1089#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1091pub struct FireworksItem(pub ItemStack);
1092#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1094pub struct AttachedToTarget(pub OptionalUnsignedInt);
1095#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1097pub struct ShotAtAngle(pub bool);
1098#[derive(Component)]
1121pub struct FireworkRocket;
1122impl FireworkRocket {
1123 fn apply_metadata(
1124 entity: &mut bevy_ecs::system::EntityCommands,
1125 d: EntityDataItem,
1126 ) -> Result<(), UpdateMetadataError> {
1127 match d.index {
1128 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1129 8 => {
1130 entity.insert(FireworksItem(d.value.into_item_stack()?));
1131 }
1132 9 => {
1133 entity.insert(AttachedToTarget(d.value.into_optional_unsigned_int()?));
1134 }
1135 10 => {
1136 entity.insert(ShotAtAngle(d.value.into_boolean()?));
1137 }
1138 _ => {}
1139 }
1140 Ok(())
1141 }
1142}
1143
1144#[derive(Bundle)]
1148pub struct FireworkRocketMetadataBundle {
1149 _marker: FireworkRocket,
1150 parent: AbstractEntityMetadataBundle,
1151 fireworks_item: FireworksItem,
1152 attached_to_target: AttachedToTarget,
1153 shot_at_angle: ShotAtAngle,
1154}
1155impl Default for FireworkRocketMetadataBundle {
1156 fn default() -> Self {
1157 Self {
1158 _marker: FireworkRocket,
1159 parent: Default::default(),
1160 fireworks_item: FireworksItem(Default::default()),
1161 attached_to_target: AttachedToTarget(OptionalUnsignedInt(None)),
1162 shot_at_angle: ShotAtAngle(false),
1163 }
1164 }
1165}
1166
1167#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1169pub struct HookedEntity(pub i32);
1170#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1172pub struct Biting(pub bool);
1173#[derive(Component)]
1195pub struct FishingBobber;
1196impl FishingBobber {
1197 fn apply_metadata(
1198 entity: &mut bevy_ecs::system::EntityCommands,
1199 d: EntityDataItem,
1200 ) -> Result<(), UpdateMetadataError> {
1201 match d.index {
1202 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1203 8 => {
1204 entity.insert(HookedEntity(d.value.into_int()?));
1205 }
1206 9 => {
1207 entity.insert(Biting(d.value.into_boolean()?));
1208 }
1209 _ => {}
1210 }
1211 Ok(())
1212 }
1213}
1214
1215#[derive(Bundle)]
1219pub struct FishingBobberMetadataBundle {
1220 _marker: FishingBobber,
1221 parent: AbstractEntityMetadataBundle,
1222 hooked_entity: HookedEntity,
1223 biting: Biting,
1224}
1225impl Default for FishingBobberMetadataBundle {
1226 fn default() -> Self {
1227 Self {
1228 _marker: FishingBobber,
1229 parent: Default::default(),
1230 hooked_entity: HookedEntity(0),
1231 biting: Biting(false),
1232 }
1233 }
1234}
1235
1236#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1238pub struct InteractionWidth(pub f32);
1239#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1241pub struct InteractionHeight(pub f32);
1242#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1244pub struct Response(pub bool);
1245#[derive(Component)]
1268pub struct Interaction;
1269impl Interaction {
1270 fn apply_metadata(
1271 entity: &mut bevy_ecs::system::EntityCommands,
1272 d: EntityDataItem,
1273 ) -> Result<(), UpdateMetadataError> {
1274 match d.index {
1275 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1276 8 => {
1277 entity.insert(InteractionWidth(d.value.into_float()?));
1278 }
1279 9 => {
1280 entity.insert(InteractionHeight(d.value.into_float()?));
1281 }
1282 10 => {
1283 entity.insert(Response(d.value.into_boolean()?));
1284 }
1285 _ => {}
1286 }
1287 Ok(())
1288 }
1289}
1290
1291#[derive(Bundle)]
1295pub struct InteractionMetadataBundle {
1296 _marker: Interaction,
1297 parent: AbstractEntityMetadataBundle,
1298 interaction_width: InteractionWidth,
1299 interaction_height: InteractionHeight,
1300 response: Response,
1301}
1302impl Default for InteractionMetadataBundle {
1303 fn default() -> Self {
1304 Self {
1305 _marker: Interaction,
1306 parent: Default::default(),
1307 interaction_width: InteractionWidth(1.0),
1308 interaction_height: InteractionHeight(1.0),
1309 response: Response(false),
1310 }
1311 }
1312}
1313
1314#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1316pub struct ItemItem(pub ItemStack);
1317#[derive(Component)]
1337pub struct Item;
1338impl Item {
1339 fn apply_metadata(
1340 entity: &mut bevy_ecs::system::EntityCommands,
1341 d: EntityDataItem,
1342 ) -> Result<(), UpdateMetadataError> {
1343 match d.index {
1344 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1345 8 => {
1346 entity.insert(ItemItem(d.value.into_item_stack()?));
1347 }
1348 _ => {}
1349 }
1350 Ok(())
1351 }
1352}
1353
1354#[derive(Bundle)]
1358pub struct ItemMetadataBundle {
1359 _marker: Item,
1360 parent: AbstractEntityMetadataBundle,
1361 item_item: ItemItem,
1362}
1363impl Default for ItemMetadataBundle {
1364 fn default() -> Self {
1365 Self {
1366 _marker: Item,
1367 parent: Default::default(),
1368 item_item: ItemItem(Default::default()),
1369 }
1370 }
1371}
1372
1373#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1375pub struct ItemFrameDirection(pub Direction);
1376#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1378pub struct ItemFrameItem(pub ItemStack);
1379#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1381pub struct Rotation(pub i32);
1382#[derive(Component)]
1405pub struct ItemFrame;
1406impl ItemFrame {
1407 fn apply_metadata(
1408 entity: &mut bevy_ecs::system::EntityCommands,
1409 d: EntityDataItem,
1410 ) -> Result<(), UpdateMetadataError> {
1411 match d.index {
1412 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1413 8 => {
1414 entity.insert(ItemFrameDirection(d.value.into_direction()?));
1415 }
1416 9 => {
1417 entity.insert(ItemFrameItem(d.value.into_item_stack()?));
1418 }
1419 10 => {
1420 entity.insert(Rotation(d.value.into_int()?));
1421 }
1422 _ => {}
1423 }
1424 Ok(())
1425 }
1426}
1427
1428#[derive(Bundle)]
1432pub struct ItemFrameMetadataBundle {
1433 _marker: ItemFrame,
1434 parent: AbstractEntityMetadataBundle,
1435 item_frame_direction: ItemFrameDirection,
1436 item_frame_item: ItemFrameItem,
1437 rotation: Rotation,
1438}
1439impl Default for ItemFrameMetadataBundle {
1440 fn default() -> Self {
1441 Self {
1442 _marker: ItemFrame,
1443 parent: Default::default(),
1444 item_frame_direction: ItemFrameDirection(Default::default()),
1445 item_frame_item: ItemFrameItem(Default::default()),
1446 rotation: Rotation(0),
1447 }
1448 }
1449}
1450
1451#[derive(Component)]
1470pub struct GlowItemFrame;
1471impl GlowItemFrame {
1472 fn apply_metadata(
1473 entity: &mut bevy_ecs::system::EntityCommands,
1474 d: EntityDataItem,
1475 ) -> Result<(), UpdateMetadataError> {
1476 match d.index {
1477 0..=10 => ItemFrame::apply_metadata(entity, d)?,
1478 _ => {}
1479 }
1480 Ok(())
1481 }
1482}
1483
1484#[derive(Bundle)]
1488pub struct GlowItemFrameMetadataBundle {
1489 _marker: GlowItemFrame,
1490 parent: ItemFrameMetadataBundle,
1491}
1492impl Default for GlowItemFrameMetadataBundle {
1493 fn default() -> Self {
1494 Self {
1495 _marker: GlowItemFrame,
1496 parent: Default::default(),
1497 }
1498 }
1499}
1500
1501#[derive(Component)]
1519pub struct LeashKnot;
1520impl LeashKnot {
1521 fn apply_metadata(
1522 entity: &mut bevy_ecs::system::EntityCommands,
1523 d: EntityDataItem,
1524 ) -> Result<(), UpdateMetadataError> {
1525 match d.index {
1526 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1527 _ => {}
1528 }
1529 Ok(())
1530 }
1531}
1532
1533#[derive(Bundle)]
1537pub struct LeashKnotMetadataBundle {
1538 _marker: LeashKnot,
1539 parent: AbstractEntityMetadataBundle,
1540}
1541impl Default for LeashKnotMetadataBundle {
1542 fn default() -> Self {
1543 Self {
1544 _marker: LeashKnot,
1545 parent: Default::default(),
1546 }
1547 }
1548}
1549
1550#[derive(Component)]
1568pub struct LightningBolt;
1569impl LightningBolt {
1570 fn apply_metadata(
1571 entity: &mut bevy_ecs::system::EntityCommands,
1572 d: EntityDataItem,
1573 ) -> Result<(), UpdateMetadataError> {
1574 match d.index {
1575 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1576 _ => {}
1577 }
1578 Ok(())
1579 }
1580}
1581
1582#[derive(Bundle)]
1586pub struct LightningBoltMetadataBundle {
1587 _marker: LightningBolt,
1588 parent: AbstractEntityMetadataBundle,
1589}
1590impl Default for LightningBoltMetadataBundle {
1591 fn default() -> Self {
1592 Self {
1593 _marker: LightningBolt,
1594 parent: Default::default(),
1595 }
1596 }
1597}
1598
1599#[derive(Component)]
1617pub struct LlamaSpit;
1618impl LlamaSpit {
1619 fn apply_metadata(
1620 entity: &mut bevy_ecs::system::EntityCommands,
1621 d: EntityDataItem,
1622 ) -> Result<(), UpdateMetadataError> {
1623 match d.index {
1624 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1625 _ => {}
1626 }
1627 Ok(())
1628 }
1629}
1630
1631#[derive(Bundle)]
1635pub struct LlamaSpitMetadataBundle {
1636 _marker: LlamaSpit,
1637 parent: AbstractEntityMetadataBundle,
1638}
1639impl Default for LlamaSpitMetadataBundle {
1640 fn default() -> Self {
1641 Self {
1642 _marker: LlamaSpit,
1643 parent: Default::default(),
1644 }
1645 }
1646}
1647
1648#[derive(Component)]
1666pub struct Marker;
1667impl Marker {
1668 fn apply_metadata(
1669 entity: &mut bevy_ecs::system::EntityCommands,
1670 d: EntityDataItem,
1671 ) -> Result<(), UpdateMetadataError> {
1672 match d.index {
1673 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1674 _ => {}
1675 }
1676 Ok(())
1677 }
1678}
1679
1680#[derive(Bundle)]
1684pub struct MarkerMetadataBundle {
1685 _marker: Marker,
1686 parent: AbstractEntityMetadataBundle,
1687}
1688impl Default for MarkerMetadataBundle {
1689 fn default() -> Self {
1690 Self {
1691 _marker: Marker,
1692 parent: Default::default(),
1693 }
1694 }
1695}
1696
1697#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1699pub struct OminousItemSpawnerItem(pub ItemStack);
1700#[derive(Component)]
1721pub struct OminousItemSpawner;
1722impl OminousItemSpawner {
1723 fn apply_metadata(
1724 entity: &mut bevy_ecs::system::EntityCommands,
1725 d: EntityDataItem,
1726 ) -> Result<(), UpdateMetadataError> {
1727 match d.index {
1728 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1729 8 => {
1730 entity.insert(OminousItemSpawnerItem(d.value.into_item_stack()?));
1731 }
1732 _ => {}
1733 }
1734 Ok(())
1735 }
1736}
1737
1738#[derive(Bundle)]
1742pub struct OminousItemSpawnerMetadataBundle {
1743 _marker: OminousItemSpawner,
1744 parent: AbstractEntityMetadataBundle,
1745 ominous_item_spawner_item: OminousItemSpawnerItem,
1746}
1747impl Default for OminousItemSpawnerMetadataBundle {
1748 fn default() -> Self {
1749 Self {
1750 _marker: OminousItemSpawner,
1751 parent: Default::default(),
1752 ominous_item_spawner_item: OminousItemSpawnerItem(Default::default()),
1753 }
1754 }
1755}
1756
1757#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1759pub struct PaintingDirection(pub Direction);
1760#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1762pub struct PaintingVariant(pub azalea_registry::data::PaintingVariant);
1763#[derive(Component)]
1785pub struct Painting;
1786impl Painting {
1787 fn apply_metadata(
1788 entity: &mut bevy_ecs::system::EntityCommands,
1789 d: EntityDataItem,
1790 ) -> Result<(), UpdateMetadataError> {
1791 match d.index {
1792 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1793 8 => {
1794 entity.insert(PaintingDirection(d.value.into_direction()?));
1795 }
1796 9 => {
1797 entity.insert(PaintingVariant(d.value.into_painting_variant()?));
1798 }
1799 _ => {}
1800 }
1801 Ok(())
1802 }
1803}
1804
1805#[derive(Bundle)]
1809pub struct PaintingMetadataBundle {
1810 _marker: Painting,
1811 parent: AbstractEntityMetadataBundle,
1812 painting_direction: PaintingDirection,
1813 painting_variant: PaintingVariant,
1814}
1815impl Default for PaintingMetadataBundle {
1816 fn default() -> Self {
1817 Self {
1818 _marker: Painting,
1819 parent: Default::default(),
1820 painting_direction: PaintingDirection(Default::default()),
1821 painting_variant: PaintingVariant(azalea_registry::data::PaintingVariant::new_raw(0)),
1822 }
1823 }
1824}
1825
1826#[derive(Component)]
1844pub struct ShulkerBullet;
1845impl ShulkerBullet {
1846 fn apply_metadata(
1847 entity: &mut bevy_ecs::system::EntityCommands,
1848 d: EntityDataItem,
1849 ) -> Result<(), UpdateMetadataError> {
1850 match d.index {
1851 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1852 _ => {}
1853 }
1854 Ok(())
1855 }
1856}
1857
1858#[derive(Bundle)]
1862pub struct ShulkerBulletMetadataBundle {
1863 _marker: ShulkerBullet,
1864 parent: AbstractEntityMetadataBundle,
1865}
1866impl Default for ShulkerBulletMetadataBundle {
1867 fn default() -> Self {
1868 Self {
1869 _marker: ShulkerBullet,
1870 parent: Default::default(),
1871 }
1872 }
1873}
1874
1875#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1877pub struct SmallFireballItemStack(pub ItemStack);
1878#[derive(Component)]
1899pub struct SmallFireball;
1900impl SmallFireball {
1901 fn apply_metadata(
1902 entity: &mut bevy_ecs::system::EntityCommands,
1903 d: EntityDataItem,
1904 ) -> Result<(), UpdateMetadataError> {
1905 match d.index {
1906 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1907 8 => {
1908 entity.insert(SmallFireballItemStack(d.value.into_item_stack()?));
1909 }
1910 _ => {}
1911 }
1912 Ok(())
1913 }
1914}
1915
1916#[derive(Bundle)]
1920pub struct SmallFireballMetadataBundle {
1921 _marker: SmallFireball,
1922 parent: AbstractEntityMetadataBundle,
1923 small_fireball_item_stack: SmallFireballItemStack,
1924}
1925impl Default for SmallFireballMetadataBundle {
1926 fn default() -> Self {
1927 Self {
1928 _marker: SmallFireball,
1929 parent: Default::default(),
1930 small_fireball_item_stack: SmallFireballItemStack(Default::default()),
1931 }
1932 }
1933}
1934
1935#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1937pub struct Fuse(pub i32);
1938#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1940pub struct TntBlockState(pub azalea_block::BlockState);
1941#[derive(Component)]
1962pub struct Tnt;
1963impl Tnt {
1964 fn apply_metadata(
1965 entity: &mut bevy_ecs::system::EntityCommands,
1966 d: EntityDataItem,
1967 ) -> Result<(), UpdateMetadataError> {
1968 match d.index {
1969 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1970 8 => {
1971 entity.insert(Fuse(d.value.into_int()?));
1972 }
1973 9 => {
1974 entity.insert(TntBlockState(d.value.into_block_state()?));
1975 }
1976 _ => {}
1977 }
1978 Ok(())
1979 }
1980}
1981
1982#[derive(Bundle)]
1986pub struct TntMetadataBundle {
1987 _marker: Tnt,
1988 parent: AbstractEntityMetadataBundle,
1989 fuse: Fuse,
1990 tnt_block_state: TntBlockState,
1991}
1992impl Default for TntMetadataBundle {
1993 fn default() -> Self {
1994 Self {
1995 _marker: Tnt,
1996 parent: Default::default(),
1997 fuse: Fuse(80),
1998 tnt_block_state: TntBlockState(Default::default()),
1999 }
2000 }
2001}
2002
2003#[derive(Component)]
2021pub struct WindCharge;
2022impl WindCharge {
2023 fn apply_metadata(
2024 entity: &mut bevy_ecs::system::EntityCommands,
2025 d: EntityDataItem,
2026 ) -> Result<(), UpdateMetadataError> {
2027 match d.index {
2028 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2029 _ => {}
2030 }
2031 Ok(())
2032 }
2033}
2034
2035#[derive(Bundle)]
2039pub struct WindChargeMetadataBundle {
2040 _marker: WindCharge,
2041 parent: AbstractEntityMetadataBundle,
2042}
2043impl Default for WindChargeMetadataBundle {
2044 fn default() -> Self {
2045 Self {
2046 _marker: WindCharge,
2047 parent: Default::default(),
2048 }
2049 }
2050}
2051
2052#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2054pub struct Dangerous(pub bool);
2055#[derive(Component)]
2076pub struct WitherSkull;
2077impl WitherSkull {
2078 fn apply_metadata(
2079 entity: &mut bevy_ecs::system::EntityCommands,
2080 d: EntityDataItem,
2081 ) -> Result<(), UpdateMetadataError> {
2082 match d.index {
2083 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2084 8 => {
2085 entity.insert(Dangerous(d.value.into_boolean()?));
2086 }
2087 _ => {}
2088 }
2089 Ok(())
2090 }
2091}
2092
2093#[derive(Bundle)]
2097pub struct WitherSkullMetadataBundle {
2098 _marker: WitherSkull,
2099 parent: AbstractEntityMetadataBundle,
2100 dangerous: Dangerous,
2101}
2102impl Default for WitherSkullMetadataBundle {
2103 fn default() -> Self {
2104 Self {
2105 _marker: WitherSkull,
2106 parent: Default::default(),
2107 dangerous: Dangerous(false),
2108 }
2109 }
2110}
2111
2112#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
2113pub struct CritArrow(pub bool);
2115#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
2116pub struct NoPhysics(pub bool);
2118#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2120pub struct PierceLevel(pub u8);
2121#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2123pub struct InGround(pub bool);
2124#[derive(Component)]
2150pub struct AbstractArrow;
2151impl AbstractArrow {
2152 fn apply_metadata(
2153 entity: &mut bevy_ecs::system::EntityCommands,
2154 d: EntityDataItem,
2155 ) -> Result<(), UpdateMetadataError> {
2156 match d.index {
2157 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2158 8 => {
2159 let bitfield = d.value.into_byte()?;
2160 entity.insert(CritArrow(bitfield & 0x1 != 0));
2161 entity.insert(NoPhysics(bitfield & 0x2 != 0));
2162 }
2163 9 => {
2164 entity.insert(PierceLevel(d.value.into_byte()?));
2165 }
2166 10 => {
2167 entity.insert(InGround(d.value.into_boolean()?));
2168 }
2169 _ => {}
2170 }
2171 Ok(())
2172 }
2173}
2174
2175#[derive(Bundle)]
2179pub struct AbstractArrowMetadataBundle {
2180 _marker: AbstractArrow,
2181 parent: AbstractEntityMetadataBundle,
2182 crit_arrow: CritArrow,
2183 no_physics: NoPhysics,
2184 pierce_level: PierceLevel,
2185 in_ground: InGround,
2186}
2187impl Default for AbstractArrowMetadataBundle {
2188 fn default() -> Self {
2189 Self {
2190 _marker: AbstractArrow,
2191 parent: Default::default(),
2192 crit_arrow: CritArrow(false),
2193 no_physics: NoPhysics(false),
2194 pierce_level: PierceLevel(0),
2195 in_ground: InGround(false),
2196 }
2197 }
2198}
2199
2200#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2202pub struct EffectColor(pub i32);
2203#[derive(Component)]
2224pub struct Arrow;
2225impl Arrow {
2226 fn apply_metadata(
2227 entity: &mut bevy_ecs::system::EntityCommands,
2228 d: EntityDataItem,
2229 ) -> Result<(), UpdateMetadataError> {
2230 match d.index {
2231 0..=10 => AbstractArrow::apply_metadata(entity, d)?,
2232 11 => {
2233 entity.insert(EffectColor(d.value.into_int()?));
2234 }
2235 _ => {}
2236 }
2237 Ok(())
2238 }
2239}
2240
2241#[derive(Bundle)]
2245pub struct ArrowMetadataBundle {
2246 _marker: Arrow,
2247 parent: AbstractArrowMetadataBundle,
2248 effect_color: EffectColor,
2249}
2250impl Default for ArrowMetadataBundle {
2251 fn default() -> Self {
2252 Self {
2253 _marker: Arrow,
2254 parent: Default::default(),
2255 effect_color: EffectColor(-1),
2256 }
2257 }
2258}
2259
2260#[derive(Component)]
2279pub struct SpectralArrow;
2280impl SpectralArrow {
2281 fn apply_metadata(
2282 entity: &mut bevy_ecs::system::EntityCommands,
2283 d: EntityDataItem,
2284 ) -> Result<(), UpdateMetadataError> {
2285 match d.index {
2286 0..=10 => AbstractArrow::apply_metadata(entity, d)?,
2287 _ => {}
2288 }
2289 Ok(())
2290 }
2291}
2292
2293#[derive(Bundle)]
2297pub struct SpectralArrowMetadataBundle {
2298 _marker: SpectralArrow,
2299 parent: AbstractArrowMetadataBundle,
2300}
2301impl Default for SpectralArrowMetadataBundle {
2302 fn default() -> Self {
2303 Self {
2304 _marker: SpectralArrow,
2305 parent: Default::default(),
2306 }
2307 }
2308}
2309
2310#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2312pub struct Loyalty(pub u8);
2313#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2315pub struct Foil(pub bool);
2316#[derive(Component)]
2338pub struct Trident;
2339impl Trident {
2340 fn apply_metadata(
2341 entity: &mut bevy_ecs::system::EntityCommands,
2342 d: EntityDataItem,
2343 ) -> Result<(), UpdateMetadataError> {
2344 match d.index {
2345 0..=10 => AbstractArrow::apply_metadata(entity, d)?,
2346 11 => {
2347 entity.insert(Loyalty(d.value.into_byte()?));
2348 }
2349 12 => {
2350 entity.insert(Foil(d.value.into_boolean()?));
2351 }
2352 _ => {}
2353 }
2354 Ok(())
2355 }
2356}
2357
2358#[derive(Bundle)]
2362pub struct TridentMetadataBundle {
2363 _marker: Trident,
2364 parent: AbstractArrowMetadataBundle,
2365 loyalty: Loyalty,
2366 foil: Foil,
2367}
2368impl Default for TridentMetadataBundle {
2369 fn default() -> Self {
2370 Self {
2371 _marker: Trident,
2372 parent: Default::default(),
2373 loyalty: Loyalty(0),
2374 foil: Foil(false),
2375 }
2376 }
2377}
2378
2379#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2381pub struct TransformationInterpolationStartDeltaTicks(pub i32);
2382#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2384pub struct TransformationInterpolationDuration(pub i32);
2385#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2387pub struct PosRotInterpolationDuration(pub i32);
2388#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2390pub struct Translation(pub Vec3f32);
2391#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2393pub struct Scale(pub Vec3f32);
2394#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2396pub struct LeftRotation(pub Quaternion);
2397#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2399pub struct RightRotation(pub Quaternion);
2400#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2402pub struct BillboardRenderConstraints(pub u8);
2403#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2405pub struct BrightnessOverride(pub i32);
2406#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2408pub struct ViewRange(pub f32);
2409#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2411pub struct ShadowRadius(pub f32);
2412#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2414pub struct ShadowStrength(pub f32);
2415#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2417pub struct AbstractDisplayWidth(pub f32);
2418#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2420pub struct AbstractDisplayHeight(pub f32);
2421#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2423pub struct GlowColorOverride(pub i32);
2424#[derive(Component)]
2461pub struct AbstractDisplay;
2462impl AbstractDisplay {
2463 fn apply_metadata(
2464 entity: &mut bevy_ecs::system::EntityCommands,
2465 d: EntityDataItem,
2466 ) -> Result<(), UpdateMetadataError> {
2467 match d.index {
2468 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2469 8 => {
2470 entity.insert(TransformationInterpolationStartDeltaTicks(
2471 d.value.into_int()?,
2472 ));
2473 }
2474 9 => {
2475 entity.insert(TransformationInterpolationDuration(d.value.into_int()?));
2476 }
2477 10 => {
2478 entity.insert(PosRotInterpolationDuration(d.value.into_int()?));
2479 }
2480 11 => {
2481 entity.insert(Translation(d.value.into_vector3()?));
2482 }
2483 12 => {
2484 entity.insert(Scale(d.value.into_vector3()?));
2485 }
2486 13 => {
2487 entity.insert(LeftRotation(d.value.into_quaternion()?));
2488 }
2489 14 => {
2490 entity.insert(RightRotation(d.value.into_quaternion()?));
2491 }
2492 15 => {
2493 entity.insert(BillboardRenderConstraints(d.value.into_byte()?));
2494 }
2495 16 => {
2496 entity.insert(BrightnessOverride(d.value.into_int()?));
2497 }
2498 17 => {
2499 entity.insert(ViewRange(d.value.into_float()?));
2500 }
2501 18 => {
2502 entity.insert(ShadowRadius(d.value.into_float()?));
2503 }
2504 19 => {
2505 entity.insert(ShadowStrength(d.value.into_float()?));
2506 }
2507 20 => {
2508 entity.insert(AbstractDisplayWidth(d.value.into_float()?));
2509 }
2510 21 => {
2511 entity.insert(AbstractDisplayHeight(d.value.into_float()?));
2512 }
2513 22 => {
2514 entity.insert(GlowColorOverride(d.value.into_int()?));
2515 }
2516 _ => {}
2517 }
2518 Ok(())
2519 }
2520}
2521
2522#[derive(Bundle)]
2526pub struct AbstractDisplayMetadataBundle {
2527 _marker: AbstractDisplay,
2528 parent: AbstractEntityMetadataBundle,
2529 transformation_interpolation_start_delta_ticks: TransformationInterpolationStartDeltaTicks,
2530 transformation_interpolation_duration: TransformationInterpolationDuration,
2531 pos_rot_interpolation_duration: PosRotInterpolationDuration,
2532 translation: Translation,
2533 scale: Scale,
2534 left_rotation: LeftRotation,
2535 right_rotation: RightRotation,
2536 billboard_render_constraints: BillboardRenderConstraints,
2537 brightness_override: BrightnessOverride,
2538 view_range: ViewRange,
2539 shadow_radius: ShadowRadius,
2540 shadow_strength: ShadowStrength,
2541 abstract_display_width: AbstractDisplayWidth,
2542 abstract_display_height: AbstractDisplayHeight,
2543 glow_color_override: GlowColorOverride,
2544}
2545impl Default for AbstractDisplayMetadataBundle {
2546 fn default() -> Self {
2547 Self {
2548 _marker: AbstractDisplay,
2549 parent: Default::default(),
2550 transformation_interpolation_start_delta_ticks:
2551 TransformationInterpolationStartDeltaTicks(0),
2552 transformation_interpolation_duration: TransformationInterpolationDuration(0),
2553 pos_rot_interpolation_duration: PosRotInterpolationDuration(0),
2554 translation: Translation(Vec3f32 {
2555 x: 0.0,
2556 y: 0.0,
2557 z: 0.0,
2558 }),
2559 scale: Scale(Vec3f32 {
2560 x: 1.0,
2561 y: 1.0,
2562 z: 1.0,
2563 }),
2564 left_rotation: LeftRotation(Quaternion {
2565 x: 0.0,
2566 y: 0.0,
2567 z: 0.0,
2568 w: 1.0,
2569 }),
2570 right_rotation: RightRotation(Quaternion {
2571 x: 0.0,
2572 y: 0.0,
2573 z: 0.0,
2574 w: 1.0,
2575 }),
2576 billboard_render_constraints: BillboardRenderConstraints(Default::default()),
2577 brightness_override: BrightnessOverride(-1),
2578 view_range: ViewRange(1.0),
2579 shadow_radius: ShadowRadius(0.0),
2580 shadow_strength: ShadowStrength(1.0),
2581 abstract_display_width: AbstractDisplayWidth(0.0),
2582 abstract_display_height: AbstractDisplayHeight(0.0),
2583 glow_color_override: GlowColorOverride(-1),
2584 }
2585 }
2586}
2587
2588#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2590pub struct BlockDisplayBlockState(pub azalea_block::BlockState);
2591#[derive(Component)]
2613pub struct BlockDisplay;
2614impl BlockDisplay {
2615 fn apply_metadata(
2616 entity: &mut bevy_ecs::system::EntityCommands,
2617 d: EntityDataItem,
2618 ) -> Result<(), UpdateMetadataError> {
2619 match d.index {
2620 0..=22 => AbstractDisplay::apply_metadata(entity, d)?,
2621 23 => {
2622 entity.insert(BlockDisplayBlockState(d.value.into_block_state()?));
2623 }
2624 _ => {}
2625 }
2626 Ok(())
2627 }
2628}
2629
2630#[derive(Bundle)]
2634pub struct BlockDisplayMetadataBundle {
2635 _marker: BlockDisplay,
2636 parent: AbstractDisplayMetadataBundle,
2637 block_display_block_state: BlockDisplayBlockState,
2638}
2639impl Default for BlockDisplayMetadataBundle {
2640 fn default() -> Self {
2641 Self {
2642 _marker: BlockDisplay,
2643 parent: Default::default(),
2644 block_display_block_state: BlockDisplayBlockState(Default::default()),
2645 }
2646 }
2647}
2648
2649#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2651pub struct ItemDisplayItemStack(pub ItemStack);
2652#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2654pub struct ItemDisplayItemDisplay(pub u8);
2655#[derive(Component)]
2678pub struct ItemDisplay;
2679impl ItemDisplay {
2680 fn apply_metadata(
2681 entity: &mut bevy_ecs::system::EntityCommands,
2682 d: EntityDataItem,
2683 ) -> Result<(), UpdateMetadataError> {
2684 match d.index {
2685 0..=22 => AbstractDisplay::apply_metadata(entity, d)?,
2686 23 => {
2687 entity.insert(ItemDisplayItemStack(d.value.into_item_stack()?));
2688 }
2689 24 => {
2690 entity.insert(ItemDisplayItemDisplay(d.value.into_byte()?));
2691 }
2692 _ => {}
2693 }
2694 Ok(())
2695 }
2696}
2697
2698#[derive(Bundle)]
2702pub struct ItemDisplayMetadataBundle {
2703 _marker: ItemDisplay,
2704 parent: AbstractDisplayMetadataBundle,
2705 item_display_item_stack: ItemDisplayItemStack,
2706 item_display_item_display: ItemDisplayItemDisplay,
2707}
2708impl Default for ItemDisplayMetadataBundle {
2709 fn default() -> Self {
2710 Self {
2711 _marker: ItemDisplay,
2712 parent: Default::default(),
2713 item_display_item_stack: ItemDisplayItemStack(Default::default()),
2714 item_display_item_display: ItemDisplayItemDisplay(Default::default()),
2715 }
2716 }
2717}
2718
2719#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2721pub struct Text(pub Box<FormattedText>);
2722#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2724pub struct LineWidth(pub i32);
2725#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2727pub struct BackgroundColor(pub i32);
2728#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2730pub struct TextOpacity(pub u8);
2731#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2733pub struct StyleFlags(pub u8);
2734#[derive(Component)]
2760pub struct TextDisplay;
2761impl TextDisplay {
2762 fn apply_metadata(
2763 entity: &mut bevy_ecs::system::EntityCommands,
2764 d: EntityDataItem,
2765 ) -> Result<(), UpdateMetadataError> {
2766 match d.index {
2767 0..=22 => AbstractDisplay::apply_metadata(entity, d)?,
2768 23 => {
2769 entity.insert(Text(d.value.into_formatted_text()?));
2770 }
2771 24 => {
2772 entity.insert(LineWidth(d.value.into_int()?));
2773 }
2774 25 => {
2775 entity.insert(BackgroundColor(d.value.into_int()?));
2776 }
2777 26 => {
2778 entity.insert(TextOpacity(d.value.into_byte()?));
2779 }
2780 27 => {
2781 entity.insert(StyleFlags(d.value.into_byte()?));
2782 }
2783 _ => {}
2784 }
2785 Ok(())
2786 }
2787}
2788
2789#[derive(Bundle)]
2793pub struct TextDisplayMetadataBundle {
2794 _marker: TextDisplay,
2795 parent: AbstractDisplayMetadataBundle,
2796 text: Text,
2797 line_width: LineWidth,
2798 background_color: BackgroundColor,
2799 text_opacity: TextOpacity,
2800 style_flags: StyleFlags,
2801}
2802impl Default for TextDisplayMetadataBundle {
2803 fn default() -> Self {
2804 Self {
2805 _marker: TextDisplay,
2806 parent: Default::default(),
2807 text: Text(Default::default()),
2808 line_width: LineWidth(200),
2809 background_color: BackgroundColor(1073741824),
2810 text_opacity: TextOpacity(127),
2811 style_flags: StyleFlags(0),
2812 }
2813 }
2814}
2815
2816#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
2817pub struct AutoSpinAttack(pub bool);
2819#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
2820pub struct AbstractLivingUsingItem(pub bool);
2822#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2824pub struct Health(pub f32);
2825#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2827pub struct EffectParticles(pub Box<[Particle]>);
2828#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2830pub struct EffectAmbience(pub bool);
2831#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2833pub struct ArrowCount(pub i32);
2834#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2836pub struct StingerCount(pub i32);
2837#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2839pub struct SleepingPos(pub Option<BlockPos>);
2840#[derive(Component)]
2973pub struct AbstractLiving;
2974impl AbstractLiving {
2975 fn apply_metadata(
2976 entity: &mut bevy_ecs::system::EntityCommands,
2977 d: EntityDataItem,
2978 ) -> Result<(), UpdateMetadataError> {
2979 match d.index {
2980 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2981 8 => {
2982 let bitfield = d.value.into_byte()?;
2983 entity.insert(AutoSpinAttack(bitfield & 0x4 != 0));
2984 entity.insert(AbstractLivingUsingItem(bitfield & 0x1 != 0));
2985 }
2986 9 => {
2987 entity.insert(Health(d.value.into_float()?));
2988 }
2989 10 => {
2990 entity.insert(EffectParticles(d.value.into_particles()?));
2991 }
2992 11 => {
2993 entity.insert(EffectAmbience(d.value.into_boolean()?));
2994 }
2995 12 => {
2996 entity.insert(ArrowCount(d.value.into_int()?));
2997 }
2998 13 => {
2999 entity.insert(StingerCount(d.value.into_int()?));
3000 }
3001 14 => {
3002 entity.insert(SleepingPos(d.value.into_optional_block_pos()?));
3003 }
3004 _ => {}
3005 }
3006 Ok(())
3007 }
3008}
3009
3010#[derive(Bundle)]
3014pub struct AbstractLivingMetadataBundle {
3015 _marker: AbstractLiving,
3016 parent: AbstractEntityMetadataBundle,
3017 auto_spin_attack: AutoSpinAttack,
3018 abstract_living_using_item: AbstractLivingUsingItem,
3019 health: Health,
3020 effect_particles: EffectParticles,
3021 effect_ambience: EffectAmbience,
3022 arrow_count: ArrowCount,
3023 stinger_count: StingerCount,
3024 sleeping_pos: SleepingPos,
3025}
3026impl Default for AbstractLivingMetadataBundle {
3027 fn default() -> Self {
3028 Self {
3029 _marker: AbstractLiving,
3030 parent: Default::default(),
3031 auto_spin_attack: AutoSpinAttack(false),
3032 abstract_living_using_item: AbstractLivingUsingItem(false),
3033 health: Health(1.0),
3034 effect_particles: EffectParticles(Default::default()),
3035 effect_ambience: EffectAmbience(false),
3036 arrow_count: ArrowCount(0),
3037 stinger_count: StingerCount(0),
3038 sleeping_pos: SleepingPos(None),
3039 }
3040 }
3041}
3042
3043#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3044pub struct Small(pub bool);
3046#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3047pub struct ShowArms(pub bool);
3049#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3050pub struct ShowBasePlate(pub bool);
3052#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3053pub struct ArmorStandMarker(pub bool);
3055#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3057pub struct HeadPose(pub Rotations);
3058#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3060pub struct BodyPose(pub Rotations);
3061#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3063pub struct LeftArmPose(pub Rotations);
3064#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3066pub struct RightArmPose(pub Rotations);
3067#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3069pub struct LeftLegPose(pub Rotations);
3070#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3072pub struct RightLegPose(pub Rotations);
3073#[derive(Component)]
3104pub struct ArmorStand;
3105impl ArmorStand {
3106 fn apply_metadata(
3107 entity: &mut bevy_ecs::system::EntityCommands,
3108 d: EntityDataItem,
3109 ) -> Result<(), UpdateMetadataError> {
3110 match d.index {
3111 0..=14 => AbstractLiving::apply_metadata(entity, d)?,
3112 15 => {
3113 let bitfield = d.value.into_byte()?;
3114 entity.insert(Small(bitfield & 0x1 != 0));
3115 entity.insert(ShowArms(bitfield & 0x4 != 0));
3116 entity.insert(ShowBasePlate(bitfield & 0x8 != 0));
3117 entity.insert(ArmorStandMarker(bitfield & 0x10 != 0));
3118 }
3119 16 => {
3120 entity.insert(HeadPose(d.value.into_rotations()?));
3121 }
3122 17 => {
3123 entity.insert(BodyPose(d.value.into_rotations()?));
3124 }
3125 18 => {
3126 entity.insert(LeftArmPose(d.value.into_rotations()?));
3127 }
3128 19 => {
3129 entity.insert(RightArmPose(d.value.into_rotations()?));
3130 }
3131 20 => {
3132 entity.insert(LeftLegPose(d.value.into_rotations()?));
3133 }
3134 21 => {
3135 entity.insert(RightLegPose(d.value.into_rotations()?));
3136 }
3137 _ => {}
3138 }
3139 Ok(())
3140 }
3141}
3142
3143#[derive(Bundle)]
3147pub struct ArmorStandMetadataBundle {
3148 _marker: ArmorStand,
3149 parent: AbstractLivingMetadataBundle,
3150 small: Small,
3151 show_arms: ShowArms,
3152 show_base_plate: ShowBasePlate,
3153 armor_stand_marker: ArmorStandMarker,
3154 head_pose: HeadPose,
3155 body_pose: BodyPose,
3156 left_arm_pose: LeftArmPose,
3157 right_arm_pose: RightArmPose,
3158 left_leg_pose: LeftLegPose,
3159 right_leg_pose: RightLegPose,
3160}
3161impl Default for ArmorStandMetadataBundle {
3162 fn default() -> Self {
3163 Self {
3164 _marker: ArmorStand,
3165 parent: Default::default(),
3166 small: Small(false),
3167 show_arms: ShowArms(false),
3168 show_base_plate: ShowBasePlate(false),
3169 armor_stand_marker: ArmorStandMarker(false),
3170 head_pose: HeadPose(Default::default()),
3171 body_pose: BodyPose(Default::default()),
3172 left_arm_pose: LeftArmPose(Default::default()),
3173 right_arm_pose: RightArmPose(Default::default()),
3174 left_leg_pose: LeftLegPose(Default::default()),
3175 right_leg_pose: RightLegPose(Default::default()),
3176 }
3177 }
3178}
3179
3180#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3182pub struct PlayerMainHand(pub HumanoidArm);
3183#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3185pub struct PlayerModeCustomisation(pub u8);
3186#[derive(Component)]
3210pub struct AbstractAvatar;
3211impl AbstractAvatar {
3212 fn apply_metadata(
3213 entity: &mut bevy_ecs::system::EntityCommands,
3214 d: EntityDataItem,
3215 ) -> Result<(), UpdateMetadataError> {
3216 match d.index {
3217 0..=14 => AbstractLiving::apply_metadata(entity, d)?,
3218 15 => {
3219 entity.insert(PlayerMainHand(d.value.into_humanoid_arm()?));
3220 }
3221 16 => {
3222 entity.insert(PlayerModeCustomisation(d.value.into_byte()?));
3223 }
3224 _ => {}
3225 }
3226 Ok(())
3227 }
3228}
3229
3230#[derive(Bundle)]
3234pub struct AbstractAvatarMetadataBundle {
3235 _marker: AbstractAvatar,
3236 parent: AbstractLivingMetadataBundle,
3237 player_main_hand: PlayerMainHand,
3238 player_mode_customisation: PlayerModeCustomisation,
3239}
3240impl Default for AbstractAvatarMetadataBundle {
3241 fn default() -> Self {
3242 Self {
3243 _marker: AbstractAvatar,
3244 parent: Default::default(),
3245 player_main_hand: PlayerMainHand(Default::default()),
3246 player_mode_customisation: PlayerModeCustomisation(0),
3247 }
3248 }
3249}
3250
3251#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3253pub struct Profile(pub components::Profile);
3254#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3256pub struct Immovable(pub bool);
3257#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3259pub struct Description(pub Option<Box<FormattedText>>);
3260#[derive(Component)]
3285pub struct Mannequin;
3286impl Mannequin {
3287 fn apply_metadata(
3288 entity: &mut bevy_ecs::system::EntityCommands,
3289 d: EntityDataItem,
3290 ) -> Result<(), UpdateMetadataError> {
3291 match d.index {
3292 0..=16 => AbstractAvatar::apply_metadata(entity, d)?,
3293 17 => {
3294 entity.insert(Profile(d.value.into_resolvable_profile()?));
3295 }
3296 18 => {
3297 entity.insert(Immovable(d.value.into_boolean()?));
3298 }
3299 19 => {
3300 entity.insert(Description(d.value.into_optional_formatted_text()?));
3301 }
3302 _ => {}
3303 }
3304 Ok(())
3305 }
3306}
3307
3308#[derive(Bundle)]
3312pub struct MannequinMetadataBundle {
3313 _marker: Mannequin,
3314 parent: AbstractAvatarMetadataBundle,
3315 profile: Profile,
3316 immovable: Immovable,
3317 description: Description,
3318}
3319impl Default for MannequinMetadataBundle {
3320 fn default() -> Self {
3321 Self {
3322 _marker: Mannequin,
3323 parent: Default::default(),
3324 profile: Profile(Default::default()),
3325 immovable: Immovable(false),
3326 description: Description(Default::default()),
3327 }
3328 }
3329}
3330
3331#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3333pub struct PlayerAbsorption(pub f32);
3334#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3336pub struct Score(pub i32);
3337#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3339pub struct ShoulderParrotLeft(pub OptionalUnsignedInt);
3340#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3342pub struct ShoulderParrotRight(pub OptionalUnsignedInt);
3343#[derive(Component)]
3368pub struct Player;
3369impl Player {
3370 fn apply_metadata(
3371 entity: &mut bevy_ecs::system::EntityCommands,
3372 d: EntityDataItem,
3373 ) -> Result<(), UpdateMetadataError> {
3374 match d.index {
3375 0..=16 => AbstractAvatar::apply_metadata(entity, d)?,
3376 17 => {
3377 entity.insert(PlayerAbsorption(d.value.into_float()?));
3378 }
3379 18 => {
3380 entity.insert(Score(d.value.into_int()?));
3381 }
3382 19 => {
3383 entity.insert(ShoulderParrotLeft(d.value.into_optional_unsigned_int()?));
3384 }
3385 20 => {
3386 entity.insert(ShoulderParrotRight(d.value.into_optional_unsigned_int()?));
3387 }
3388 _ => {}
3389 }
3390 Ok(())
3391 }
3392}
3393
3394#[derive(Bundle)]
3398pub struct PlayerMetadataBundle {
3399 _marker: Player,
3400 parent: AbstractAvatarMetadataBundle,
3401 player_absorption: PlayerAbsorption,
3402 score: Score,
3403 shoulder_parrot_left: ShoulderParrotLeft,
3404 shoulder_parrot_right: ShoulderParrotRight,
3405}
3406impl Default for PlayerMetadataBundle {
3407 fn default() -> Self {
3408 Self {
3409 _marker: Player,
3410 parent: Default::default(),
3411 player_absorption: PlayerAbsorption(0.0),
3412 score: Score(0),
3413 shoulder_parrot_left: ShoulderParrotLeft(OptionalUnsignedInt(None)),
3414 shoulder_parrot_right: ShoulderParrotRight(OptionalUnsignedInt(None)),
3415 }
3416 }
3417}
3418
3419#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3420pub struct NoAi(pub bool);
3422#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3423pub struct LeftHanded(pub bool);
3425#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3426pub struct Aggressive(pub bool);
3428#[derive(Component)]
3552pub struct AbstractInsentient;
3553impl AbstractInsentient {
3554 fn apply_metadata(
3555 entity: &mut bevy_ecs::system::EntityCommands,
3556 d: EntityDataItem,
3557 ) -> Result<(), UpdateMetadataError> {
3558 match d.index {
3559 0..=14 => AbstractLiving::apply_metadata(entity, d)?,
3560 15 => {
3561 let bitfield = d.value.into_byte()?;
3562 entity.insert(NoAi(bitfield & 0x1 != 0));
3563 entity.insert(LeftHanded(bitfield & 0x2 != 0));
3564 entity.insert(Aggressive(bitfield & 0x4 != 0));
3565 }
3566 _ => {}
3567 }
3568 Ok(())
3569 }
3570}
3571
3572#[derive(Bundle)]
3576pub struct AbstractInsentientMetadataBundle {
3577 _marker: AbstractInsentient,
3578 parent: AbstractLivingMetadataBundle,
3579 no_ai: NoAi,
3580 left_handed: LeftHanded,
3581 aggressive: Aggressive,
3582}
3583impl Default for AbstractInsentientMetadataBundle {
3584 fn default() -> Self {
3585 Self {
3586 _marker: AbstractInsentient,
3587 parent: Default::default(),
3588 no_ai: NoAi(false),
3589 left_handed: LeftHanded(false),
3590 aggressive: Aggressive(false),
3591 }
3592 }
3593}
3594
3595#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3596pub struct Resting(pub bool);
3598#[derive(Component)]
3620pub struct Bat;
3621impl Bat {
3622 fn apply_metadata(
3623 entity: &mut bevy_ecs::system::EntityCommands,
3624 d: EntityDataItem,
3625 ) -> Result<(), UpdateMetadataError> {
3626 match d.index {
3627 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
3628 16 => {
3629 let bitfield = d.value.into_byte()?;
3630 entity.insert(Resting(bitfield & 0x1 != 0));
3631 }
3632 _ => {}
3633 }
3634 Ok(())
3635 }
3636}
3637
3638#[derive(Bundle)]
3642pub struct BatMetadataBundle {
3643 _marker: Bat,
3644 parent: AbstractInsentientMetadataBundle,
3645 resting: Resting,
3646}
3647impl Default for BatMetadataBundle {
3648 fn default() -> Self {
3649 Self {
3650 _marker: Bat,
3651 parent: Default::default(),
3652 resting: Resting(false),
3653 }
3654 }
3655}
3656
3657#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3659pub struct Phase(pub i32);
3660#[derive(Component)]
3683pub struct EnderDragon;
3684impl EnderDragon {
3685 fn apply_metadata(
3686 entity: &mut bevy_ecs::system::EntityCommands,
3687 d: EntityDataItem,
3688 ) -> Result<(), UpdateMetadataError> {
3689 match d.index {
3690 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
3691 16 => {
3692 entity.insert(Phase(d.value.into_int()?));
3693 }
3694 _ => {}
3695 }
3696 Ok(())
3697 }
3698}
3699
3700#[derive(Bundle)]
3704pub struct EnderDragonMetadataBundle {
3705 _marker: EnderDragon,
3706 parent: AbstractInsentientMetadataBundle,
3707 phase: Phase,
3708}
3709impl Default for EnderDragonMetadataBundle {
3710 fn default() -> Self {
3711 Self {
3712 _marker: EnderDragon,
3713 parent: Default::default(),
3714 phase: Phase(Default::default()),
3715 }
3716 }
3717}
3718
3719#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3721pub struct IsCharging(pub bool);
3722#[derive(Component)]
3744pub struct Ghast;
3745impl Ghast {
3746 fn apply_metadata(
3747 entity: &mut bevy_ecs::system::EntityCommands,
3748 d: EntityDataItem,
3749 ) -> Result<(), UpdateMetadataError> {
3750 match d.index {
3751 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
3752 16 => {
3753 entity.insert(IsCharging(d.value.into_boolean()?));
3754 }
3755 _ => {}
3756 }
3757 Ok(())
3758 }
3759}
3760
3761#[derive(Bundle)]
3765pub struct GhastMetadataBundle {
3766 _marker: Ghast,
3767 parent: AbstractInsentientMetadataBundle,
3768 is_charging: IsCharging,
3769}
3770impl Default for GhastMetadataBundle {
3771 fn default() -> Self {
3772 Self {
3773 _marker: Ghast,
3774 parent: Default::default(),
3775 is_charging: IsCharging(false),
3776 }
3777 }
3778}
3779
3780#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3782pub struct PhantomSize(pub i32);
3783#[derive(Component)]
3805pub struct Phantom;
3806impl Phantom {
3807 fn apply_metadata(
3808 entity: &mut bevy_ecs::system::EntityCommands,
3809 d: EntityDataItem,
3810 ) -> Result<(), UpdateMetadataError> {
3811 match d.index {
3812 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
3813 16 => {
3814 entity.insert(PhantomSize(d.value.into_int()?));
3815 }
3816 _ => {}
3817 }
3818 Ok(())
3819 }
3820}
3821
3822#[derive(Bundle)]
3826pub struct PhantomMetadataBundle {
3827 _marker: Phantom,
3828 parent: AbstractInsentientMetadataBundle,
3829 phantom_size: PhantomSize,
3830}
3831impl Default for PhantomMetadataBundle {
3832 fn default() -> Self {
3833 Self {
3834 _marker: Phantom,
3835 parent: Default::default(),
3836 phantom_size: PhantomSize(0),
3837 }
3838 }
3839}
3840
3841#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3843pub struct SlimeSize(pub i32);
3844#[derive(Component)]
3866pub struct Slime;
3867impl Slime {
3868 fn apply_metadata(
3869 entity: &mut bevy_ecs::system::EntityCommands,
3870 d: EntityDataItem,
3871 ) -> Result<(), UpdateMetadataError> {
3872 match d.index {
3873 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
3874 16 => {
3875 entity.insert(SlimeSize(d.value.into_int()?));
3876 }
3877 _ => {}
3878 }
3879 Ok(())
3880 }
3881}
3882
3883#[derive(Bundle)]
3887pub struct SlimeMetadataBundle {
3888 _marker: Slime,
3889 parent: AbstractInsentientMetadataBundle,
3890 slime_size: SlimeSize,
3891}
3892impl Default for SlimeMetadataBundle {
3893 fn default() -> Self {
3894 Self {
3895 _marker: Slime,
3896 parent: Default::default(),
3897 slime_size: SlimeSize(1),
3898 }
3899 }
3900}
3901
3902#[derive(Component)]
3923pub struct MagmaCube;
3924impl MagmaCube {
3925 fn apply_metadata(
3926 entity: &mut bevy_ecs::system::EntityCommands,
3927 d: EntityDataItem,
3928 ) -> Result<(), UpdateMetadataError> {
3929 match d.index {
3930 0..=16 => Slime::apply_metadata(entity, d)?,
3931 _ => {}
3932 }
3933 Ok(())
3934 }
3935}
3936
3937#[derive(Bundle)]
3941pub struct MagmaCubeMetadataBundle {
3942 _marker: MagmaCube,
3943 parent: SlimeMetadataBundle,
3944}
3945impl Default for MagmaCubeMetadataBundle {
3946 fn default() -> Self {
3947 Self {
3948 _marker: MagmaCube,
3949 parent: Default::default(),
3950 }
3951 }
3952}
3953
3954#[derive(Component)]
4067pub struct AbstractCreature;
4068impl AbstractCreature {
4069 fn apply_metadata(
4070 entity: &mut bevy_ecs::system::EntityCommands,
4071 d: EntityDataItem,
4072 ) -> Result<(), UpdateMetadataError> {
4073 match d.index {
4074 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
4075 _ => {}
4076 }
4077 Ok(())
4078 }
4079}
4080
4081#[derive(Bundle)]
4085pub struct AbstractCreatureMetadataBundle {
4086 _marker: AbstractCreature,
4087 parent: AbstractInsentientMetadataBundle,
4088}
4089impl Default for AbstractCreatureMetadataBundle {
4090 fn default() -> Self {
4091 Self {
4092 _marker: AbstractCreature,
4093 parent: Default::default(),
4094 }
4095 }
4096}
4097
4098#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4100pub struct Dancing(pub bool);
4101#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4103pub struct CanDuplicate(pub bool);
4104#[derive(Component)]
4128pub struct Allay;
4129impl Allay {
4130 fn apply_metadata(
4131 entity: &mut bevy_ecs::system::EntityCommands,
4132 d: EntityDataItem,
4133 ) -> Result<(), UpdateMetadataError> {
4134 match d.index {
4135 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4136 16 => {
4137 entity.insert(Dancing(d.value.into_boolean()?));
4138 }
4139 17 => {
4140 entity.insert(CanDuplicate(d.value.into_boolean()?));
4141 }
4142 _ => {}
4143 }
4144 Ok(())
4145 }
4146}
4147
4148#[derive(Bundle)]
4152pub struct AllayMetadataBundle {
4153 _marker: Allay,
4154 parent: AbstractCreatureMetadataBundle,
4155 dancing: Dancing,
4156 can_duplicate: CanDuplicate,
4157}
4158impl Default for AllayMetadataBundle {
4159 fn default() -> Self {
4160 Self {
4161 _marker: Allay,
4162 parent: Default::default(),
4163 dancing: Dancing(false),
4164 can_duplicate: CanDuplicate(true),
4165 }
4166 }
4167}
4168
4169#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4171pub struct WeatherState(pub WeatheringCopperStateKind);
4172#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4174pub struct CopperGolemState(pub CopperGolemStateKind);
4175#[derive(Component)]
4200pub struct CopperGolem;
4201impl CopperGolem {
4202 fn apply_metadata(
4203 entity: &mut bevy_ecs::system::EntityCommands,
4204 d: EntityDataItem,
4205 ) -> Result<(), UpdateMetadataError> {
4206 match d.index {
4207 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4208 16 => {
4209 entity.insert(WeatherState(d.value.into_weathering_copper_state()?));
4210 }
4211 17 => {
4212 entity.insert(CopperGolemState(d.value.into_copper_golem_state()?));
4213 }
4214 _ => {}
4215 }
4216 Ok(())
4217 }
4218}
4219
4220#[derive(Bundle)]
4224pub struct CopperGolemMetadataBundle {
4225 _marker: CopperGolem,
4226 parent: AbstractCreatureMetadataBundle,
4227 weather_state: WeatherState,
4228 copper_golem_state: CopperGolemState,
4229}
4230impl Default for CopperGolemMetadataBundle {
4231 fn default() -> Self {
4232 Self {
4233 _marker: CopperGolem,
4234 parent: Default::default(),
4235 weather_state: WeatherState(Default::default()),
4236 copper_golem_state: CopperGolemState(Default::default()),
4237 }
4238 }
4239}
4240
4241#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
4242pub struct PlayerCreated(pub bool);
4244#[derive(Component)]
4268pub struct IronGolem;
4269impl IronGolem {
4270 fn apply_metadata(
4271 entity: &mut bevy_ecs::system::EntityCommands,
4272 d: EntityDataItem,
4273 ) -> Result<(), UpdateMetadataError> {
4274 match d.index {
4275 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4276 16 => {
4277 let bitfield = d.value.into_byte()?;
4278 entity.insert(PlayerCreated(bitfield & 0x1 != 0));
4279 }
4280 _ => {}
4281 }
4282 Ok(())
4283 }
4284}
4285
4286#[derive(Bundle)]
4290pub struct IronGolemMetadataBundle {
4291 _marker: IronGolem,
4292 parent: AbstractCreatureMetadataBundle,
4293 player_created: PlayerCreated,
4294}
4295impl Default for IronGolemMetadataBundle {
4296 fn default() -> Self {
4297 Self {
4298 _marker: IronGolem,
4299 parent: Default::default(),
4300 player_created: PlayerCreated(false),
4301 }
4302 }
4303}
4304
4305#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4307pub struct PufferfishFromBucket(pub bool);
4308#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4310pub struct PuffState(pub i32);
4311#[derive(Component)]
4336pub struct Pufferfish;
4337impl Pufferfish {
4338 fn apply_metadata(
4339 entity: &mut bevy_ecs::system::EntityCommands,
4340 d: EntityDataItem,
4341 ) -> Result<(), UpdateMetadataError> {
4342 match d.index {
4343 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4344 16 => {
4345 entity.insert(PufferfishFromBucket(d.value.into_boolean()?));
4346 }
4347 17 => {
4348 entity.insert(PuffState(d.value.into_int()?));
4349 }
4350 _ => {}
4351 }
4352 Ok(())
4353 }
4354}
4355
4356#[derive(Bundle)]
4360pub struct PufferfishMetadataBundle {
4361 _marker: Pufferfish,
4362 parent: AbstractCreatureMetadataBundle,
4363 pufferfish_from_bucket: PufferfishFromBucket,
4364 puff_state: PuffState,
4365}
4366impl Default for PufferfishMetadataBundle {
4367 fn default() -> Self {
4368 Self {
4369 _marker: Pufferfish,
4370 parent: Default::default(),
4371 pufferfish_from_bucket: PufferfishFromBucket(false),
4372 puff_state: PuffState(0),
4373 }
4374 }
4375}
4376
4377#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4379pub struct AttachFace(pub Direction);
4380#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4382pub struct Peek(pub u8);
4383#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4385pub struct Color(pub u8);
4386#[derive(Component)]
4411pub struct Shulker;
4412impl Shulker {
4413 fn apply_metadata(
4414 entity: &mut bevy_ecs::system::EntityCommands,
4415 d: EntityDataItem,
4416 ) -> Result<(), UpdateMetadataError> {
4417 match d.index {
4418 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4419 16 => {
4420 entity.insert(AttachFace(d.value.into_direction()?));
4421 }
4422 17 => {
4423 entity.insert(Peek(d.value.into_byte()?));
4424 }
4425 18 => {
4426 entity.insert(Color(d.value.into_byte()?));
4427 }
4428 _ => {}
4429 }
4430 Ok(())
4431 }
4432}
4433
4434#[derive(Bundle)]
4438pub struct ShulkerMetadataBundle {
4439 _marker: Shulker,
4440 parent: AbstractCreatureMetadataBundle,
4441 attach_face: AttachFace,
4442 peek: Peek,
4443 color: Color,
4444}
4445impl Default for ShulkerMetadataBundle {
4446 fn default() -> Self {
4447 Self {
4448 _marker: Shulker,
4449 parent: Default::default(),
4450 attach_face: AttachFace(Default::default()),
4451 peek: Peek(0),
4452 color: Color(16),
4453 }
4454 }
4455}
4456
4457#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
4458pub struct HasPumpkin(pub bool);
4460#[derive(Component)]
4484pub struct SnowGolem;
4485impl SnowGolem {
4486 fn apply_metadata(
4487 entity: &mut bevy_ecs::system::EntityCommands,
4488 d: EntityDataItem,
4489 ) -> Result<(), UpdateMetadataError> {
4490 match d.index {
4491 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4492 16 => {
4493 let bitfield = d.value.into_byte()?;
4494 entity.insert(HasPumpkin(bitfield & 0x10 != 0));
4495 }
4496 _ => {}
4497 }
4498 Ok(())
4499 }
4500}
4501
4502#[derive(Bundle)]
4506pub struct SnowGolemMetadataBundle {
4507 _marker: SnowGolem,
4508 parent: AbstractCreatureMetadataBundle,
4509 has_pumpkin: HasPumpkin,
4510}
4511impl Default for SnowGolemMetadataBundle {
4512 fn default() -> Self {
4513 Self {
4514 _marker: SnowGolem,
4515 parent: Default::default(),
4516 has_pumpkin: HasPumpkin(true),
4517 }
4518 }
4519}
4520
4521#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4523pub struct TadpoleFromBucket(pub bool);
4524#[derive(Component)]
4547pub struct Tadpole;
4548impl Tadpole {
4549 fn apply_metadata(
4550 entity: &mut bevy_ecs::system::EntityCommands,
4551 d: EntityDataItem,
4552 ) -> Result<(), UpdateMetadataError> {
4553 match d.index {
4554 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4555 16 => {
4556 entity.insert(TadpoleFromBucket(d.value.into_boolean()?));
4557 }
4558 _ => {}
4559 }
4560 Ok(())
4561 }
4562}
4563
4564#[derive(Bundle)]
4568pub struct TadpoleMetadataBundle {
4569 _marker: Tadpole,
4570 parent: AbstractCreatureMetadataBundle,
4571 tadpole_from_bucket: TadpoleFromBucket,
4572}
4573impl Default for TadpoleMetadataBundle {
4574 fn default() -> Self {
4575 Self {
4576 _marker: Tadpole,
4577 parent: Default::default(),
4578 tadpole_from_bucket: TadpoleFromBucket(false),
4579 }
4580 }
4581}
4582
4583#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4585pub struct AbstractAgeableBaby(pub bool);
4586#[derive(Component)]
4653pub struct AbstractAgeable;
4654impl AbstractAgeable {
4655 fn apply_metadata(
4656 entity: &mut bevy_ecs::system::EntityCommands,
4657 d: EntityDataItem,
4658 ) -> Result<(), UpdateMetadataError> {
4659 match d.index {
4660 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4661 16 => {
4662 entity.insert(AbstractAgeableBaby(d.value.into_boolean()?));
4663 }
4664 _ => {}
4665 }
4666 Ok(())
4667 }
4668}
4669
4670#[derive(Bundle)]
4674pub struct AbstractAgeableMetadataBundle {
4675 _marker: AbstractAgeable,
4676 parent: AbstractCreatureMetadataBundle,
4677 abstract_ageable_baby: AbstractAgeableBaby,
4678}
4679impl Default for AbstractAgeableMetadataBundle {
4680 fn default() -> Self {
4681 Self {
4682 _marker: AbstractAgeable,
4683 parent: Default::default(),
4684 abstract_ageable_baby: AbstractAgeableBaby(false),
4685 }
4686 }
4687}
4688
4689#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4691pub struct GotFish(pub bool);
4692#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4694pub struct MoistnessLevel(pub i32);
4695#[derive(Component)]
4720pub struct Dolphin;
4721impl Dolphin {
4722 fn apply_metadata(
4723 entity: &mut bevy_ecs::system::EntityCommands,
4724 d: EntityDataItem,
4725 ) -> Result<(), UpdateMetadataError> {
4726 match d.index {
4727 0..=16 => AbstractAgeable::apply_metadata(entity, d)?,
4728 17 => {
4729 entity.insert(GotFish(d.value.into_boolean()?));
4730 }
4731 18 => {
4732 entity.insert(MoistnessLevel(d.value.into_int()?));
4733 }
4734 _ => {}
4735 }
4736 Ok(())
4737 }
4738}
4739
4740#[derive(Bundle)]
4744pub struct DolphinMetadataBundle {
4745 _marker: Dolphin,
4746 parent: AbstractAgeableMetadataBundle,
4747 got_fish: GotFish,
4748 moistness_level: MoistnessLevel,
4749}
4750impl Default for DolphinMetadataBundle {
4751 fn default() -> Self {
4752 Self {
4753 _marker: Dolphin,
4754 parent: Default::default(),
4755 got_fish: GotFish(false),
4756 moistness_level: MoistnessLevel(2400),
4757 }
4758 }
4759}
4760
4761#[derive(Component)]
4783pub struct Squid;
4784impl Squid {
4785 fn apply_metadata(
4786 entity: &mut bevy_ecs::system::EntityCommands,
4787 d: EntityDataItem,
4788 ) -> Result<(), UpdateMetadataError> {
4789 match d.index {
4790 0..=16 => AbstractAgeable::apply_metadata(entity, d)?,
4791 _ => {}
4792 }
4793 Ok(())
4794 }
4795}
4796
4797#[derive(Bundle)]
4801pub struct SquidMetadataBundle {
4802 _marker: Squid,
4803 parent: AbstractAgeableMetadataBundle,
4804}
4805impl Default for SquidMetadataBundle {
4806 fn default() -> Self {
4807 Self {
4808 _marker: Squid,
4809 parent: Default::default(),
4810 }
4811 }
4812}
4813
4814#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4816pub struct DarkTicksRemaining(pub i32);
4817#[derive(Component)]
4843pub struct GlowSquid;
4844impl GlowSquid {
4845 fn apply_metadata(
4846 entity: &mut bevy_ecs::system::EntityCommands,
4847 d: EntityDataItem,
4848 ) -> Result<(), UpdateMetadataError> {
4849 match d.index {
4850 0..=16 => Squid::apply_metadata(entity, d)?,
4851 17 => {
4852 entity.insert(DarkTicksRemaining(d.value.into_int()?));
4853 }
4854 _ => {}
4855 }
4856 Ok(())
4857 }
4858}
4859
4860#[derive(Bundle)]
4864pub struct GlowSquidMetadataBundle {
4865 _marker: GlowSquid,
4866 parent: SquidMetadataBundle,
4867 dark_ticks_remaining: DarkTicksRemaining,
4868}
4869impl Default for GlowSquidMetadataBundle {
4870 fn default() -> Self {
4871 Self {
4872 _marker: GlowSquid,
4873 parent: Default::default(),
4874 dark_ticks_remaining: DarkTicksRemaining(0),
4875 }
4876 }
4877}
4878
4879#[derive(Component)]
4937pub struct AbstractAnimal;
4938impl AbstractAnimal {
4939 fn apply_metadata(
4940 entity: &mut bevy_ecs::system::EntityCommands,
4941 d: EntityDataItem,
4942 ) -> Result<(), UpdateMetadataError> {
4943 match d.index {
4944 0..=16 => AbstractAgeable::apply_metadata(entity, d)?,
4945 _ => {}
4946 }
4947 Ok(())
4948 }
4949}
4950
4951#[derive(Bundle)]
4955pub struct AbstractAnimalMetadataBundle {
4956 _marker: AbstractAnimal,
4957 parent: AbstractAgeableMetadataBundle,
4958}
4959impl Default for AbstractAnimalMetadataBundle {
4960 fn default() -> Self {
4961 Self {
4962 _marker: AbstractAnimal,
4963 parent: Default::default(),
4964 }
4965 }
4966}
4967
4968#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4970pub struct ArmadilloState(pub ArmadilloStateKind);
4971#[derive(Component)]
4997pub struct Armadillo;
4998impl Armadillo {
4999 fn apply_metadata(
5000 entity: &mut bevy_ecs::system::EntityCommands,
5001 d: EntityDataItem,
5002 ) -> Result<(), UpdateMetadataError> {
5003 match d.index {
5004 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
5005 17 => {
5006 entity.insert(ArmadilloState(d.value.into_armadillo_state()?));
5007 }
5008 _ => {}
5009 }
5010 Ok(())
5011 }
5012}
5013
5014#[derive(Bundle)]
5018pub struct ArmadilloMetadataBundle {
5019 _marker: Armadillo,
5020 parent: AbstractAnimalMetadataBundle,
5021 armadillo_state: ArmadilloState,
5022}
5023impl Default for ArmadilloMetadataBundle {
5024 fn default() -> Self {
5025 Self {
5026 _marker: Armadillo,
5027 parent: Default::default(),
5028 armadillo_state: ArmadilloState(Default::default()),
5029 }
5030 }
5031}
5032
5033#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5035pub struct AxolotlVariant(pub i32);
5036#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5038pub struct PlayingDead(pub bool);
5039#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5041pub struct AxolotlFromBucket(pub bool);
5042#[derive(Component)]
5069pub struct Axolotl;
5070impl Axolotl {
5071 fn apply_metadata(
5072 entity: &mut bevy_ecs::system::EntityCommands,
5073 d: EntityDataItem,
5074 ) -> Result<(), UpdateMetadataError> {
5075 match d.index {
5076 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
5077 17 => {
5078 entity.insert(AxolotlVariant(d.value.into_int()?));
5079 }
5080 18 => {
5081 entity.insert(PlayingDead(d.value.into_boolean()?));
5082 }
5083 19 => {
5084 entity.insert(AxolotlFromBucket(d.value.into_boolean()?));
5085 }
5086 _ => {}
5087 }
5088 Ok(())
5089 }
5090}
5091
5092#[derive(Bundle)]
5096pub struct AxolotlMetadataBundle {
5097 _marker: Axolotl,
5098 parent: AbstractAnimalMetadataBundle,
5099 axolotl_variant: AxolotlVariant,
5100 playing_dead: PlayingDead,
5101 axolotl_from_bucket: AxolotlFromBucket,
5102}
5103impl Default for AxolotlMetadataBundle {
5104 fn default() -> Self {
5105 Self {
5106 _marker: Axolotl,
5107 parent: Default::default(),
5108 axolotl_variant: AxolotlVariant(0),
5109 playing_dead: PlayingDead(false),
5110 axolotl_from_bucket: AxolotlFromBucket(false),
5111 }
5112 }
5113}
5114
5115#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5116pub struct HasNectar(pub bool);
5118#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5119pub struct HasStung(pub bool);
5121#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5122pub struct BeeRolling(pub bool);
5124#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5126pub struct BeeAngerEndTime(pub i64);
5127#[derive(Component)]
5155pub struct Bee;
5156impl Bee {
5157 fn apply_metadata(
5158 entity: &mut bevy_ecs::system::EntityCommands,
5159 d: EntityDataItem,
5160 ) -> Result<(), UpdateMetadataError> {
5161 match d.index {
5162 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
5163 17 => {
5164 let bitfield = d.value.into_byte()?;
5165 entity.insert(HasNectar(bitfield & 0x8 != 0));
5166 entity.insert(HasStung(bitfield & 0x4 != 0));
5167 entity.insert(BeeRolling(bitfield & 0x2 != 0));
5168 }
5169 18 => {
5170 entity.insert(BeeAngerEndTime(d.value.into_long()?));
5171 }
5172 _ => {}
5173 }
5174 Ok(())
5175 }
5176}
5177
5178#[derive(Bundle)]
5182pub struct BeeMetadataBundle {
5183 _marker: Bee,
5184 parent: AbstractAnimalMetadataBundle,
5185 has_nectar: HasNectar,
5186 has_stung: HasStung,
5187 bee_rolling: BeeRolling,
5188 bee_anger_end_time: BeeAngerEndTime,
5189}
5190impl Default for BeeMetadataBundle {
5191 fn default() -> Self {
5192 Self {
5193 _marker: Bee,
5194 parent: Default::default(),
5195 has_nectar: HasNectar(false),
5196 has_stung: HasStung(false),
5197 bee_rolling: BeeRolling(false),
5198 bee_anger_end_time: BeeAngerEndTime(-1),
5199 }
5200 }
5201}
5202
5203#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5205pub struct ChickenVariant(pub azalea_registry::data::ChickenVariant);
5206#[derive(Component)]
5231pub struct Chicken;
5232impl Chicken {
5233 fn apply_metadata(
5234 entity: &mut bevy_ecs::system::EntityCommands,
5235 d: EntityDataItem,
5236 ) -> Result<(), UpdateMetadataError> {
5237 match d.index {
5238 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
5239 17 => {
5240 entity.insert(ChickenVariant(d.value.into_chicken_variant()?));
5241 }
5242 _ => {}
5243 }
5244 Ok(())
5245 }
5246}
5247
5248#[derive(Bundle)]
5252pub struct ChickenMetadataBundle {
5253 _marker: Chicken,
5254 parent: AbstractAnimalMetadataBundle,
5255 chicken_variant: ChickenVariant,
5256}
5257impl Default for ChickenMetadataBundle {
5258 fn default() -> Self {
5259 Self {
5260 _marker: Chicken,
5261 parent: Default::default(),
5262 chicken_variant: ChickenVariant(azalea_registry::data::ChickenVariant::new_raw(0)),
5263 }
5264 }
5265}
5266
5267#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5269pub struct CowVariant(pub azalea_registry::data::CowVariant);
5270#[derive(Component)]
5295pub struct Cow;
5296impl Cow {
5297 fn apply_metadata(
5298 entity: &mut bevy_ecs::system::EntityCommands,
5299 d: EntityDataItem,
5300 ) -> Result<(), UpdateMetadataError> {
5301 match d.index {
5302 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
5303 17 => {
5304 entity.insert(CowVariant(d.value.into_cow_variant()?));
5305 }
5306 _ => {}
5307 }
5308 Ok(())
5309 }
5310}
5311
5312#[derive(Bundle)]
5316pub struct CowMetadataBundle {
5317 _marker: Cow,
5318 parent: AbstractAnimalMetadataBundle,
5319 cow_variant: CowVariant,
5320}
5321impl Default for CowMetadataBundle {
5322 fn default() -> Self {
5323 Self {
5324 _marker: Cow,
5325 parent: Default::default(),
5326 cow_variant: CowVariant(azalea_registry::data::CowVariant::new_raw(0)),
5327 }
5328 }
5329}
5330
5331#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5333pub struct FoxKind(pub i32);
5334#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5335pub struct FoxSitting(pub bool);
5337#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5338pub struct Faceplanted(pub bool);
5340#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5341pub struct Defending(pub bool);
5343#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5344pub struct Sleeping(pub bool);
5346#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5347pub struct Pouncing(pub bool);
5349#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5350pub struct FoxCrouching(pub bool);
5352#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5353pub struct FoxInterested(pub bool);
5355#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5357pub struct TrustedId0(pub Option<Uuid>);
5358#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5360pub struct TrustedId1(pub Option<Uuid>);
5361#[derive(Component)]
5395pub struct Fox;
5396impl Fox {
5397 fn apply_metadata(
5398 entity: &mut bevy_ecs::system::EntityCommands,
5399 d: EntityDataItem,
5400 ) -> Result<(), UpdateMetadataError> {
5401 match d.index {
5402 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
5403 17 => {
5404 entity.insert(FoxKind(d.value.into_int()?));
5405 }
5406 18 => {
5407 let bitfield = d.value.into_byte()?;
5408 entity.insert(FoxSitting(bitfield & 0x1 != 0));
5409 entity.insert(Faceplanted(bitfield & 0x40 != 0));
5410 entity.insert(Defending(bitfield & 0x80 != 0));
5411 entity.insert(Sleeping(bitfield & 0x20 != 0));
5412 entity.insert(Pouncing(bitfield & 0x10 != 0));
5413 entity.insert(FoxCrouching(bitfield & 0x4 != 0));
5414 entity.insert(FoxInterested(bitfield & 0x8 != 0));
5415 }
5416 19 => {
5417 entity.insert(TrustedId0(d.value.into_optional_living_entity_reference()?));
5418 }
5419 20 => {
5420 entity.insert(TrustedId1(d.value.into_optional_living_entity_reference()?));
5421 }
5422 _ => {}
5423 }
5424 Ok(())
5425 }
5426}
5427
5428#[derive(Bundle)]
5432pub struct FoxMetadataBundle {
5433 _marker: Fox,
5434 parent: AbstractAnimalMetadataBundle,
5435 fox_kind: FoxKind,
5436 fox_sitting: FoxSitting,
5437 faceplanted: Faceplanted,
5438 defending: Defending,
5439 sleeping: Sleeping,
5440 pouncing: Pouncing,
5441 fox_crouching: FoxCrouching,
5442 fox_interested: FoxInterested,
5443 trusted_id_0: TrustedId0,
5444 trusted_id_1: TrustedId1,
5445}
5446impl Default for FoxMetadataBundle {
5447 fn default() -> Self {
5448 Self {
5449 _marker: Fox,
5450 parent: Default::default(),
5451 fox_kind: FoxKind(Default::default()),
5452 fox_sitting: FoxSitting(false),
5453 faceplanted: Faceplanted(false),
5454 defending: Defending(false),
5455 sleeping: Sleeping(false),
5456 pouncing: Pouncing(false),
5457 fox_crouching: FoxCrouching(false),
5458 fox_interested: FoxInterested(false),
5459 trusted_id_0: TrustedId0(None),
5460 trusted_id_1: TrustedId1(None),
5461 }
5462 }
5463}
5464
5465#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5467pub struct FrogVariant(pub azalea_registry::data::FrogVariant);
5468#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5470pub struct TongueTarget(pub OptionalUnsignedInt);
5471#[derive(Component)]
5497pub struct Frog;
5498impl Frog {
5499 fn apply_metadata(
5500 entity: &mut bevy_ecs::system::EntityCommands,
5501 d: EntityDataItem,
5502 ) -> Result<(), UpdateMetadataError> {
5503 match d.index {
5504 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
5505 17 => {
5506 entity.insert(FrogVariant(d.value.into_frog_variant()?));
5507 }
5508 18 => {
5509 entity.insert(TongueTarget(d.value.into_optional_unsigned_int()?));
5510 }
5511 _ => {}
5512 }
5513 Ok(())
5514 }
5515}
5516
5517#[derive(Bundle)]
5521pub struct FrogMetadataBundle {
5522 _marker: Frog,
5523 parent: AbstractAnimalMetadataBundle,
5524 frog_variant: FrogVariant,
5525 tongue_target: TongueTarget,
5526}
5527impl Default for FrogMetadataBundle {
5528 fn default() -> Self {
5529 Self {
5530 _marker: Frog,
5531 parent: Default::default(),
5532 frog_variant: FrogVariant(azalea_registry::data::FrogVariant::new_raw(0)),
5533 tongue_target: TongueTarget(OptionalUnsignedInt(None)),
5534 }
5535 }
5536}
5537
5538#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5540pub struct IsScreamingGoat(pub bool);
5541#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5543pub struct HasLeftHorn(pub bool);
5544#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5546pub struct HasRightHorn(pub bool);
5547#[derive(Component)]
5574pub struct Goat;
5575impl Goat {
5576 fn apply_metadata(
5577 entity: &mut bevy_ecs::system::EntityCommands,
5578 d: EntityDataItem,
5579 ) -> Result<(), UpdateMetadataError> {
5580 match d.index {
5581 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
5582 17 => {
5583 entity.insert(IsScreamingGoat(d.value.into_boolean()?));
5584 }
5585 18 => {
5586 entity.insert(HasLeftHorn(d.value.into_boolean()?));
5587 }
5588 19 => {
5589 entity.insert(HasRightHorn(d.value.into_boolean()?));
5590 }
5591 _ => {}
5592 }
5593 Ok(())
5594 }
5595}
5596
5597#[derive(Bundle)]
5601pub struct GoatMetadataBundle {
5602 _marker: Goat,
5603 parent: AbstractAnimalMetadataBundle,
5604 is_screaming_goat: IsScreamingGoat,
5605 has_left_horn: HasLeftHorn,
5606 has_right_horn: HasRightHorn,
5607}
5608impl Default for GoatMetadataBundle {
5609 fn default() -> Self {
5610 Self {
5611 _marker: Goat,
5612 parent: Default::default(),
5613 is_screaming_goat: IsScreamingGoat(false),
5614 has_left_horn: HasLeftHorn(true),
5615 has_right_horn: HasRightHorn(true),
5616 }
5617 }
5618}
5619
5620#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5622pub struct IsLeashHolder(pub bool);
5623#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5625pub struct StaysStill(pub bool);
5626#[derive(Component)]
5653pub struct HappyGhast;
5654impl HappyGhast {
5655 fn apply_metadata(
5656 entity: &mut bevy_ecs::system::EntityCommands,
5657 d: EntityDataItem,
5658 ) -> Result<(), UpdateMetadataError> {
5659 match d.index {
5660 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
5661 17 => {
5662 entity.insert(IsLeashHolder(d.value.into_boolean()?));
5663 }
5664 18 => {
5665 entity.insert(StaysStill(d.value.into_boolean()?));
5666 }
5667 _ => {}
5668 }
5669 Ok(())
5670 }
5671}
5672
5673#[derive(Bundle)]
5677pub struct HappyGhastMetadataBundle {
5678 _marker: HappyGhast,
5679 parent: AbstractAnimalMetadataBundle,
5680 is_leash_holder: IsLeashHolder,
5681 stays_still: StaysStill,
5682}
5683impl Default for HappyGhastMetadataBundle {
5684 fn default() -> Self {
5685 Self {
5686 _marker: HappyGhast,
5687 parent: Default::default(),
5688 is_leash_holder: IsLeashHolder(false),
5689 stays_still: StaysStill(false),
5690 }
5691 }
5692}
5693
5694#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5696pub struct HoglinImmuneToZombification(pub bool);
5697#[derive(Component)]
5722pub struct Hoglin;
5723impl Hoglin {
5724 fn apply_metadata(
5725 entity: &mut bevy_ecs::system::EntityCommands,
5726 d: EntityDataItem,
5727 ) -> Result<(), UpdateMetadataError> {
5728 match d.index {
5729 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
5730 17 => {
5731 entity.insert(HoglinImmuneToZombification(d.value.into_boolean()?));
5732 }
5733 _ => {}
5734 }
5735 Ok(())
5736 }
5737}
5738
5739#[derive(Bundle)]
5743pub struct HoglinMetadataBundle {
5744 _marker: Hoglin,
5745 parent: AbstractAnimalMetadataBundle,
5746 hoglin_immune_to_zombification: HoglinImmuneToZombification,
5747}
5748impl Default for HoglinMetadataBundle {
5749 fn default() -> Self {
5750 Self {
5751 _marker: Hoglin,
5752 parent: Default::default(),
5753 hoglin_immune_to_zombification: HoglinImmuneToZombification(false),
5754 }
5755 }
5756}
5757
5758#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5760pub struct MooshroomKind(pub i32);
5761#[derive(Component)]
5787pub struct Mooshroom;
5788impl Mooshroom {
5789 fn apply_metadata(
5790 entity: &mut bevy_ecs::system::EntityCommands,
5791 d: EntityDataItem,
5792 ) -> Result<(), UpdateMetadataError> {
5793 match d.index {
5794 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
5795 17 => {
5796 entity.insert(MooshroomKind(d.value.into_int()?));
5797 }
5798 _ => {}
5799 }
5800 Ok(())
5801 }
5802}
5803
5804#[derive(Bundle)]
5808pub struct MooshroomMetadataBundle {
5809 _marker: Mooshroom,
5810 parent: AbstractAnimalMetadataBundle,
5811 mooshroom_kind: MooshroomKind,
5812}
5813impl Default for MooshroomMetadataBundle {
5814 fn default() -> Self {
5815 Self {
5816 _marker: Mooshroom,
5817 parent: Default::default(),
5818 mooshroom_kind: MooshroomKind(Default::default()),
5819 }
5820 }
5821}
5822
5823#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5825pub struct Trusting(pub bool);
5826#[derive(Component)]
5851pub struct Ocelot;
5852impl Ocelot {
5853 fn apply_metadata(
5854 entity: &mut bevy_ecs::system::EntityCommands,
5855 d: EntityDataItem,
5856 ) -> Result<(), UpdateMetadataError> {
5857 match d.index {
5858 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
5859 17 => {
5860 entity.insert(Trusting(d.value.into_boolean()?));
5861 }
5862 _ => {}
5863 }
5864 Ok(())
5865 }
5866}
5867
5868#[derive(Bundle)]
5872pub struct OcelotMetadataBundle {
5873 _marker: Ocelot,
5874 parent: AbstractAnimalMetadataBundle,
5875 trusting: Trusting,
5876}
5877impl Default for OcelotMetadataBundle {
5878 fn default() -> Self {
5879 Self {
5880 _marker: Ocelot,
5881 parent: Default::default(),
5882 trusting: Trusting(false),
5883 }
5884 }
5885}
5886
5887#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5889pub struct PandaUnhappyCounter(pub i32);
5890#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5892pub struct SneezeCounter(pub i32);
5893#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5895pub struct EatCounter(pub i32);
5896#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5897pub struct Sneezing(pub bool);
5899#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5900pub struct PandaSitting(pub bool);
5902#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5903pub struct OnBack(pub bool);
5905#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5906pub struct PandaRolling(pub bool);
5908#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5910pub struct HiddenGene(pub u8);
5911#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5913pub struct PandaFlags(pub u8);
5914#[derive(Component)]
5947pub struct Panda;
5948impl Panda {
5949 fn apply_metadata(
5950 entity: &mut bevy_ecs::system::EntityCommands,
5951 d: EntityDataItem,
5952 ) -> Result<(), UpdateMetadataError> {
5953 match d.index {
5954 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
5955 17 => {
5956 entity.insert(PandaUnhappyCounter(d.value.into_int()?));
5957 }
5958 18 => {
5959 entity.insert(SneezeCounter(d.value.into_int()?));
5960 }
5961 19 => {
5962 entity.insert(EatCounter(d.value.into_int()?));
5963 }
5964 20 => {
5965 let bitfield = d.value.into_byte()?;
5966 entity.insert(Sneezing(bitfield & 0x2 != 0));
5967 entity.insert(PandaSitting(bitfield & 0x8 != 0));
5968 entity.insert(OnBack(bitfield & 0x10 != 0));
5969 entity.insert(PandaRolling(bitfield & 0x4 != 0));
5970 }
5971 21 => {
5972 entity.insert(HiddenGene(d.value.into_byte()?));
5973 }
5974 22 => {
5975 entity.insert(PandaFlags(d.value.into_byte()?));
5976 }
5977 _ => {}
5978 }
5979 Ok(())
5980 }
5981}
5982
5983#[derive(Bundle)]
5987pub struct PandaMetadataBundle {
5988 _marker: Panda,
5989 parent: AbstractAnimalMetadataBundle,
5990 panda_unhappy_counter: PandaUnhappyCounter,
5991 sneeze_counter: SneezeCounter,
5992 eat_counter: EatCounter,
5993 sneezing: Sneezing,
5994 panda_sitting: PandaSitting,
5995 on_back: OnBack,
5996 panda_rolling: PandaRolling,
5997 hidden_gene: HiddenGene,
5998 panda_flags: PandaFlags,
5999}
6000impl Default for PandaMetadataBundle {
6001 fn default() -> Self {
6002 Self {
6003 _marker: Panda,
6004 parent: Default::default(),
6005 panda_unhappy_counter: PandaUnhappyCounter(0),
6006 sneeze_counter: SneezeCounter(0),
6007 eat_counter: EatCounter(0),
6008 sneezing: Sneezing(false),
6009 panda_sitting: PandaSitting(false),
6010 on_back: OnBack(false),
6011 panda_rolling: PandaRolling(false),
6012 hidden_gene: HiddenGene(0),
6013 panda_flags: PandaFlags(0),
6014 }
6015 }
6016}
6017
6018#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6020pub struct PigBoostTime(pub i32);
6021#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6023pub struct PigVariant(pub azalea_registry::data::PigVariant);
6024#[derive(Component)]
6050pub struct Pig;
6051impl Pig {
6052 fn apply_metadata(
6053 entity: &mut bevy_ecs::system::EntityCommands,
6054 d: EntityDataItem,
6055 ) -> Result<(), UpdateMetadataError> {
6056 match d.index {
6057 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
6058 17 => {
6059 entity.insert(PigBoostTime(d.value.into_int()?));
6060 }
6061 18 => {
6062 entity.insert(PigVariant(d.value.into_pig_variant()?));
6063 }
6064 _ => {}
6065 }
6066 Ok(())
6067 }
6068}
6069
6070#[derive(Bundle)]
6074pub struct PigMetadataBundle {
6075 _marker: Pig,
6076 parent: AbstractAnimalMetadataBundle,
6077 pig_boost_time: PigBoostTime,
6078 pig_variant: PigVariant,
6079}
6080impl Default for PigMetadataBundle {
6081 fn default() -> Self {
6082 Self {
6083 _marker: Pig,
6084 parent: Default::default(),
6085 pig_boost_time: PigBoostTime(0),
6086 pig_variant: PigVariant(azalea_registry::data::PigVariant::new_raw(0)),
6087 }
6088 }
6089}
6090
6091#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6093pub struct PolarBearStanding(pub bool);
6094#[derive(Component)]
6120pub struct PolarBear;
6121impl PolarBear {
6122 fn apply_metadata(
6123 entity: &mut bevy_ecs::system::EntityCommands,
6124 d: EntityDataItem,
6125 ) -> Result<(), UpdateMetadataError> {
6126 match d.index {
6127 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
6128 17 => {
6129 entity.insert(PolarBearStanding(d.value.into_boolean()?));
6130 }
6131 _ => {}
6132 }
6133 Ok(())
6134 }
6135}
6136
6137#[derive(Bundle)]
6141pub struct PolarBearMetadataBundle {
6142 _marker: PolarBear,
6143 parent: AbstractAnimalMetadataBundle,
6144 polar_bear_standing: PolarBearStanding,
6145}
6146impl Default for PolarBearMetadataBundle {
6147 fn default() -> Self {
6148 Self {
6149 _marker: PolarBear,
6150 parent: Default::default(),
6151 polar_bear_standing: PolarBearStanding(false),
6152 }
6153 }
6154}
6155
6156#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6158pub struct RabbitKind(pub i32);
6159#[derive(Component)]
6184pub struct Rabbit;
6185impl Rabbit {
6186 fn apply_metadata(
6187 entity: &mut bevy_ecs::system::EntityCommands,
6188 d: EntityDataItem,
6189 ) -> Result<(), UpdateMetadataError> {
6190 match d.index {
6191 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
6192 17 => {
6193 entity.insert(RabbitKind(d.value.into_int()?));
6194 }
6195 _ => {}
6196 }
6197 Ok(())
6198 }
6199}
6200
6201#[derive(Bundle)]
6205pub struct RabbitMetadataBundle {
6206 _marker: Rabbit,
6207 parent: AbstractAnimalMetadataBundle,
6208 rabbit_kind: RabbitKind,
6209}
6210impl Default for RabbitMetadataBundle {
6211 fn default() -> Self {
6212 Self {
6213 _marker: Rabbit,
6214 parent: Default::default(),
6215 rabbit_kind: RabbitKind(Default::default()),
6216 }
6217 }
6218}
6219
6220#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6221pub struct SheepSheared(pub bool);
6223#[derive(Component)]
6248pub struct Sheep;
6249impl Sheep {
6250 fn apply_metadata(
6251 entity: &mut bevy_ecs::system::EntityCommands,
6252 d: EntityDataItem,
6253 ) -> Result<(), UpdateMetadataError> {
6254 match d.index {
6255 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
6256 17 => {
6257 let bitfield = d.value.into_byte()?;
6258 entity.insert(SheepSheared(bitfield & 0x10 != 0));
6259 }
6260 _ => {}
6261 }
6262 Ok(())
6263 }
6264}
6265
6266#[derive(Bundle)]
6270pub struct SheepMetadataBundle {
6271 _marker: Sheep,
6272 parent: AbstractAnimalMetadataBundle,
6273 sheep_sheared: SheepSheared,
6274}
6275impl Default for SheepMetadataBundle {
6276 fn default() -> Self {
6277 Self {
6278 _marker: Sheep,
6279 parent: Default::default(),
6280 sheep_sheared: SheepSheared(false),
6281 }
6282 }
6283}
6284
6285#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6287pub struct SnifferState(pub SnifferStateKind);
6288#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6290pub struct DropSeedAtTick(pub i32);
6291#[derive(Component)]
6317pub struct Sniffer;
6318impl Sniffer {
6319 fn apply_metadata(
6320 entity: &mut bevy_ecs::system::EntityCommands,
6321 d: EntityDataItem,
6322 ) -> Result<(), UpdateMetadataError> {
6323 match d.index {
6324 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
6325 17 => {
6326 entity.insert(SnifferState(d.value.into_sniffer_state()?));
6327 }
6328 18 => {
6329 entity.insert(DropSeedAtTick(d.value.into_int()?));
6330 }
6331 _ => {}
6332 }
6333 Ok(())
6334 }
6335}
6336
6337#[derive(Bundle)]
6341pub struct SnifferMetadataBundle {
6342 _marker: Sniffer,
6343 parent: AbstractAnimalMetadataBundle,
6344 sniffer_state: SnifferState,
6345 drop_seed_at_tick: DropSeedAtTick,
6346}
6347impl Default for SnifferMetadataBundle {
6348 fn default() -> Self {
6349 Self {
6350 _marker: Sniffer,
6351 parent: Default::default(),
6352 sniffer_state: SnifferState(Default::default()),
6353 drop_seed_at_tick: DropSeedAtTick(0),
6354 }
6355 }
6356}
6357
6358#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6360pub struct StriderBoostTime(pub i32);
6361#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6363pub struct Suffocating(pub bool);
6364#[derive(Component)]
6390pub struct Strider;
6391impl Strider {
6392 fn apply_metadata(
6393 entity: &mut bevy_ecs::system::EntityCommands,
6394 d: EntityDataItem,
6395 ) -> Result<(), UpdateMetadataError> {
6396 match d.index {
6397 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
6398 17 => {
6399 entity.insert(StriderBoostTime(d.value.into_int()?));
6400 }
6401 18 => {
6402 entity.insert(Suffocating(d.value.into_boolean()?));
6403 }
6404 _ => {}
6405 }
6406 Ok(())
6407 }
6408}
6409
6410#[derive(Bundle)]
6414pub struct StriderMetadataBundle {
6415 _marker: Strider,
6416 parent: AbstractAnimalMetadataBundle,
6417 strider_boost_time: StriderBoostTime,
6418 suffocating: Suffocating,
6419}
6420impl Default for StriderMetadataBundle {
6421 fn default() -> Self {
6422 Self {
6423 _marker: Strider,
6424 parent: Default::default(),
6425 strider_boost_time: StriderBoostTime(0),
6426 suffocating: Suffocating(false),
6427 }
6428 }
6429}
6430
6431#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6433pub struct HasEgg(pub bool);
6434#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6436pub struct LayingEgg(pub bool);
6437#[derive(Component)]
6463pub struct Turtle;
6464impl Turtle {
6465 fn apply_metadata(
6466 entity: &mut bevy_ecs::system::EntityCommands,
6467 d: EntityDataItem,
6468 ) -> Result<(), UpdateMetadataError> {
6469 match d.index {
6470 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
6471 17 => {
6472 entity.insert(HasEgg(d.value.into_boolean()?));
6473 }
6474 18 => {
6475 entity.insert(LayingEgg(d.value.into_boolean()?));
6476 }
6477 _ => {}
6478 }
6479 Ok(())
6480 }
6481}
6482
6483#[derive(Bundle)]
6487pub struct TurtleMetadataBundle {
6488 _marker: Turtle,
6489 parent: AbstractAnimalMetadataBundle,
6490 has_egg: HasEgg,
6491 laying_egg: LayingEgg,
6492}
6493impl Default for TurtleMetadataBundle {
6494 fn default() -> Self {
6495 Self {
6496 _marker: Turtle,
6497 parent: Default::default(),
6498 has_egg: HasEgg(false),
6499 laying_egg: LayingEgg(false),
6500 }
6501 }
6502}
6503
6504#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6505pub struct Tamed(pub bool);
6507#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6508pub struct Eating(pub bool);
6510#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6511pub struct AbstractHorseStanding(pub bool);
6513#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6514pub struct Bred(pub bool);
6516#[derive(Component)]
6554pub struct AbstractHorse;
6555impl AbstractHorse {
6556 fn apply_metadata(
6557 entity: &mut bevy_ecs::system::EntityCommands,
6558 d: EntityDataItem,
6559 ) -> Result<(), UpdateMetadataError> {
6560 match d.index {
6561 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
6562 17 => {
6563 let bitfield = d.value.into_byte()?;
6564 entity.insert(Tamed(bitfield & 0x2 != 0));
6565 entity.insert(Eating(bitfield & 0x10 != 0));
6566 entity.insert(AbstractHorseStanding(bitfield & 0x20 != 0));
6567 entity.insert(Bred(bitfield & 0x8 != 0));
6568 }
6569 _ => {}
6570 }
6571 Ok(())
6572 }
6573}
6574
6575#[derive(Bundle)]
6579pub struct AbstractHorseMetadataBundle {
6580 _marker: AbstractHorse,
6581 parent: AbstractAnimalMetadataBundle,
6582 tamed: Tamed,
6583 eating: Eating,
6584 abstract_horse_standing: AbstractHorseStanding,
6585 bred: Bred,
6586}
6587impl Default for AbstractHorseMetadataBundle {
6588 fn default() -> Self {
6589 Self {
6590 _marker: AbstractHorse,
6591 parent: Default::default(),
6592 tamed: Tamed(false),
6593 eating: Eating(false),
6594 abstract_horse_standing: AbstractHorseStanding(false),
6595 bred: Bred(false),
6596 }
6597 }
6598}
6599
6600#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6602pub struct CamelDash(pub bool);
6603#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6605pub struct LastPoseChangeTick(pub i64);
6606#[derive(Component)]
6633pub struct Camel;
6634impl Camel {
6635 fn apply_metadata(
6636 entity: &mut bevy_ecs::system::EntityCommands,
6637 d: EntityDataItem,
6638 ) -> Result<(), UpdateMetadataError> {
6639 match d.index {
6640 0..=17 => AbstractHorse::apply_metadata(entity, d)?,
6641 18 => {
6642 entity.insert(CamelDash(d.value.into_boolean()?));
6643 }
6644 19 => {
6645 entity.insert(LastPoseChangeTick(d.value.into_long()?));
6646 }
6647 _ => {}
6648 }
6649 Ok(())
6650 }
6651}
6652
6653#[derive(Bundle)]
6657pub struct CamelMetadataBundle {
6658 _marker: Camel,
6659 parent: AbstractHorseMetadataBundle,
6660 camel_dash: CamelDash,
6661 last_pose_change_tick: LastPoseChangeTick,
6662}
6663impl Default for CamelMetadataBundle {
6664 fn default() -> Self {
6665 Self {
6666 _marker: Camel,
6667 parent: Default::default(),
6668 camel_dash: CamelDash(false),
6669 last_pose_change_tick: LastPoseChangeTick(0),
6670 }
6671 }
6672}
6673
6674#[derive(Component)]
6699pub struct CamelHusk;
6700impl CamelHusk {
6701 fn apply_metadata(
6702 entity: &mut bevy_ecs::system::EntityCommands,
6703 d: EntityDataItem,
6704 ) -> Result<(), UpdateMetadataError> {
6705 match d.index {
6706 0..=19 => Camel::apply_metadata(entity, d)?,
6707 _ => {}
6708 }
6709 Ok(())
6710 }
6711}
6712
6713#[derive(Bundle)]
6717pub struct CamelHuskMetadataBundle {
6718 _marker: CamelHusk,
6719 parent: CamelMetadataBundle,
6720}
6721impl Default for CamelHuskMetadataBundle {
6722 fn default() -> Self {
6723 Self {
6724 _marker: CamelHusk,
6725 parent: Default::default(),
6726 }
6727 }
6728}
6729
6730#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6732pub struct HorseTypeVariant(pub i32);
6733#[derive(Component)]
6759pub struct Horse;
6760impl Horse {
6761 fn apply_metadata(
6762 entity: &mut bevy_ecs::system::EntityCommands,
6763 d: EntityDataItem,
6764 ) -> Result<(), UpdateMetadataError> {
6765 match d.index {
6766 0..=17 => AbstractHorse::apply_metadata(entity, d)?,
6767 18 => {
6768 entity.insert(HorseTypeVariant(d.value.into_int()?));
6769 }
6770 _ => {}
6771 }
6772 Ok(())
6773 }
6774}
6775
6776#[derive(Bundle)]
6780pub struct HorseMetadataBundle {
6781 _marker: Horse,
6782 parent: AbstractHorseMetadataBundle,
6783 horse_type_variant: HorseTypeVariant,
6784}
6785impl Default for HorseMetadataBundle {
6786 fn default() -> Self {
6787 Self {
6788 _marker: Horse,
6789 parent: Default::default(),
6790 horse_type_variant: HorseTypeVariant(0),
6791 }
6792 }
6793}
6794
6795#[derive(Component)]
6819pub struct SkeletonHorse;
6820impl SkeletonHorse {
6821 fn apply_metadata(
6822 entity: &mut bevy_ecs::system::EntityCommands,
6823 d: EntityDataItem,
6824 ) -> Result<(), UpdateMetadataError> {
6825 match d.index {
6826 0..=17 => AbstractHorse::apply_metadata(entity, d)?,
6827 _ => {}
6828 }
6829 Ok(())
6830 }
6831}
6832
6833#[derive(Bundle)]
6837pub struct SkeletonHorseMetadataBundle {
6838 _marker: SkeletonHorse,
6839 parent: AbstractHorseMetadataBundle,
6840}
6841impl Default for SkeletonHorseMetadataBundle {
6842 fn default() -> Self {
6843 Self {
6844 _marker: SkeletonHorse,
6845 parent: Default::default(),
6846 }
6847 }
6848}
6849
6850#[derive(Component)]
6874pub struct ZombieHorse;
6875impl ZombieHorse {
6876 fn apply_metadata(
6877 entity: &mut bevy_ecs::system::EntityCommands,
6878 d: EntityDataItem,
6879 ) -> Result<(), UpdateMetadataError> {
6880 match d.index {
6881 0..=17 => AbstractHorse::apply_metadata(entity, d)?,
6882 _ => {}
6883 }
6884 Ok(())
6885 }
6886}
6887
6888#[derive(Bundle)]
6892pub struct ZombieHorseMetadataBundle {
6893 _marker: ZombieHorse,
6894 parent: AbstractHorseMetadataBundle,
6895}
6896impl Default for ZombieHorseMetadataBundle {
6897 fn default() -> Self {
6898 Self {
6899 _marker: ZombieHorse,
6900 parent: Default::default(),
6901 }
6902 }
6903}
6904
6905#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6907pub struct Chest(pub bool);
6908#[derive(Component)]
6938pub struct AbstractChestedHorse;
6939impl AbstractChestedHorse {
6940 fn apply_metadata(
6941 entity: &mut bevy_ecs::system::EntityCommands,
6942 d: EntityDataItem,
6943 ) -> Result<(), UpdateMetadataError> {
6944 match d.index {
6945 0..=17 => AbstractHorse::apply_metadata(entity, d)?,
6946 18 => {
6947 entity.insert(Chest(d.value.into_boolean()?));
6948 }
6949 _ => {}
6950 }
6951 Ok(())
6952 }
6953}
6954
6955#[derive(Bundle)]
6959pub struct AbstractChestedHorseMetadataBundle {
6960 _marker: AbstractChestedHorse,
6961 parent: AbstractHorseMetadataBundle,
6962 chest: Chest,
6963}
6964impl Default for AbstractChestedHorseMetadataBundle {
6965 fn default() -> Self {
6966 Self {
6967 _marker: AbstractChestedHorse,
6968 parent: Default::default(),
6969 chest: Chest(false),
6970 }
6971 }
6972}
6973
6974#[derive(Component)]
6999pub struct Donkey;
7000impl Donkey {
7001 fn apply_metadata(
7002 entity: &mut bevy_ecs::system::EntityCommands,
7003 d: EntityDataItem,
7004 ) -> Result<(), UpdateMetadataError> {
7005 match d.index {
7006 0..=18 => AbstractChestedHorse::apply_metadata(entity, d)?,
7007 _ => {}
7008 }
7009 Ok(())
7010 }
7011}
7012
7013#[derive(Bundle)]
7017pub struct DonkeyMetadataBundle {
7018 _marker: Donkey,
7019 parent: AbstractChestedHorseMetadataBundle,
7020}
7021impl Default for DonkeyMetadataBundle {
7022 fn default() -> Self {
7023 Self {
7024 _marker: Donkey,
7025 parent: Default::default(),
7026 }
7027 }
7028}
7029
7030#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7032pub struct Strength(pub i32);
7033#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7035pub struct LlamaVariant(pub i32);
7036#[derive(Component)]
7064pub struct Llama;
7065impl Llama {
7066 fn apply_metadata(
7067 entity: &mut bevy_ecs::system::EntityCommands,
7068 d: EntityDataItem,
7069 ) -> Result<(), UpdateMetadataError> {
7070 match d.index {
7071 0..=18 => AbstractChestedHorse::apply_metadata(entity, d)?,
7072 19 => {
7073 entity.insert(Strength(d.value.into_int()?));
7074 }
7075 20 => {
7076 entity.insert(LlamaVariant(d.value.into_int()?));
7077 }
7078 _ => {}
7079 }
7080 Ok(())
7081 }
7082}
7083
7084#[derive(Bundle)]
7088pub struct LlamaMetadataBundle {
7089 _marker: Llama,
7090 parent: AbstractChestedHorseMetadataBundle,
7091 strength: Strength,
7092 llama_variant: LlamaVariant,
7093}
7094impl Default for LlamaMetadataBundle {
7095 fn default() -> Self {
7096 Self {
7097 _marker: Llama,
7098 parent: Default::default(),
7099 strength: Strength(0),
7100 llama_variant: LlamaVariant(0),
7101 }
7102 }
7103}
7104
7105#[derive(Component)]
7131pub struct TraderLlama;
7132impl TraderLlama {
7133 fn apply_metadata(
7134 entity: &mut bevy_ecs::system::EntityCommands,
7135 d: EntityDataItem,
7136 ) -> Result<(), UpdateMetadataError> {
7137 match d.index {
7138 0..=20 => Llama::apply_metadata(entity, d)?,
7139 _ => {}
7140 }
7141 Ok(())
7142 }
7143}
7144
7145#[derive(Bundle)]
7149pub struct TraderLlamaMetadataBundle {
7150 _marker: TraderLlama,
7151 parent: LlamaMetadataBundle,
7152}
7153impl Default for TraderLlamaMetadataBundle {
7154 fn default() -> Self {
7155 Self {
7156 _marker: TraderLlama,
7157 parent: Default::default(),
7158 }
7159 }
7160}
7161
7162#[derive(Component)]
7187pub struct Mule;
7188impl Mule {
7189 fn apply_metadata(
7190 entity: &mut bevy_ecs::system::EntityCommands,
7191 d: EntityDataItem,
7192 ) -> Result<(), UpdateMetadataError> {
7193 match d.index {
7194 0..=18 => AbstractChestedHorse::apply_metadata(entity, d)?,
7195 _ => {}
7196 }
7197 Ok(())
7198 }
7199}
7200
7201#[derive(Bundle)]
7205pub struct MuleMetadataBundle {
7206 _marker: Mule,
7207 parent: AbstractChestedHorseMetadataBundle,
7208}
7209impl Default for MuleMetadataBundle {
7210 fn default() -> Self {
7211 Self {
7212 _marker: Mule,
7213 parent: Default::default(),
7214 }
7215 }
7216}
7217
7218#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
7219pub struct Tame(pub bool);
7221#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
7222pub struct InSittingPose(pub bool);
7224#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7226pub struct Owneruuid(pub Option<Uuid>);
7227#[derive(Component)]
7259pub struct AbstractTameable;
7260impl AbstractTameable {
7261 fn apply_metadata(
7262 entity: &mut bevy_ecs::system::EntityCommands,
7263 d: EntityDataItem,
7264 ) -> Result<(), UpdateMetadataError> {
7265 match d.index {
7266 0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
7267 17 => {
7268 let bitfield = d.value.into_byte()?;
7269 entity.insert(Tame(bitfield & 0x4 != 0));
7270 entity.insert(InSittingPose(bitfield & 0x1 != 0));
7271 }
7272 18 => {
7273 entity.insert(Owneruuid(d.value.into_optional_living_entity_reference()?));
7274 }
7275 _ => {}
7276 }
7277 Ok(())
7278 }
7279}
7280
7281#[derive(Bundle)]
7285pub struct AbstractTameableMetadataBundle {
7286 _marker: AbstractTameable,
7287 parent: AbstractAnimalMetadataBundle,
7288 tame: Tame,
7289 in_sitting_pose: InSittingPose,
7290 owneruuid: Owneruuid,
7291}
7292impl Default for AbstractTameableMetadataBundle {
7293 fn default() -> Self {
7294 Self {
7295 _marker: AbstractTameable,
7296 parent: Default::default(),
7297 tame: Tame(false),
7298 in_sitting_pose: InSittingPose(false),
7299 owneruuid: Owneruuid(None),
7300 }
7301 }
7302}
7303
7304#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7306pub struct CatVariant(pub azalea_registry::data::CatVariant);
7307#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7309pub struct IsLying(pub bool);
7310#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7312pub struct RelaxStateOne(pub bool);
7313#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7315pub struct CatCollarColor(pub i32);
7316#[derive(Component)]
7345pub struct Cat;
7346impl Cat {
7347 fn apply_metadata(
7348 entity: &mut bevy_ecs::system::EntityCommands,
7349 d: EntityDataItem,
7350 ) -> Result<(), UpdateMetadataError> {
7351 match d.index {
7352 0..=18 => AbstractTameable::apply_metadata(entity, d)?,
7353 19 => {
7354 entity.insert(CatVariant(d.value.into_cat_variant()?));
7355 }
7356 20 => {
7357 entity.insert(IsLying(d.value.into_boolean()?));
7358 }
7359 21 => {
7360 entity.insert(RelaxStateOne(d.value.into_boolean()?));
7361 }
7362 22 => {
7363 entity.insert(CatCollarColor(d.value.into_int()?));
7364 }
7365 _ => {}
7366 }
7367 Ok(())
7368 }
7369}
7370
7371#[derive(Bundle)]
7375pub struct CatMetadataBundle {
7376 _marker: Cat,
7377 parent: AbstractTameableMetadataBundle,
7378 cat_variant: CatVariant,
7379 is_lying: IsLying,
7380 relax_state_one: RelaxStateOne,
7381 cat_collar_color: CatCollarColor,
7382}
7383impl Default for CatMetadataBundle {
7384 fn default() -> Self {
7385 Self {
7386 _marker: Cat,
7387 parent: Default::default(),
7388 cat_variant: CatVariant(azalea_registry::data::CatVariant::new_raw(0)),
7389 is_lying: IsLying(false),
7390 relax_state_one: RelaxStateOne(false),
7391 cat_collar_color: CatCollarColor(Default::default()),
7392 }
7393 }
7394}
7395
7396#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7398pub struct NautilusDash(pub bool);
7399#[derive(Component)]
7426pub struct Nautilus;
7427impl Nautilus {
7428 fn apply_metadata(
7429 entity: &mut bevy_ecs::system::EntityCommands,
7430 d: EntityDataItem,
7431 ) -> Result<(), UpdateMetadataError> {
7432 match d.index {
7433 0..=18 => AbstractTameable::apply_metadata(entity, d)?,
7434 19 => {
7435 entity.insert(NautilusDash(d.value.into_boolean()?));
7436 }
7437 _ => {}
7438 }
7439 Ok(())
7440 }
7441}
7442
7443#[derive(Bundle)]
7447pub struct NautilusMetadataBundle {
7448 _marker: Nautilus,
7449 parent: AbstractTameableMetadataBundle,
7450 nautilus_dash: NautilusDash,
7451}
7452impl Default for NautilusMetadataBundle {
7453 fn default() -> Self {
7454 Self {
7455 _marker: Nautilus,
7456 parent: Default::default(),
7457 nautilus_dash: NautilusDash(false),
7458 }
7459 }
7460}
7461
7462#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7464pub struct ParrotVariant(pub i32);
7465#[derive(Component)]
7491pub struct Parrot;
7492impl Parrot {
7493 fn apply_metadata(
7494 entity: &mut bevy_ecs::system::EntityCommands,
7495 d: EntityDataItem,
7496 ) -> Result<(), UpdateMetadataError> {
7497 match d.index {
7498 0..=18 => AbstractTameable::apply_metadata(entity, d)?,
7499 19 => {
7500 entity.insert(ParrotVariant(d.value.into_int()?));
7501 }
7502 _ => {}
7503 }
7504 Ok(())
7505 }
7506}
7507
7508#[derive(Bundle)]
7512pub struct ParrotMetadataBundle {
7513 _marker: Parrot,
7514 parent: AbstractTameableMetadataBundle,
7515 parrot_variant: ParrotVariant,
7516}
7517impl Default for ParrotMetadataBundle {
7518 fn default() -> Self {
7519 Self {
7520 _marker: Parrot,
7521 parent: Default::default(),
7522 parrot_variant: ParrotVariant(Default::default()),
7523 }
7524 }
7525}
7526
7527#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7529pub struct WolfInterested(pub bool);
7530#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7532pub struct WolfCollarColor(pub i32);
7533#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7535pub struct WolfAngerEndTime(pub i64);
7536#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7538pub struct WolfVariant(pub azalea_registry::data::WolfVariant);
7539#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7541pub struct SoundVariant(pub azalea_registry::data::WolfSoundVariant);
7542#[derive(Component)]
7572pub struct Wolf;
7573impl Wolf {
7574 fn apply_metadata(
7575 entity: &mut bevy_ecs::system::EntityCommands,
7576 d: EntityDataItem,
7577 ) -> Result<(), UpdateMetadataError> {
7578 match d.index {
7579 0..=18 => AbstractTameable::apply_metadata(entity, d)?,
7580 19 => {
7581 entity.insert(WolfInterested(d.value.into_boolean()?));
7582 }
7583 20 => {
7584 entity.insert(WolfCollarColor(d.value.into_int()?));
7585 }
7586 21 => {
7587 entity.insert(WolfAngerEndTime(d.value.into_long()?));
7588 }
7589 22 => {
7590 entity.insert(WolfVariant(d.value.into_wolf_variant()?));
7591 }
7592 23 => {
7593 entity.insert(SoundVariant(d.value.into_wolf_sound_variant()?));
7594 }
7595 _ => {}
7596 }
7597 Ok(())
7598 }
7599}
7600
7601#[derive(Bundle)]
7605pub struct WolfMetadataBundle {
7606 _marker: Wolf,
7607 parent: AbstractTameableMetadataBundle,
7608 wolf_interested: WolfInterested,
7609 wolf_collar_color: WolfCollarColor,
7610 wolf_anger_end_time: WolfAngerEndTime,
7611 wolf_variant: WolfVariant,
7612 sound_variant: SoundVariant,
7613}
7614impl Default for WolfMetadataBundle {
7615 fn default() -> Self {
7616 Self {
7617 _marker: Wolf,
7618 parent: Default::default(),
7619 wolf_interested: WolfInterested(false),
7620 wolf_collar_color: WolfCollarColor(Default::default()),
7621 wolf_anger_end_time: WolfAngerEndTime(-1),
7622 wolf_variant: WolfVariant(azalea_registry::data::WolfVariant::new_raw(0)),
7623 sound_variant: SoundVariant(azalea_registry::data::WolfSoundVariant::new_raw(0)),
7624 }
7625 }
7626}
7627
7628#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7630pub struct ZombieNautilusDash(pub bool);
7631#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7633pub struct ZombieNautilusVariant(pub azalea_registry::data::ZombieNautilusVariant);
7634#[derive(Component)]
7662pub struct ZombieNautilus;
7663impl ZombieNautilus {
7664 fn apply_metadata(
7665 entity: &mut bevy_ecs::system::EntityCommands,
7666 d: EntityDataItem,
7667 ) -> Result<(), UpdateMetadataError> {
7668 match d.index {
7669 0..=18 => AbstractTameable::apply_metadata(entity, d)?,
7670 19 => {
7671 entity.insert(ZombieNautilusDash(d.value.into_boolean()?));
7672 }
7673 20 => {
7674 entity.insert(ZombieNautilusVariant(
7675 d.value.into_zombie_nautilus_variant()?,
7676 ));
7677 }
7678 _ => {}
7679 }
7680 Ok(())
7681 }
7682}
7683
7684#[derive(Bundle)]
7688pub struct ZombieNautilusMetadataBundle {
7689 _marker: ZombieNautilus,
7690 parent: AbstractTameableMetadataBundle,
7691 zombie_nautilus_dash: ZombieNautilusDash,
7692 zombie_nautilus_variant: ZombieNautilusVariant,
7693}
7694impl Default for ZombieNautilusMetadataBundle {
7695 fn default() -> Self {
7696 Self {
7697 _marker: ZombieNautilus,
7698 parent: Default::default(),
7699 zombie_nautilus_dash: ZombieNautilusDash(false),
7700 zombie_nautilus_variant: ZombieNautilusVariant(
7701 azalea_registry::data::ZombieNautilusVariant::new_raw(0),
7702 ),
7703 }
7704 }
7705}
7706
7707#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7709pub struct AbstractVillagerUnhappyCounter(pub i32);
7710#[derive(Component)]
7736pub struct AbstractVillager;
7737impl AbstractVillager {
7738 fn apply_metadata(
7739 entity: &mut bevy_ecs::system::EntityCommands,
7740 d: EntityDataItem,
7741 ) -> Result<(), UpdateMetadataError> {
7742 match d.index {
7743 0..=16 => AbstractAgeable::apply_metadata(entity, d)?,
7744 17 => {
7745 entity.insert(AbstractVillagerUnhappyCounter(d.value.into_int()?));
7746 }
7747 _ => {}
7748 }
7749 Ok(())
7750 }
7751}
7752
7753#[derive(Bundle)]
7757pub struct AbstractVillagerMetadataBundle {
7758 _marker: AbstractVillager,
7759 parent: AbstractAgeableMetadataBundle,
7760 abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter,
7761}
7762impl Default for AbstractVillagerMetadataBundle {
7763 fn default() -> Self {
7764 Self {
7765 _marker: AbstractVillager,
7766 parent: Default::default(),
7767 abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter(0),
7768 }
7769 }
7770}
7771
7772#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7774pub struct VillagerVillagerData(pub VillagerData);
7775#[derive(Component)]
7801pub struct Villager;
7802impl Villager {
7803 fn apply_metadata(
7804 entity: &mut bevy_ecs::system::EntityCommands,
7805 d: EntityDataItem,
7806 ) -> Result<(), UpdateMetadataError> {
7807 match d.index {
7808 0..=17 => AbstractVillager::apply_metadata(entity, d)?,
7809 18 => {
7810 entity.insert(VillagerVillagerData(d.value.into_villager_data()?));
7811 }
7812 _ => {}
7813 }
7814 Ok(())
7815 }
7816}
7817
7818#[derive(Bundle)]
7822pub struct VillagerMetadataBundle {
7823 _marker: Villager,
7824 parent: AbstractVillagerMetadataBundle,
7825 villager_villager_data: VillagerVillagerData,
7826}
7827impl Default for VillagerMetadataBundle {
7828 fn default() -> Self {
7829 Self {
7830 _marker: Villager,
7831 parent: Default::default(),
7832 villager_villager_data: VillagerVillagerData(VillagerData {
7833 kind: azalea_registry::builtin::VillagerKind::Plains,
7834 profession: azalea_registry::builtin::VillagerProfession::None,
7835 level: 0,
7836 }),
7837 }
7838 }
7839}
7840
7841#[derive(Component)]
7864pub struct WanderingTrader;
7865impl WanderingTrader {
7866 fn apply_metadata(
7867 entity: &mut bevy_ecs::system::EntityCommands,
7868 d: EntityDataItem,
7869 ) -> Result<(), UpdateMetadataError> {
7870 match d.index {
7871 0..=17 => AbstractVillager::apply_metadata(entity, d)?,
7872 _ => {}
7873 }
7874 Ok(())
7875 }
7876}
7877
7878#[derive(Bundle)]
7882pub struct WanderingTraderMetadataBundle {
7883 _marker: WanderingTrader,
7884 parent: AbstractVillagerMetadataBundle,
7885}
7886impl Default for WanderingTraderMetadataBundle {
7887 fn default() -> Self {
7888 Self {
7889 _marker: WanderingTrader,
7890 parent: Default::default(),
7891 }
7892 }
7893}
7894
7895#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7897pub struct AbstractFishFromBucket(pub bool);
7898#[derive(Component)]
7924pub struct AbstractFish;
7925impl AbstractFish {
7926 fn apply_metadata(
7927 entity: &mut bevy_ecs::system::EntityCommands,
7928 d: EntityDataItem,
7929 ) -> Result<(), UpdateMetadataError> {
7930 match d.index {
7931 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
7932 16 => {
7933 entity.insert(AbstractFishFromBucket(d.value.into_boolean()?));
7934 }
7935 _ => {}
7936 }
7937 Ok(())
7938 }
7939}
7940
7941#[derive(Bundle)]
7945pub struct AbstractFishMetadataBundle {
7946 _marker: AbstractFish,
7947 parent: AbstractCreatureMetadataBundle,
7948 abstract_fish_from_bucket: AbstractFishFromBucket,
7949}
7950impl Default for AbstractFishMetadataBundle {
7951 fn default() -> Self {
7952 Self {
7953 _marker: AbstractFish,
7954 parent: Default::default(),
7955 abstract_fish_from_bucket: AbstractFishFromBucket(false),
7956 }
7957 }
7958}
7959
7960#[derive(Component)]
7982pub struct Cod;
7983impl Cod {
7984 fn apply_metadata(
7985 entity: &mut bevy_ecs::system::EntityCommands,
7986 d: EntityDataItem,
7987 ) -> Result<(), UpdateMetadataError> {
7988 match d.index {
7989 0..=16 => AbstractFish::apply_metadata(entity, d)?,
7990 _ => {}
7991 }
7992 Ok(())
7993 }
7994}
7995
7996#[derive(Bundle)]
8000pub struct CodMetadataBundle {
8001 _marker: Cod,
8002 parent: AbstractFishMetadataBundle,
8003}
8004impl Default for CodMetadataBundle {
8005 fn default() -> Self {
8006 Self {
8007 _marker: Cod,
8008 parent: Default::default(),
8009 }
8010 }
8011}
8012
8013#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8015pub struct SalmonKind(pub i32);
8016#[derive(Component)]
8040pub struct Salmon;
8041impl Salmon {
8042 fn apply_metadata(
8043 entity: &mut bevy_ecs::system::EntityCommands,
8044 d: EntityDataItem,
8045 ) -> Result<(), UpdateMetadataError> {
8046 match d.index {
8047 0..=16 => AbstractFish::apply_metadata(entity, d)?,
8048 17 => {
8049 entity.insert(SalmonKind(d.value.into_int()?));
8050 }
8051 _ => {}
8052 }
8053 Ok(())
8054 }
8055}
8056
8057#[derive(Bundle)]
8061pub struct SalmonMetadataBundle {
8062 _marker: Salmon,
8063 parent: AbstractFishMetadataBundle,
8064 salmon_kind: SalmonKind,
8065}
8066impl Default for SalmonMetadataBundle {
8067 fn default() -> Self {
8068 Self {
8069 _marker: Salmon,
8070 parent: Default::default(),
8071 salmon_kind: SalmonKind(Default::default()),
8072 }
8073 }
8074}
8075
8076#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8078pub struct TropicalFishTypeVariant(pub i32);
8079#[derive(Component)]
8104pub struct TropicalFish;
8105impl TropicalFish {
8106 fn apply_metadata(
8107 entity: &mut bevy_ecs::system::EntityCommands,
8108 d: EntityDataItem,
8109 ) -> Result<(), UpdateMetadataError> {
8110 match d.index {
8111 0..=16 => AbstractFish::apply_metadata(entity, d)?,
8112 17 => {
8113 entity.insert(TropicalFishTypeVariant(d.value.into_int()?));
8114 }
8115 _ => {}
8116 }
8117 Ok(())
8118 }
8119}
8120
8121#[derive(Bundle)]
8125pub struct TropicalFishMetadataBundle {
8126 _marker: TropicalFish,
8127 parent: AbstractFishMetadataBundle,
8128 tropical_fish_type_variant: TropicalFishTypeVariant,
8129}
8130impl Default for TropicalFishMetadataBundle {
8131 fn default() -> Self {
8132 Self {
8133 _marker: TropicalFish,
8134 parent: Default::default(),
8135 tropical_fish_type_variant: TropicalFishTypeVariant(Default::default()),
8136 }
8137 }
8138}
8139
8140#[derive(Component)]
8197pub struct AbstractMonster;
8198impl AbstractMonster {
8199 fn apply_metadata(
8200 entity: &mut bevy_ecs::system::EntityCommands,
8201 d: EntityDataItem,
8202 ) -> Result<(), UpdateMetadataError> {
8203 match d.index {
8204 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
8205 _ => {}
8206 }
8207 Ok(())
8208 }
8209}
8210
8211#[derive(Bundle)]
8215pub struct AbstractMonsterMetadataBundle {
8216 _marker: AbstractMonster,
8217 parent: AbstractCreatureMetadataBundle,
8218}
8219impl Default for AbstractMonsterMetadataBundle {
8220 fn default() -> Self {
8221 Self {
8222 _marker: AbstractMonster,
8223 parent: Default::default(),
8224 }
8225 }
8226}
8227
8228#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
8229pub struct Charged(pub bool);
8231#[derive(Component)]
8255pub struct Blaze;
8256impl Blaze {
8257 fn apply_metadata(
8258 entity: &mut bevy_ecs::system::EntityCommands,
8259 d: EntityDataItem,
8260 ) -> Result<(), UpdateMetadataError> {
8261 match d.index {
8262 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8263 16 => {
8264 let bitfield = d.value.into_byte()?;
8265 entity.insert(Charged(bitfield & 0x1 != 0));
8266 }
8267 _ => {}
8268 }
8269 Ok(())
8270 }
8271}
8272
8273#[derive(Bundle)]
8277pub struct BlazeMetadataBundle {
8278 _marker: Blaze,
8279 parent: AbstractMonsterMetadataBundle,
8280 charged: Charged,
8281}
8282impl Default for BlazeMetadataBundle {
8283 fn default() -> Self {
8284 Self {
8285 _marker: Blaze,
8286 parent: Default::default(),
8287 charged: Charged(false),
8288 }
8289 }
8290}
8291
8292#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8294pub struct BoggedSheared(pub bool);
8295#[derive(Component)]
8319pub struct Bogged;
8320impl Bogged {
8321 fn apply_metadata(
8322 entity: &mut bevy_ecs::system::EntityCommands,
8323 d: EntityDataItem,
8324 ) -> Result<(), UpdateMetadataError> {
8325 match d.index {
8326 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8327 16 => {
8328 entity.insert(BoggedSheared(d.value.into_boolean()?));
8329 }
8330 _ => {}
8331 }
8332 Ok(())
8333 }
8334}
8335
8336#[derive(Bundle)]
8340pub struct BoggedMetadataBundle {
8341 _marker: Bogged,
8342 parent: AbstractMonsterMetadataBundle,
8343 bogged_sheared: BoggedSheared,
8344}
8345impl Default for BoggedMetadataBundle {
8346 fn default() -> Self {
8347 Self {
8348 _marker: Bogged,
8349 parent: Default::default(),
8350 bogged_sheared: BoggedSheared(false),
8351 }
8352 }
8353}
8354
8355#[derive(Component)]
8377pub struct Breeze;
8378impl Breeze {
8379 fn apply_metadata(
8380 entity: &mut bevy_ecs::system::EntityCommands,
8381 d: EntityDataItem,
8382 ) -> Result<(), UpdateMetadataError> {
8383 match d.index {
8384 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8385 _ => {}
8386 }
8387 Ok(())
8388 }
8389}
8390
8391#[derive(Bundle)]
8395pub struct BreezeMetadataBundle {
8396 _marker: Breeze,
8397 parent: AbstractMonsterMetadataBundle,
8398}
8399impl Default for BreezeMetadataBundle {
8400 fn default() -> Self {
8401 Self {
8402 _marker: Breeze,
8403 parent: Default::default(),
8404 }
8405 }
8406}
8407
8408#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8410pub struct CanMove(pub bool);
8411#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8413pub struct IsActive(pub bool);
8414#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8416pub struct IsTearingDown(pub bool);
8417#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8419pub struct HomePos(pub Option<BlockPos>);
8420#[derive(Component)]
8448pub struct Creaking;
8449impl Creaking {
8450 fn apply_metadata(
8451 entity: &mut bevy_ecs::system::EntityCommands,
8452 d: EntityDataItem,
8453 ) -> Result<(), UpdateMetadataError> {
8454 match d.index {
8455 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8456 16 => {
8457 entity.insert(CanMove(d.value.into_boolean()?));
8458 }
8459 17 => {
8460 entity.insert(IsActive(d.value.into_boolean()?));
8461 }
8462 18 => {
8463 entity.insert(IsTearingDown(d.value.into_boolean()?));
8464 }
8465 19 => {
8466 entity.insert(HomePos(d.value.into_optional_block_pos()?));
8467 }
8468 _ => {}
8469 }
8470 Ok(())
8471 }
8472}
8473
8474#[derive(Bundle)]
8478pub struct CreakingMetadataBundle {
8479 _marker: Creaking,
8480 parent: AbstractMonsterMetadataBundle,
8481 can_move: CanMove,
8482 is_active: IsActive,
8483 is_tearing_down: IsTearingDown,
8484 home_pos: HomePos,
8485}
8486impl Default for CreakingMetadataBundle {
8487 fn default() -> Self {
8488 Self {
8489 _marker: Creaking,
8490 parent: Default::default(),
8491 can_move: CanMove(true),
8492 is_active: IsActive(false),
8493 is_tearing_down: IsTearingDown(false),
8494 home_pos: HomePos(None),
8495 }
8496 }
8497}
8498
8499#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8501pub struct SwellDir(pub i32);
8502#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8504pub struct IsPowered(pub bool);
8505#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8507pub struct IsIgnited(pub bool);
8508#[derive(Component)]
8534pub struct Creeper;
8535impl Creeper {
8536 fn apply_metadata(
8537 entity: &mut bevy_ecs::system::EntityCommands,
8538 d: EntityDataItem,
8539 ) -> Result<(), UpdateMetadataError> {
8540 match d.index {
8541 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8542 16 => {
8543 entity.insert(SwellDir(d.value.into_int()?));
8544 }
8545 17 => {
8546 entity.insert(IsPowered(d.value.into_boolean()?));
8547 }
8548 18 => {
8549 entity.insert(IsIgnited(d.value.into_boolean()?));
8550 }
8551 _ => {}
8552 }
8553 Ok(())
8554 }
8555}
8556
8557#[derive(Bundle)]
8561pub struct CreeperMetadataBundle {
8562 _marker: Creeper,
8563 parent: AbstractMonsterMetadataBundle,
8564 swell_dir: SwellDir,
8565 is_powered: IsPowered,
8566 is_ignited: IsIgnited,
8567}
8568impl Default for CreeperMetadataBundle {
8569 fn default() -> Self {
8570 Self {
8571 _marker: Creeper,
8572 parent: Default::default(),
8573 swell_dir: SwellDir(-1),
8574 is_powered: IsPowered(false),
8575 is_ignited: IsIgnited(false),
8576 }
8577 }
8578}
8579
8580#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8582pub struct CarryState(pub azalea_block::BlockState);
8583#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8585pub struct Creepy(pub bool);
8586#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8588pub struct StaredAt(pub bool);
8589#[derive(Component)]
8616pub struct Enderman;
8617impl Enderman {
8618 fn apply_metadata(
8619 entity: &mut bevy_ecs::system::EntityCommands,
8620 d: EntityDataItem,
8621 ) -> Result<(), UpdateMetadataError> {
8622 match d.index {
8623 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8624 16 => {
8625 entity.insert(CarryState(d.value.into_optional_block_state()?));
8626 }
8627 17 => {
8628 entity.insert(Creepy(d.value.into_boolean()?));
8629 }
8630 18 => {
8631 entity.insert(StaredAt(d.value.into_boolean()?));
8632 }
8633 _ => {}
8634 }
8635 Ok(())
8636 }
8637}
8638
8639#[derive(Bundle)]
8643pub struct EndermanMetadataBundle {
8644 _marker: Enderman,
8645 parent: AbstractMonsterMetadataBundle,
8646 carry_state: CarryState,
8647 creepy: Creepy,
8648 stared_at: StaredAt,
8649}
8650impl Default for EndermanMetadataBundle {
8651 fn default() -> Self {
8652 Self {
8653 _marker: Enderman,
8654 parent: Default::default(),
8655 carry_state: CarryState(azalea_block::BlockState::AIR),
8656 creepy: Creepy(false),
8657 stared_at: StaredAt(false),
8658 }
8659 }
8660}
8661
8662#[derive(Component)]
8684pub struct Endermite;
8685impl Endermite {
8686 fn apply_metadata(
8687 entity: &mut bevy_ecs::system::EntityCommands,
8688 d: EntityDataItem,
8689 ) -> Result<(), UpdateMetadataError> {
8690 match d.index {
8691 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8692 _ => {}
8693 }
8694 Ok(())
8695 }
8696}
8697
8698#[derive(Bundle)]
8702pub struct EndermiteMetadataBundle {
8703 _marker: Endermite,
8704 parent: AbstractMonsterMetadataBundle,
8705}
8706impl Default for EndermiteMetadataBundle {
8707 fn default() -> Self {
8708 Self {
8709 _marker: Endermite,
8710 parent: Default::default(),
8711 }
8712 }
8713}
8714
8715#[derive(Component)]
8737pub struct Giant;
8738impl Giant {
8739 fn apply_metadata(
8740 entity: &mut bevy_ecs::system::EntityCommands,
8741 d: EntityDataItem,
8742 ) -> Result<(), UpdateMetadataError> {
8743 match d.index {
8744 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8745 _ => {}
8746 }
8747 Ok(())
8748 }
8749}
8750
8751#[derive(Bundle)]
8755pub struct GiantMetadataBundle {
8756 _marker: Giant,
8757 parent: AbstractMonsterMetadataBundle,
8758}
8759impl Default for GiantMetadataBundle {
8760 fn default() -> Self {
8761 Self {
8762 _marker: Giant,
8763 parent: Default::default(),
8764 }
8765 }
8766}
8767
8768#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8770pub struct Moving(pub bool);
8771#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8773pub struct AttackTarget(pub i32);
8774#[derive(Component)]
8800pub struct Guardian;
8801impl Guardian {
8802 fn apply_metadata(
8803 entity: &mut bevy_ecs::system::EntityCommands,
8804 d: EntityDataItem,
8805 ) -> Result<(), UpdateMetadataError> {
8806 match d.index {
8807 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8808 16 => {
8809 entity.insert(Moving(d.value.into_boolean()?));
8810 }
8811 17 => {
8812 entity.insert(AttackTarget(d.value.into_int()?));
8813 }
8814 _ => {}
8815 }
8816 Ok(())
8817 }
8818}
8819
8820#[derive(Bundle)]
8824pub struct GuardianMetadataBundle {
8825 _marker: Guardian,
8826 parent: AbstractMonsterMetadataBundle,
8827 moving: Moving,
8828 attack_target: AttackTarget,
8829}
8830impl Default for GuardianMetadataBundle {
8831 fn default() -> Self {
8832 Self {
8833 _marker: Guardian,
8834 parent: Default::default(),
8835 moving: Moving(false),
8836 attack_target: AttackTarget(0),
8837 }
8838 }
8839}
8840
8841#[derive(Component)]
8864pub struct ElderGuardian;
8865impl ElderGuardian {
8866 fn apply_metadata(
8867 entity: &mut bevy_ecs::system::EntityCommands,
8868 d: EntityDataItem,
8869 ) -> Result<(), UpdateMetadataError> {
8870 match d.index {
8871 0..=17 => Guardian::apply_metadata(entity, d)?,
8872 _ => {}
8873 }
8874 Ok(())
8875 }
8876}
8877
8878#[derive(Bundle)]
8882pub struct ElderGuardianMetadataBundle {
8883 _marker: ElderGuardian,
8884 parent: GuardianMetadataBundle,
8885}
8886impl Default for ElderGuardianMetadataBundle {
8887 fn default() -> Self {
8888 Self {
8889 _marker: ElderGuardian,
8890 parent: Default::default(),
8891 }
8892 }
8893}
8894
8895#[derive(Component)]
8917pub struct Parched;
8918impl Parched {
8919 fn apply_metadata(
8920 entity: &mut bevy_ecs::system::EntityCommands,
8921 d: EntityDataItem,
8922 ) -> Result<(), UpdateMetadataError> {
8923 match d.index {
8924 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8925 _ => {}
8926 }
8927 Ok(())
8928 }
8929}
8930
8931#[derive(Bundle)]
8935pub struct ParchedMetadataBundle {
8936 _marker: Parched,
8937 parent: AbstractMonsterMetadataBundle,
8938}
8939impl Default for ParchedMetadataBundle {
8940 fn default() -> Self {
8941 Self {
8942 _marker: Parched,
8943 parent: Default::default(),
8944 }
8945 }
8946}
8947
8948#[derive(Component)]
8970pub struct Silverfish;
8971impl Silverfish {
8972 fn apply_metadata(
8973 entity: &mut bevy_ecs::system::EntityCommands,
8974 d: EntityDataItem,
8975 ) -> Result<(), UpdateMetadataError> {
8976 match d.index {
8977 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8978 _ => {}
8979 }
8980 Ok(())
8981 }
8982}
8983
8984#[derive(Bundle)]
8988pub struct SilverfishMetadataBundle {
8989 _marker: Silverfish,
8990 parent: AbstractMonsterMetadataBundle,
8991}
8992impl Default for SilverfishMetadataBundle {
8993 fn default() -> Self {
8994 Self {
8995 _marker: Silverfish,
8996 parent: Default::default(),
8997 }
8998 }
8999}
9000
9001#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9003pub struct StrayConversion(pub bool);
9004#[derive(Component)]
9029pub struct Skeleton;
9030impl Skeleton {
9031 fn apply_metadata(
9032 entity: &mut bevy_ecs::system::EntityCommands,
9033 d: EntityDataItem,
9034 ) -> Result<(), UpdateMetadataError> {
9035 match d.index {
9036 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9037 16 => {
9038 entity.insert(StrayConversion(d.value.into_boolean()?));
9039 }
9040 _ => {}
9041 }
9042 Ok(())
9043 }
9044}
9045
9046#[derive(Bundle)]
9050pub struct SkeletonMetadataBundle {
9051 _marker: Skeleton,
9052 parent: AbstractMonsterMetadataBundle,
9053 stray_conversion: StrayConversion,
9054}
9055impl Default for SkeletonMetadataBundle {
9056 fn default() -> Self {
9057 Self {
9058 _marker: Skeleton,
9059 parent: Default::default(),
9060 stray_conversion: StrayConversion(false),
9061 }
9062 }
9063}
9064
9065#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
9066pub struct Climbing(pub bool);
9068#[derive(Component)]
9092pub struct Spider;
9093impl Spider {
9094 fn apply_metadata(
9095 entity: &mut bevy_ecs::system::EntityCommands,
9096 d: EntityDataItem,
9097 ) -> Result<(), UpdateMetadataError> {
9098 match d.index {
9099 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9100 16 => {
9101 let bitfield = d.value.into_byte()?;
9102 entity.insert(Climbing(bitfield & 0x1 != 0));
9103 }
9104 _ => {}
9105 }
9106 Ok(())
9107 }
9108}
9109
9110#[derive(Bundle)]
9114pub struct SpiderMetadataBundle {
9115 _marker: Spider,
9116 parent: AbstractMonsterMetadataBundle,
9117 climbing: Climbing,
9118}
9119impl Default for SpiderMetadataBundle {
9120 fn default() -> Self {
9121 Self {
9122 _marker: Spider,
9123 parent: Default::default(),
9124 climbing: Climbing(false),
9125 }
9126 }
9127}
9128
9129#[derive(Component)]
9152pub struct CaveSpider;
9153impl CaveSpider {
9154 fn apply_metadata(
9155 entity: &mut bevy_ecs::system::EntityCommands,
9156 d: EntityDataItem,
9157 ) -> Result<(), UpdateMetadataError> {
9158 match d.index {
9159 0..=16 => Spider::apply_metadata(entity, d)?,
9160 _ => {}
9161 }
9162 Ok(())
9163 }
9164}
9165
9166#[derive(Bundle)]
9170pub struct CaveSpiderMetadataBundle {
9171 _marker: CaveSpider,
9172 parent: SpiderMetadataBundle,
9173}
9174impl Default for CaveSpiderMetadataBundle {
9175 fn default() -> Self {
9176 Self {
9177 _marker: CaveSpider,
9178 parent: Default::default(),
9179 }
9180 }
9181}
9182
9183#[derive(Component)]
9205pub struct Stray;
9206impl Stray {
9207 fn apply_metadata(
9208 entity: &mut bevy_ecs::system::EntityCommands,
9209 d: EntityDataItem,
9210 ) -> Result<(), UpdateMetadataError> {
9211 match d.index {
9212 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9213 _ => {}
9214 }
9215 Ok(())
9216 }
9217}
9218
9219#[derive(Bundle)]
9223pub struct StrayMetadataBundle {
9224 _marker: Stray,
9225 parent: AbstractMonsterMetadataBundle,
9226}
9227impl Default for StrayMetadataBundle {
9228 fn default() -> Self {
9229 Self {
9230 _marker: Stray,
9231 parent: Default::default(),
9232 }
9233 }
9234}
9235
9236#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9238pub struct VexFlags(pub u8);
9239#[derive(Component)]
9263pub struct Vex;
9264impl Vex {
9265 fn apply_metadata(
9266 entity: &mut bevy_ecs::system::EntityCommands,
9267 d: EntityDataItem,
9268 ) -> Result<(), UpdateMetadataError> {
9269 match d.index {
9270 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9271 16 => {
9272 entity.insert(VexFlags(d.value.into_byte()?));
9273 }
9274 _ => {}
9275 }
9276 Ok(())
9277 }
9278}
9279
9280#[derive(Bundle)]
9284pub struct VexMetadataBundle {
9285 _marker: Vex,
9286 parent: AbstractMonsterMetadataBundle,
9287 vex_flags: VexFlags,
9288}
9289impl Default for VexMetadataBundle {
9290 fn default() -> Self {
9291 Self {
9292 _marker: Vex,
9293 parent: Default::default(),
9294 vex_flags: VexFlags(0),
9295 }
9296 }
9297}
9298
9299#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9301pub struct ClientAngerLevel(pub i32);
9302#[derive(Component)]
9326pub struct Warden;
9327impl Warden {
9328 fn apply_metadata(
9329 entity: &mut bevy_ecs::system::EntityCommands,
9330 d: EntityDataItem,
9331 ) -> Result<(), UpdateMetadataError> {
9332 match d.index {
9333 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9334 16 => {
9335 entity.insert(ClientAngerLevel(d.value.into_int()?));
9336 }
9337 _ => {}
9338 }
9339 Ok(())
9340 }
9341}
9342
9343#[derive(Bundle)]
9347pub struct WardenMetadataBundle {
9348 _marker: Warden,
9349 parent: AbstractMonsterMetadataBundle,
9350 client_anger_level: ClientAngerLevel,
9351}
9352impl Default for WardenMetadataBundle {
9353 fn default() -> Self {
9354 Self {
9355 _marker: Warden,
9356 parent: Default::default(),
9357 client_anger_level: ClientAngerLevel(0),
9358 }
9359 }
9360}
9361
9362#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9364pub struct TargetA(pub i32);
9365#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9367pub struct TargetB(pub i32);
9368#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9370pub struct TargetC(pub i32);
9371#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9373pub struct Inv(pub i32);
9374#[derive(Component)]
9401pub struct Wither;
9402impl Wither {
9403 fn apply_metadata(
9404 entity: &mut bevy_ecs::system::EntityCommands,
9405 d: EntityDataItem,
9406 ) -> Result<(), UpdateMetadataError> {
9407 match d.index {
9408 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9409 16 => {
9410 entity.insert(TargetA(d.value.into_int()?));
9411 }
9412 17 => {
9413 entity.insert(TargetB(d.value.into_int()?));
9414 }
9415 18 => {
9416 entity.insert(TargetC(d.value.into_int()?));
9417 }
9418 19 => {
9419 entity.insert(Inv(d.value.into_int()?));
9420 }
9421 _ => {}
9422 }
9423 Ok(())
9424 }
9425}
9426
9427#[derive(Bundle)]
9431pub struct WitherMetadataBundle {
9432 _marker: Wither,
9433 parent: AbstractMonsterMetadataBundle,
9434 target_a: TargetA,
9435 target_b: TargetB,
9436 target_c: TargetC,
9437 inv: Inv,
9438}
9439impl Default for WitherMetadataBundle {
9440 fn default() -> Self {
9441 Self {
9442 _marker: Wither,
9443 parent: Default::default(),
9444 target_a: TargetA(0),
9445 target_b: TargetB(0),
9446 target_c: TargetC(0),
9447 inv: Inv(0),
9448 }
9449 }
9450}
9451
9452#[derive(Component)]
9474pub struct WitherSkeleton;
9475impl WitherSkeleton {
9476 fn apply_metadata(
9477 entity: &mut bevy_ecs::system::EntityCommands,
9478 d: EntityDataItem,
9479 ) -> Result<(), UpdateMetadataError> {
9480 match d.index {
9481 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9482 _ => {}
9483 }
9484 Ok(())
9485 }
9486}
9487
9488#[derive(Bundle)]
9492pub struct WitherSkeletonMetadataBundle {
9493 _marker: WitherSkeleton,
9494 parent: AbstractMonsterMetadataBundle,
9495}
9496impl Default for WitherSkeletonMetadataBundle {
9497 fn default() -> Self {
9498 Self {
9499 _marker: WitherSkeleton,
9500 parent: Default::default(),
9501 }
9502 }
9503}
9504
9505#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9507pub struct ZoglinBaby(pub bool);
9508#[derive(Component)]
9532pub struct Zoglin;
9533impl Zoglin {
9534 fn apply_metadata(
9535 entity: &mut bevy_ecs::system::EntityCommands,
9536 d: EntityDataItem,
9537 ) -> Result<(), UpdateMetadataError> {
9538 match d.index {
9539 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9540 16 => {
9541 entity.insert(ZoglinBaby(d.value.into_boolean()?));
9542 }
9543 _ => {}
9544 }
9545 Ok(())
9546 }
9547}
9548
9549#[derive(Bundle)]
9553pub struct ZoglinMetadataBundle {
9554 _marker: Zoglin,
9555 parent: AbstractMonsterMetadataBundle,
9556 zoglin_baby: ZoglinBaby,
9557}
9558impl Default for ZoglinMetadataBundle {
9559 fn default() -> Self {
9560 Self {
9561 _marker: Zoglin,
9562 parent: Default::default(),
9563 zoglin_baby: ZoglinBaby(false),
9564 }
9565 }
9566}
9567
9568#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9570pub struct ZombieBaby(pub bool);
9571#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9573pub struct SpecialType(pub i32);
9574#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9576pub struct DrownedConversion(pub bool);
9577#[derive(Component)]
9606pub struct Zombie;
9607impl Zombie {
9608 fn apply_metadata(
9609 entity: &mut bevy_ecs::system::EntityCommands,
9610 d: EntityDataItem,
9611 ) -> Result<(), UpdateMetadataError> {
9612 match d.index {
9613 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9614 16 => {
9615 entity.insert(ZombieBaby(d.value.into_boolean()?));
9616 }
9617 17 => {
9618 entity.insert(SpecialType(d.value.into_int()?));
9619 }
9620 18 => {
9621 entity.insert(DrownedConversion(d.value.into_boolean()?));
9622 }
9623 _ => {}
9624 }
9625 Ok(())
9626 }
9627}
9628
9629#[derive(Bundle)]
9633pub struct ZombieMetadataBundle {
9634 _marker: Zombie,
9635 parent: AbstractMonsterMetadataBundle,
9636 zombie_baby: ZombieBaby,
9637 special_type: SpecialType,
9638 drowned_conversion: DrownedConversion,
9639}
9640impl Default for ZombieMetadataBundle {
9641 fn default() -> Self {
9642 Self {
9643 _marker: Zombie,
9644 parent: Default::default(),
9645 zombie_baby: ZombieBaby(false),
9646 special_type: SpecialType(0),
9647 drowned_conversion: DrownedConversion(false),
9648 }
9649 }
9650}
9651
9652#[derive(Component)]
9675pub struct Drowned;
9676impl Drowned {
9677 fn apply_metadata(
9678 entity: &mut bevy_ecs::system::EntityCommands,
9679 d: EntityDataItem,
9680 ) -> Result<(), UpdateMetadataError> {
9681 match d.index {
9682 0..=18 => Zombie::apply_metadata(entity, d)?,
9683 _ => {}
9684 }
9685 Ok(())
9686 }
9687}
9688
9689#[derive(Bundle)]
9693pub struct DrownedMetadataBundle {
9694 _marker: Drowned,
9695 parent: ZombieMetadataBundle,
9696}
9697impl Default for DrownedMetadataBundle {
9698 fn default() -> Self {
9699 Self {
9700 _marker: Drowned,
9701 parent: Default::default(),
9702 }
9703 }
9704}
9705
9706#[derive(Component)]
9729pub struct Husk;
9730impl Husk {
9731 fn apply_metadata(
9732 entity: &mut bevy_ecs::system::EntityCommands,
9733 d: EntityDataItem,
9734 ) -> Result<(), UpdateMetadataError> {
9735 match d.index {
9736 0..=18 => Zombie::apply_metadata(entity, d)?,
9737 _ => {}
9738 }
9739 Ok(())
9740 }
9741}
9742
9743#[derive(Bundle)]
9747pub struct HuskMetadataBundle {
9748 _marker: Husk,
9749 parent: ZombieMetadataBundle,
9750}
9751impl Default for HuskMetadataBundle {
9752 fn default() -> Self {
9753 Self {
9754 _marker: Husk,
9755 parent: Default::default(),
9756 }
9757 }
9758}
9759
9760#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9762pub struct Converting(pub bool);
9763#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9765pub struct ZombieVillagerVillagerData(pub VillagerData);
9766#[derive(Component)]
9793pub struct ZombieVillager;
9794impl ZombieVillager {
9795 fn apply_metadata(
9796 entity: &mut bevy_ecs::system::EntityCommands,
9797 d: EntityDataItem,
9798 ) -> Result<(), UpdateMetadataError> {
9799 match d.index {
9800 0..=18 => Zombie::apply_metadata(entity, d)?,
9801 19 => {
9802 entity.insert(Converting(d.value.into_boolean()?));
9803 }
9804 20 => {
9805 entity.insert(ZombieVillagerVillagerData(d.value.into_villager_data()?));
9806 }
9807 _ => {}
9808 }
9809 Ok(())
9810 }
9811}
9812
9813#[derive(Bundle)]
9817pub struct ZombieVillagerMetadataBundle {
9818 _marker: ZombieVillager,
9819 parent: ZombieMetadataBundle,
9820 converting: Converting,
9821 zombie_villager_villager_data: ZombieVillagerVillagerData,
9822}
9823impl Default for ZombieVillagerMetadataBundle {
9824 fn default() -> Self {
9825 Self {
9826 _marker: ZombieVillager,
9827 parent: Default::default(),
9828 converting: Converting(false),
9829 zombie_villager_villager_data: ZombieVillagerVillagerData(VillagerData {
9830 kind: azalea_registry::builtin::VillagerKind::Plains,
9831 profession: azalea_registry::builtin::VillagerProfession::None,
9832 level: 0,
9833 }),
9834 }
9835 }
9836}
9837
9838#[derive(Component)]
9861pub struct ZombifiedPiglin;
9862impl ZombifiedPiglin {
9863 fn apply_metadata(
9864 entity: &mut bevy_ecs::system::EntityCommands,
9865 d: EntityDataItem,
9866 ) -> Result<(), UpdateMetadataError> {
9867 match d.index {
9868 0..=18 => Zombie::apply_metadata(entity, d)?,
9869 _ => {}
9870 }
9871 Ok(())
9872 }
9873}
9874
9875#[derive(Bundle)]
9879pub struct ZombifiedPiglinMetadataBundle {
9880 _marker: ZombifiedPiglin,
9881 parent: ZombieMetadataBundle,
9882}
9883impl Default for ZombifiedPiglinMetadataBundle {
9884 fn default() -> Self {
9885 Self {
9886 _marker: ZombifiedPiglin,
9887 parent: Default::default(),
9888 }
9889 }
9890}
9891
9892#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9894pub struct AbstractPiglinImmuneToZombification(pub bool);
9895#[derive(Component)]
9921pub struct AbstractPiglin;
9922impl AbstractPiglin {
9923 fn apply_metadata(
9924 entity: &mut bevy_ecs::system::EntityCommands,
9925 d: EntityDataItem,
9926 ) -> Result<(), UpdateMetadataError> {
9927 match d.index {
9928 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9929 16 => {
9930 entity.insert(AbstractPiglinImmuneToZombification(d.value.into_boolean()?));
9931 }
9932 _ => {}
9933 }
9934 Ok(())
9935 }
9936}
9937
9938#[derive(Bundle)]
9942pub struct AbstractPiglinMetadataBundle {
9943 _marker: AbstractPiglin,
9944 parent: AbstractMonsterMetadataBundle,
9945 abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification,
9946}
9947impl Default for AbstractPiglinMetadataBundle {
9948 fn default() -> Self {
9949 Self {
9950 _marker: AbstractPiglin,
9951 parent: Default::default(),
9952 abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification(false),
9953 }
9954 }
9955}
9956
9957#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9959pub struct PiglinBaby(pub bool);
9960#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9962pub struct PiglinIsChargingCrossbow(pub bool);
9963#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9965pub struct IsDancing(pub bool);
9966#[derive(Component)]
9993pub struct Piglin;
9994impl Piglin {
9995 fn apply_metadata(
9996 entity: &mut bevy_ecs::system::EntityCommands,
9997 d: EntityDataItem,
9998 ) -> Result<(), UpdateMetadataError> {
9999 match d.index {
10000 0..=16 => AbstractPiglin::apply_metadata(entity, d)?,
10001 17 => {
10002 entity.insert(PiglinBaby(d.value.into_boolean()?));
10003 }
10004 18 => {
10005 entity.insert(PiglinIsChargingCrossbow(d.value.into_boolean()?));
10006 }
10007 19 => {
10008 entity.insert(IsDancing(d.value.into_boolean()?));
10009 }
10010 _ => {}
10011 }
10012 Ok(())
10013 }
10014}
10015
10016#[derive(Bundle)]
10020pub struct PiglinMetadataBundle {
10021 _marker: Piglin,
10022 parent: AbstractPiglinMetadataBundle,
10023 piglin_baby: PiglinBaby,
10024 piglin_is_charging_crossbow: PiglinIsChargingCrossbow,
10025 is_dancing: IsDancing,
10026}
10027impl Default for PiglinMetadataBundle {
10028 fn default() -> Self {
10029 Self {
10030 _marker: Piglin,
10031 parent: Default::default(),
10032 piglin_baby: PiglinBaby(false),
10033 piglin_is_charging_crossbow: PiglinIsChargingCrossbow(false),
10034 is_dancing: IsDancing(false),
10035 }
10036 }
10037}
10038
10039#[derive(Component)]
10062pub struct PiglinBrute;
10063impl PiglinBrute {
10064 fn apply_metadata(
10065 entity: &mut bevy_ecs::system::EntityCommands,
10066 d: EntityDataItem,
10067 ) -> Result<(), UpdateMetadataError> {
10068 match d.index {
10069 0..=16 => AbstractPiglin::apply_metadata(entity, d)?,
10070 _ => {}
10071 }
10072 Ok(())
10073 }
10074}
10075
10076#[derive(Bundle)]
10080pub struct PiglinBruteMetadataBundle {
10081 _marker: PiglinBrute,
10082 parent: AbstractPiglinMetadataBundle,
10083}
10084impl Default for PiglinBruteMetadataBundle {
10085 fn default() -> Self {
10086 Self {
10087 _marker: PiglinBrute,
10088 parent: Default::default(),
10089 }
10090 }
10091}
10092
10093#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10095pub struct IsCelebrating(pub bool);
10096#[derive(Component)]
10127pub struct AbstractRaider;
10128impl AbstractRaider {
10129 fn apply_metadata(
10130 entity: &mut bevy_ecs::system::EntityCommands,
10131 d: EntityDataItem,
10132 ) -> Result<(), UpdateMetadataError> {
10133 match d.index {
10134 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
10135 16 => {
10136 entity.insert(IsCelebrating(d.value.into_boolean()?));
10137 }
10138 _ => {}
10139 }
10140 Ok(())
10141 }
10142}
10143
10144#[derive(Bundle)]
10148pub struct AbstractRaiderMetadataBundle {
10149 _marker: AbstractRaider,
10150 parent: AbstractMonsterMetadataBundle,
10151 is_celebrating: IsCelebrating,
10152}
10153impl Default for AbstractRaiderMetadataBundle {
10154 fn default() -> Self {
10155 Self {
10156 _marker: AbstractRaider,
10157 parent: Default::default(),
10158 is_celebrating: IsCelebrating(false),
10159 }
10160 }
10161}
10162
10163#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10165pub struct PillagerIsChargingCrossbow(pub bool);
10166#[derive(Component)]
10192pub struct Pillager;
10193impl Pillager {
10194 fn apply_metadata(
10195 entity: &mut bevy_ecs::system::EntityCommands,
10196 d: EntityDataItem,
10197 ) -> Result<(), UpdateMetadataError> {
10198 match d.index {
10199 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
10200 17 => {
10201 entity.insert(PillagerIsChargingCrossbow(d.value.into_boolean()?));
10202 }
10203 _ => {}
10204 }
10205 Ok(())
10206 }
10207}
10208
10209#[derive(Bundle)]
10213pub struct PillagerMetadataBundle {
10214 _marker: Pillager,
10215 parent: AbstractRaiderMetadataBundle,
10216 pillager_is_charging_crossbow: PillagerIsChargingCrossbow,
10217}
10218impl Default for PillagerMetadataBundle {
10219 fn default() -> Self {
10220 Self {
10221 _marker: Pillager,
10222 parent: Default::default(),
10223 pillager_is_charging_crossbow: PillagerIsChargingCrossbow(false),
10224 }
10225 }
10226}
10227
10228#[derive(Component)]
10251pub struct Ravager;
10252impl Ravager {
10253 fn apply_metadata(
10254 entity: &mut bevy_ecs::system::EntityCommands,
10255 d: EntityDataItem,
10256 ) -> Result<(), UpdateMetadataError> {
10257 match d.index {
10258 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
10259 _ => {}
10260 }
10261 Ok(())
10262 }
10263}
10264
10265#[derive(Bundle)]
10269pub struct RavagerMetadataBundle {
10270 _marker: Ravager,
10271 parent: AbstractRaiderMetadataBundle,
10272}
10273impl Default for RavagerMetadataBundle {
10274 fn default() -> Self {
10275 Self {
10276 _marker: Ravager,
10277 parent: Default::default(),
10278 }
10279 }
10280}
10281
10282#[derive(Component)]
10305pub struct Vindicator;
10306impl Vindicator {
10307 fn apply_metadata(
10308 entity: &mut bevy_ecs::system::EntityCommands,
10309 d: EntityDataItem,
10310 ) -> Result<(), UpdateMetadataError> {
10311 match d.index {
10312 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
10313 _ => {}
10314 }
10315 Ok(())
10316 }
10317}
10318
10319#[derive(Bundle)]
10323pub struct VindicatorMetadataBundle {
10324 _marker: Vindicator,
10325 parent: AbstractRaiderMetadataBundle,
10326}
10327impl Default for VindicatorMetadataBundle {
10328 fn default() -> Self {
10329 Self {
10330 _marker: Vindicator,
10331 parent: Default::default(),
10332 }
10333 }
10334}
10335
10336#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10338pub struct WitchUsingItem(pub bool);
10339#[derive(Component)]
10364pub struct Witch;
10365impl Witch {
10366 fn apply_metadata(
10367 entity: &mut bevy_ecs::system::EntityCommands,
10368 d: EntityDataItem,
10369 ) -> Result<(), UpdateMetadataError> {
10370 match d.index {
10371 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
10372 17 => {
10373 entity.insert(WitchUsingItem(d.value.into_boolean()?));
10374 }
10375 _ => {}
10376 }
10377 Ok(())
10378 }
10379}
10380
10381#[derive(Bundle)]
10385pub struct WitchMetadataBundle {
10386 _marker: Witch,
10387 parent: AbstractRaiderMetadataBundle,
10388 witch_using_item: WitchUsingItem,
10389}
10390impl Default for WitchMetadataBundle {
10391 fn default() -> Self {
10392 Self {
10393 _marker: Witch,
10394 parent: Default::default(),
10395 witch_using_item: WitchUsingItem(false),
10396 }
10397 }
10398}
10399
10400#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10402pub struct SpellCasting(pub u8);
10403#[derive(Component)]
10430pub struct AbstractSpellcasterIllager;
10431impl AbstractSpellcasterIllager {
10432 fn apply_metadata(
10433 entity: &mut bevy_ecs::system::EntityCommands,
10434 d: EntityDataItem,
10435 ) -> Result<(), UpdateMetadataError> {
10436 match d.index {
10437 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
10438 17 => {
10439 entity.insert(SpellCasting(d.value.into_byte()?));
10440 }
10441 _ => {}
10442 }
10443 Ok(())
10444 }
10445}
10446
10447#[derive(Bundle)]
10451pub struct AbstractSpellcasterIllagerMetadataBundle {
10452 _marker: AbstractSpellcasterIllager,
10453 parent: AbstractRaiderMetadataBundle,
10454 spell_casting: SpellCasting,
10455}
10456impl Default for AbstractSpellcasterIllagerMetadataBundle {
10457 fn default() -> Self {
10458 Self {
10459 _marker: AbstractSpellcasterIllager,
10460 parent: Default::default(),
10461 spell_casting: SpellCasting(0),
10462 }
10463 }
10464}
10465
10466#[derive(Component)]
10490pub struct Evoker;
10491impl Evoker {
10492 fn apply_metadata(
10493 entity: &mut bevy_ecs::system::EntityCommands,
10494 d: EntityDataItem,
10495 ) -> Result<(), UpdateMetadataError> {
10496 match d.index {
10497 0..=17 => AbstractSpellcasterIllager::apply_metadata(entity, d)?,
10498 _ => {}
10499 }
10500 Ok(())
10501 }
10502}
10503
10504#[derive(Bundle)]
10508pub struct EvokerMetadataBundle {
10509 _marker: Evoker,
10510 parent: AbstractSpellcasterIllagerMetadataBundle,
10511}
10512impl Default for EvokerMetadataBundle {
10513 fn default() -> Self {
10514 Self {
10515 _marker: Evoker,
10516 parent: Default::default(),
10517 }
10518 }
10519}
10520
10521#[derive(Component)]
10545pub struct Illusioner;
10546impl Illusioner {
10547 fn apply_metadata(
10548 entity: &mut bevy_ecs::system::EntityCommands,
10549 d: EntityDataItem,
10550 ) -> Result<(), UpdateMetadataError> {
10551 match d.index {
10552 0..=17 => AbstractSpellcasterIllager::apply_metadata(entity, d)?,
10553 _ => {}
10554 }
10555 Ok(())
10556 }
10557}
10558
10559#[derive(Bundle)]
10563pub struct IllusionerMetadataBundle {
10564 _marker: Illusioner,
10565 parent: AbstractSpellcasterIllagerMetadataBundle,
10566}
10567impl Default for IllusionerMetadataBundle {
10568 fn default() -> Self {
10569 Self {
10570 _marker: Illusioner,
10571 parent: Default::default(),
10572 }
10573 }
10574}
10575
10576#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10578pub struct AbstractThrownItemProjectileItemStack(pub ItemStack);
10579#[derive(Component)]
10605pub struct AbstractThrownItemProjectile;
10606impl AbstractThrownItemProjectile {
10607 fn apply_metadata(
10608 entity: &mut bevy_ecs::system::EntityCommands,
10609 d: EntityDataItem,
10610 ) -> Result<(), UpdateMetadataError> {
10611 match d.index {
10612 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
10613 8 => {
10614 entity.insert(AbstractThrownItemProjectileItemStack(
10615 d.value.into_item_stack()?,
10616 ));
10617 }
10618 _ => {}
10619 }
10620 Ok(())
10621 }
10622}
10623
10624#[derive(Bundle)]
10628pub struct AbstractThrownItemProjectileMetadataBundle {
10629 _marker: AbstractThrownItemProjectile,
10630 parent: AbstractEntityMetadataBundle,
10631 abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack,
10632}
10633impl Default for AbstractThrownItemProjectileMetadataBundle {
10634 fn default() -> Self {
10635 Self {
10636 _marker: AbstractThrownItemProjectile,
10637 parent: Default::default(),
10638 abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack(
10639 Default::default(),
10640 ),
10641 }
10642 }
10643}
10644
10645#[derive(Component)]
10664pub struct Egg;
10665impl Egg {
10666 fn apply_metadata(
10667 entity: &mut bevy_ecs::system::EntityCommands,
10668 d: EntityDataItem,
10669 ) -> Result<(), UpdateMetadataError> {
10670 match d.index {
10671 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
10672 _ => {}
10673 }
10674 Ok(())
10675 }
10676}
10677
10678#[derive(Bundle)]
10682pub struct EggMetadataBundle {
10683 _marker: Egg,
10684 parent: AbstractThrownItemProjectileMetadataBundle,
10685}
10686impl Default for EggMetadataBundle {
10687 fn default() -> Self {
10688 Self {
10689 _marker: Egg,
10690 parent: Default::default(),
10691 }
10692 }
10693}
10694
10695#[derive(Component)]
10714pub struct EnderPearl;
10715impl EnderPearl {
10716 fn apply_metadata(
10717 entity: &mut bevy_ecs::system::EntityCommands,
10718 d: EntityDataItem,
10719 ) -> Result<(), UpdateMetadataError> {
10720 match d.index {
10721 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
10722 _ => {}
10723 }
10724 Ok(())
10725 }
10726}
10727
10728#[derive(Bundle)]
10732pub struct EnderPearlMetadataBundle {
10733 _marker: EnderPearl,
10734 parent: AbstractThrownItemProjectileMetadataBundle,
10735}
10736impl Default for EnderPearlMetadataBundle {
10737 fn default() -> Self {
10738 Self {
10739 _marker: EnderPearl,
10740 parent: Default::default(),
10741 }
10742 }
10743}
10744
10745#[derive(Component)]
10764pub struct ExperienceBottle;
10765impl ExperienceBottle {
10766 fn apply_metadata(
10767 entity: &mut bevy_ecs::system::EntityCommands,
10768 d: EntityDataItem,
10769 ) -> Result<(), UpdateMetadataError> {
10770 match d.index {
10771 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
10772 _ => {}
10773 }
10774 Ok(())
10775 }
10776}
10777
10778#[derive(Bundle)]
10782pub struct ExperienceBottleMetadataBundle {
10783 _marker: ExperienceBottle,
10784 parent: AbstractThrownItemProjectileMetadataBundle,
10785}
10786impl Default for ExperienceBottleMetadataBundle {
10787 fn default() -> Self {
10788 Self {
10789 _marker: ExperienceBottle,
10790 parent: Default::default(),
10791 }
10792 }
10793}
10794
10795#[derive(Component)]
10814pub struct LingeringPotion;
10815impl LingeringPotion {
10816 fn apply_metadata(
10817 entity: &mut bevy_ecs::system::EntityCommands,
10818 d: EntityDataItem,
10819 ) -> Result<(), UpdateMetadataError> {
10820 match d.index {
10821 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
10822 _ => {}
10823 }
10824 Ok(())
10825 }
10826}
10827
10828#[derive(Bundle)]
10832pub struct LingeringPotionMetadataBundle {
10833 _marker: LingeringPotion,
10834 parent: AbstractThrownItemProjectileMetadataBundle,
10835}
10836impl Default for LingeringPotionMetadataBundle {
10837 fn default() -> Self {
10838 Self {
10839 _marker: LingeringPotion,
10840 parent: Default::default(),
10841 }
10842 }
10843}
10844
10845#[derive(Component)]
10864pub struct Snowball;
10865impl Snowball {
10866 fn apply_metadata(
10867 entity: &mut bevy_ecs::system::EntityCommands,
10868 d: EntityDataItem,
10869 ) -> Result<(), UpdateMetadataError> {
10870 match d.index {
10871 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
10872 _ => {}
10873 }
10874 Ok(())
10875 }
10876}
10877
10878#[derive(Bundle)]
10882pub struct SnowballMetadataBundle {
10883 _marker: Snowball,
10884 parent: AbstractThrownItemProjectileMetadataBundle,
10885}
10886impl Default for SnowballMetadataBundle {
10887 fn default() -> Self {
10888 Self {
10889 _marker: Snowball,
10890 parent: Default::default(),
10891 }
10892 }
10893}
10894
10895#[derive(Component)]
10914pub struct SplashPotion;
10915impl SplashPotion {
10916 fn apply_metadata(
10917 entity: &mut bevy_ecs::system::EntityCommands,
10918 d: EntityDataItem,
10919 ) -> Result<(), UpdateMetadataError> {
10920 match d.index {
10921 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
10922 _ => {}
10923 }
10924 Ok(())
10925 }
10926}
10927
10928#[derive(Bundle)]
10932pub struct SplashPotionMetadataBundle {
10933 _marker: SplashPotion,
10934 parent: AbstractThrownItemProjectileMetadataBundle,
10935}
10936impl Default for SplashPotionMetadataBundle {
10937 fn default() -> Self {
10938 Self {
10939 _marker: SplashPotion,
10940 parent: Default::default(),
10941 }
10942 }
10943}
10944
10945#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10947pub struct Hurt(pub i32);
10948#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10950pub struct Hurtdir(pub i32);
10951#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10953pub struct Damage(pub f32);
10954#[derive(Component)]
11005pub struct AbstractVehicle;
11006impl AbstractVehicle {
11007 fn apply_metadata(
11008 entity: &mut bevy_ecs::system::EntityCommands,
11009 d: EntityDataItem,
11010 ) -> Result<(), UpdateMetadataError> {
11011 match d.index {
11012 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
11013 8 => {
11014 entity.insert(Hurt(d.value.into_int()?));
11015 }
11016 9 => {
11017 entity.insert(Hurtdir(d.value.into_int()?));
11018 }
11019 10 => {
11020 entity.insert(Damage(d.value.into_float()?));
11021 }
11022 _ => {}
11023 }
11024 Ok(())
11025 }
11026}
11027
11028#[derive(Bundle)]
11032pub struct AbstractVehicleMetadataBundle {
11033 _marker: AbstractVehicle,
11034 parent: AbstractEntityMetadataBundle,
11035 hurt: Hurt,
11036 hurtdir: Hurtdir,
11037 damage: Damage,
11038}
11039impl Default for AbstractVehicleMetadataBundle {
11040 fn default() -> Self {
11041 Self {
11042 _marker: AbstractVehicle,
11043 parent: Default::default(),
11044 hurt: Hurt(0),
11045 hurtdir: Hurtdir(1),
11046 damage: Damage(0.0),
11047 }
11048 }
11049}
11050
11051#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11053pub struct PaddleLeft(pub bool);
11054#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11056pub struct PaddleRight(pub bool);
11057#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11059pub struct BubbleTime(pub i32);
11060#[derive(Component)]
11103pub struct AbstractBoat;
11104impl AbstractBoat {
11105 fn apply_metadata(
11106 entity: &mut bevy_ecs::system::EntityCommands,
11107 d: EntityDataItem,
11108 ) -> Result<(), UpdateMetadataError> {
11109 match d.index {
11110 0..=10 => AbstractVehicle::apply_metadata(entity, d)?,
11111 11 => {
11112 entity.insert(PaddleLeft(d.value.into_boolean()?));
11113 }
11114 12 => {
11115 entity.insert(PaddleRight(d.value.into_boolean()?));
11116 }
11117 13 => {
11118 entity.insert(BubbleTime(d.value.into_int()?));
11119 }
11120 _ => {}
11121 }
11122 Ok(())
11123 }
11124}
11125
11126#[derive(Bundle)]
11130pub struct AbstractBoatMetadataBundle {
11131 _marker: AbstractBoat,
11132 parent: AbstractVehicleMetadataBundle,
11133 paddle_left: PaddleLeft,
11134 paddle_right: PaddleRight,
11135 bubble_time: BubbleTime,
11136}
11137impl Default for AbstractBoatMetadataBundle {
11138 fn default() -> Self {
11139 Self {
11140 _marker: AbstractBoat,
11141 parent: Default::default(),
11142 paddle_left: PaddleLeft(false),
11143 paddle_right: PaddleRight(false),
11144 bubble_time: BubbleTime(0),
11145 }
11146 }
11147}
11148
11149#[derive(Component)]
11169pub struct AcaciaBoat;
11170impl AcaciaBoat {
11171 fn apply_metadata(
11172 entity: &mut bevy_ecs::system::EntityCommands,
11173 d: EntityDataItem,
11174 ) -> Result<(), UpdateMetadataError> {
11175 match d.index {
11176 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11177 _ => {}
11178 }
11179 Ok(())
11180 }
11181}
11182
11183#[derive(Bundle)]
11187pub struct AcaciaBoatMetadataBundle {
11188 _marker: AcaciaBoat,
11189 parent: AbstractBoatMetadataBundle,
11190}
11191impl Default for AcaciaBoatMetadataBundle {
11192 fn default() -> Self {
11193 Self {
11194 _marker: AcaciaBoat,
11195 parent: Default::default(),
11196 }
11197 }
11198}
11199
11200#[derive(Component)]
11220pub struct AcaciaChestBoat;
11221impl AcaciaChestBoat {
11222 fn apply_metadata(
11223 entity: &mut bevy_ecs::system::EntityCommands,
11224 d: EntityDataItem,
11225 ) -> Result<(), UpdateMetadataError> {
11226 match d.index {
11227 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11228 _ => {}
11229 }
11230 Ok(())
11231 }
11232}
11233
11234#[derive(Bundle)]
11238pub struct AcaciaChestBoatMetadataBundle {
11239 _marker: AcaciaChestBoat,
11240 parent: AbstractBoatMetadataBundle,
11241}
11242impl Default for AcaciaChestBoatMetadataBundle {
11243 fn default() -> Self {
11244 Self {
11245 _marker: AcaciaChestBoat,
11246 parent: Default::default(),
11247 }
11248 }
11249}
11250
11251#[derive(Component)]
11271pub struct BambooChestRaft;
11272impl BambooChestRaft {
11273 fn apply_metadata(
11274 entity: &mut bevy_ecs::system::EntityCommands,
11275 d: EntityDataItem,
11276 ) -> Result<(), UpdateMetadataError> {
11277 match d.index {
11278 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11279 _ => {}
11280 }
11281 Ok(())
11282 }
11283}
11284
11285#[derive(Bundle)]
11289pub struct BambooChestRaftMetadataBundle {
11290 _marker: BambooChestRaft,
11291 parent: AbstractBoatMetadataBundle,
11292}
11293impl Default for BambooChestRaftMetadataBundle {
11294 fn default() -> Self {
11295 Self {
11296 _marker: BambooChestRaft,
11297 parent: Default::default(),
11298 }
11299 }
11300}
11301
11302#[derive(Component)]
11322pub struct BambooRaft;
11323impl BambooRaft {
11324 fn apply_metadata(
11325 entity: &mut bevy_ecs::system::EntityCommands,
11326 d: EntityDataItem,
11327 ) -> Result<(), UpdateMetadataError> {
11328 match d.index {
11329 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11330 _ => {}
11331 }
11332 Ok(())
11333 }
11334}
11335
11336#[derive(Bundle)]
11340pub struct BambooRaftMetadataBundle {
11341 _marker: BambooRaft,
11342 parent: AbstractBoatMetadataBundle,
11343}
11344impl Default for BambooRaftMetadataBundle {
11345 fn default() -> Self {
11346 Self {
11347 _marker: BambooRaft,
11348 parent: Default::default(),
11349 }
11350 }
11351}
11352
11353#[derive(Component)]
11373pub struct BirchBoat;
11374impl BirchBoat {
11375 fn apply_metadata(
11376 entity: &mut bevy_ecs::system::EntityCommands,
11377 d: EntityDataItem,
11378 ) -> Result<(), UpdateMetadataError> {
11379 match d.index {
11380 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11381 _ => {}
11382 }
11383 Ok(())
11384 }
11385}
11386
11387#[derive(Bundle)]
11391pub struct BirchBoatMetadataBundle {
11392 _marker: BirchBoat,
11393 parent: AbstractBoatMetadataBundle,
11394}
11395impl Default for BirchBoatMetadataBundle {
11396 fn default() -> Self {
11397 Self {
11398 _marker: BirchBoat,
11399 parent: Default::default(),
11400 }
11401 }
11402}
11403
11404#[derive(Component)]
11424pub struct BirchChestBoat;
11425impl BirchChestBoat {
11426 fn apply_metadata(
11427 entity: &mut bevy_ecs::system::EntityCommands,
11428 d: EntityDataItem,
11429 ) -> Result<(), UpdateMetadataError> {
11430 match d.index {
11431 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11432 _ => {}
11433 }
11434 Ok(())
11435 }
11436}
11437
11438#[derive(Bundle)]
11442pub struct BirchChestBoatMetadataBundle {
11443 _marker: BirchChestBoat,
11444 parent: AbstractBoatMetadataBundle,
11445}
11446impl Default for BirchChestBoatMetadataBundle {
11447 fn default() -> Self {
11448 Self {
11449 _marker: BirchChestBoat,
11450 parent: Default::default(),
11451 }
11452 }
11453}
11454
11455#[derive(Component)]
11475pub struct CherryBoat;
11476impl CherryBoat {
11477 fn apply_metadata(
11478 entity: &mut bevy_ecs::system::EntityCommands,
11479 d: EntityDataItem,
11480 ) -> Result<(), UpdateMetadataError> {
11481 match d.index {
11482 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11483 _ => {}
11484 }
11485 Ok(())
11486 }
11487}
11488
11489#[derive(Bundle)]
11493pub struct CherryBoatMetadataBundle {
11494 _marker: CherryBoat,
11495 parent: AbstractBoatMetadataBundle,
11496}
11497impl Default for CherryBoatMetadataBundle {
11498 fn default() -> Self {
11499 Self {
11500 _marker: CherryBoat,
11501 parent: Default::default(),
11502 }
11503 }
11504}
11505
11506#[derive(Component)]
11526pub struct CherryChestBoat;
11527impl CherryChestBoat {
11528 fn apply_metadata(
11529 entity: &mut bevy_ecs::system::EntityCommands,
11530 d: EntityDataItem,
11531 ) -> Result<(), UpdateMetadataError> {
11532 match d.index {
11533 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11534 _ => {}
11535 }
11536 Ok(())
11537 }
11538}
11539
11540#[derive(Bundle)]
11544pub struct CherryChestBoatMetadataBundle {
11545 _marker: CherryChestBoat,
11546 parent: AbstractBoatMetadataBundle,
11547}
11548impl Default for CherryChestBoatMetadataBundle {
11549 fn default() -> Self {
11550 Self {
11551 _marker: CherryChestBoat,
11552 parent: Default::default(),
11553 }
11554 }
11555}
11556
11557#[derive(Component)]
11577pub struct DarkOakBoat;
11578impl DarkOakBoat {
11579 fn apply_metadata(
11580 entity: &mut bevy_ecs::system::EntityCommands,
11581 d: EntityDataItem,
11582 ) -> Result<(), UpdateMetadataError> {
11583 match d.index {
11584 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11585 _ => {}
11586 }
11587 Ok(())
11588 }
11589}
11590
11591#[derive(Bundle)]
11595pub struct DarkOakBoatMetadataBundle {
11596 _marker: DarkOakBoat,
11597 parent: AbstractBoatMetadataBundle,
11598}
11599impl Default for DarkOakBoatMetadataBundle {
11600 fn default() -> Self {
11601 Self {
11602 _marker: DarkOakBoat,
11603 parent: Default::default(),
11604 }
11605 }
11606}
11607
11608#[derive(Component)]
11628pub struct DarkOakChestBoat;
11629impl DarkOakChestBoat {
11630 fn apply_metadata(
11631 entity: &mut bevy_ecs::system::EntityCommands,
11632 d: EntityDataItem,
11633 ) -> Result<(), UpdateMetadataError> {
11634 match d.index {
11635 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11636 _ => {}
11637 }
11638 Ok(())
11639 }
11640}
11641
11642#[derive(Bundle)]
11646pub struct DarkOakChestBoatMetadataBundle {
11647 _marker: DarkOakChestBoat,
11648 parent: AbstractBoatMetadataBundle,
11649}
11650impl Default for DarkOakChestBoatMetadataBundle {
11651 fn default() -> Self {
11652 Self {
11653 _marker: DarkOakChestBoat,
11654 parent: Default::default(),
11655 }
11656 }
11657}
11658
11659#[derive(Component)]
11679pub struct JungleBoat;
11680impl JungleBoat {
11681 fn apply_metadata(
11682 entity: &mut bevy_ecs::system::EntityCommands,
11683 d: EntityDataItem,
11684 ) -> Result<(), UpdateMetadataError> {
11685 match d.index {
11686 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11687 _ => {}
11688 }
11689 Ok(())
11690 }
11691}
11692
11693#[derive(Bundle)]
11697pub struct JungleBoatMetadataBundle {
11698 _marker: JungleBoat,
11699 parent: AbstractBoatMetadataBundle,
11700}
11701impl Default for JungleBoatMetadataBundle {
11702 fn default() -> Self {
11703 Self {
11704 _marker: JungleBoat,
11705 parent: Default::default(),
11706 }
11707 }
11708}
11709
11710#[derive(Component)]
11730pub struct JungleChestBoat;
11731impl JungleChestBoat {
11732 fn apply_metadata(
11733 entity: &mut bevy_ecs::system::EntityCommands,
11734 d: EntityDataItem,
11735 ) -> Result<(), UpdateMetadataError> {
11736 match d.index {
11737 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11738 _ => {}
11739 }
11740 Ok(())
11741 }
11742}
11743
11744#[derive(Bundle)]
11748pub struct JungleChestBoatMetadataBundle {
11749 _marker: JungleChestBoat,
11750 parent: AbstractBoatMetadataBundle,
11751}
11752impl Default for JungleChestBoatMetadataBundle {
11753 fn default() -> Self {
11754 Self {
11755 _marker: JungleChestBoat,
11756 parent: Default::default(),
11757 }
11758 }
11759}
11760
11761#[derive(Component)]
11781pub struct MangroveBoat;
11782impl MangroveBoat {
11783 fn apply_metadata(
11784 entity: &mut bevy_ecs::system::EntityCommands,
11785 d: EntityDataItem,
11786 ) -> Result<(), UpdateMetadataError> {
11787 match d.index {
11788 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11789 _ => {}
11790 }
11791 Ok(())
11792 }
11793}
11794
11795#[derive(Bundle)]
11799pub struct MangroveBoatMetadataBundle {
11800 _marker: MangroveBoat,
11801 parent: AbstractBoatMetadataBundle,
11802}
11803impl Default for MangroveBoatMetadataBundle {
11804 fn default() -> Self {
11805 Self {
11806 _marker: MangroveBoat,
11807 parent: Default::default(),
11808 }
11809 }
11810}
11811
11812#[derive(Component)]
11832pub struct MangroveChestBoat;
11833impl MangroveChestBoat {
11834 fn apply_metadata(
11835 entity: &mut bevy_ecs::system::EntityCommands,
11836 d: EntityDataItem,
11837 ) -> Result<(), UpdateMetadataError> {
11838 match d.index {
11839 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11840 _ => {}
11841 }
11842 Ok(())
11843 }
11844}
11845
11846#[derive(Bundle)]
11850pub struct MangroveChestBoatMetadataBundle {
11851 _marker: MangroveChestBoat,
11852 parent: AbstractBoatMetadataBundle,
11853}
11854impl Default for MangroveChestBoatMetadataBundle {
11855 fn default() -> Self {
11856 Self {
11857 _marker: MangroveChestBoat,
11858 parent: Default::default(),
11859 }
11860 }
11861}
11862
11863#[derive(Component)]
11883pub struct OakBoat;
11884impl OakBoat {
11885 fn apply_metadata(
11886 entity: &mut bevy_ecs::system::EntityCommands,
11887 d: EntityDataItem,
11888 ) -> Result<(), UpdateMetadataError> {
11889 match d.index {
11890 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11891 _ => {}
11892 }
11893 Ok(())
11894 }
11895}
11896
11897#[derive(Bundle)]
11901pub struct OakBoatMetadataBundle {
11902 _marker: OakBoat,
11903 parent: AbstractBoatMetadataBundle,
11904}
11905impl Default for OakBoatMetadataBundle {
11906 fn default() -> Self {
11907 Self {
11908 _marker: OakBoat,
11909 parent: Default::default(),
11910 }
11911 }
11912}
11913
11914#[derive(Component)]
11934pub struct OakChestBoat;
11935impl OakChestBoat {
11936 fn apply_metadata(
11937 entity: &mut bevy_ecs::system::EntityCommands,
11938 d: EntityDataItem,
11939 ) -> Result<(), UpdateMetadataError> {
11940 match d.index {
11941 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11942 _ => {}
11943 }
11944 Ok(())
11945 }
11946}
11947
11948#[derive(Bundle)]
11952pub struct OakChestBoatMetadataBundle {
11953 _marker: OakChestBoat,
11954 parent: AbstractBoatMetadataBundle,
11955}
11956impl Default for OakChestBoatMetadataBundle {
11957 fn default() -> Self {
11958 Self {
11959 _marker: OakChestBoat,
11960 parent: Default::default(),
11961 }
11962 }
11963}
11964
11965#[derive(Component)]
11985pub struct PaleOakBoat;
11986impl PaleOakBoat {
11987 fn apply_metadata(
11988 entity: &mut bevy_ecs::system::EntityCommands,
11989 d: EntityDataItem,
11990 ) -> Result<(), UpdateMetadataError> {
11991 match d.index {
11992 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11993 _ => {}
11994 }
11995 Ok(())
11996 }
11997}
11998
11999#[derive(Bundle)]
12003pub struct PaleOakBoatMetadataBundle {
12004 _marker: PaleOakBoat,
12005 parent: AbstractBoatMetadataBundle,
12006}
12007impl Default for PaleOakBoatMetadataBundle {
12008 fn default() -> Self {
12009 Self {
12010 _marker: PaleOakBoat,
12011 parent: Default::default(),
12012 }
12013 }
12014}
12015
12016#[derive(Component)]
12036pub struct PaleOakChestBoat;
12037impl PaleOakChestBoat {
12038 fn apply_metadata(
12039 entity: &mut bevy_ecs::system::EntityCommands,
12040 d: EntityDataItem,
12041 ) -> Result<(), UpdateMetadataError> {
12042 match d.index {
12043 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12044 _ => {}
12045 }
12046 Ok(())
12047 }
12048}
12049
12050#[derive(Bundle)]
12054pub struct PaleOakChestBoatMetadataBundle {
12055 _marker: PaleOakChestBoat,
12056 parent: AbstractBoatMetadataBundle,
12057}
12058impl Default for PaleOakChestBoatMetadataBundle {
12059 fn default() -> Self {
12060 Self {
12061 _marker: PaleOakChestBoat,
12062 parent: Default::default(),
12063 }
12064 }
12065}
12066
12067#[derive(Component)]
12087pub struct SpruceBoat;
12088impl SpruceBoat {
12089 fn apply_metadata(
12090 entity: &mut bevy_ecs::system::EntityCommands,
12091 d: EntityDataItem,
12092 ) -> Result<(), UpdateMetadataError> {
12093 match d.index {
12094 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12095 _ => {}
12096 }
12097 Ok(())
12098 }
12099}
12100
12101#[derive(Bundle)]
12105pub struct SpruceBoatMetadataBundle {
12106 _marker: SpruceBoat,
12107 parent: AbstractBoatMetadataBundle,
12108}
12109impl Default for SpruceBoatMetadataBundle {
12110 fn default() -> Self {
12111 Self {
12112 _marker: SpruceBoat,
12113 parent: Default::default(),
12114 }
12115 }
12116}
12117
12118#[derive(Component)]
12138pub struct SpruceChestBoat;
12139impl SpruceChestBoat {
12140 fn apply_metadata(
12141 entity: &mut bevy_ecs::system::EntityCommands,
12142 d: EntityDataItem,
12143 ) -> Result<(), UpdateMetadataError> {
12144 match d.index {
12145 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12146 _ => {}
12147 }
12148 Ok(())
12149 }
12150}
12151
12152#[derive(Bundle)]
12156pub struct SpruceChestBoatMetadataBundle {
12157 _marker: SpruceChestBoat,
12158 parent: AbstractBoatMetadataBundle,
12159}
12160impl Default for SpruceChestBoatMetadataBundle {
12161 fn default() -> Self {
12162 Self {
12163 _marker: SpruceChestBoat,
12164 parent: Default::default(),
12165 }
12166 }
12167}
12168
12169#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12171pub struct CustomDisplayBlock(pub azalea_block::BlockState);
12172#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12174pub struct DisplayOffset(pub i32);
12175#[derive(Component)]
12204pub struct AbstractMinecart;
12205impl AbstractMinecart {
12206 fn apply_metadata(
12207 entity: &mut bevy_ecs::system::EntityCommands,
12208 d: EntityDataItem,
12209 ) -> Result<(), UpdateMetadataError> {
12210 match d.index {
12211 0..=10 => AbstractVehicle::apply_metadata(entity, d)?,
12212 11 => {
12213 entity.insert(CustomDisplayBlock(d.value.into_optional_block_state()?));
12214 }
12215 12 => {
12216 entity.insert(DisplayOffset(d.value.into_int()?));
12217 }
12218 _ => {}
12219 }
12220 Ok(())
12221 }
12222}
12223
12224#[derive(Bundle)]
12228pub struct AbstractMinecartMetadataBundle {
12229 _marker: AbstractMinecart,
12230 parent: AbstractVehicleMetadataBundle,
12231 custom_display_block: CustomDisplayBlock,
12232 display_offset: DisplayOffset,
12233}
12234impl Default for AbstractMinecartMetadataBundle {
12235 fn default() -> Self {
12236 Self {
12237 _marker: AbstractMinecart,
12238 parent: Default::default(),
12239 custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR),
12240 display_offset: DisplayOffset(Default::default()),
12241 }
12242 }
12243}
12244
12245#[derive(Component)]
12265pub struct ChestMinecart;
12266impl ChestMinecart {
12267 fn apply_metadata(
12268 entity: &mut bevy_ecs::system::EntityCommands,
12269 d: EntityDataItem,
12270 ) -> Result<(), UpdateMetadataError> {
12271 match d.index {
12272 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12273 _ => {}
12274 }
12275 Ok(())
12276 }
12277}
12278
12279#[derive(Bundle)]
12283pub struct ChestMinecartMetadataBundle {
12284 _marker: ChestMinecart,
12285 parent: AbstractMinecartMetadataBundle,
12286}
12287impl Default for ChestMinecartMetadataBundle {
12288 fn default() -> Self {
12289 Self {
12290 _marker: ChestMinecart,
12291 parent: Default::default(),
12292 }
12293 }
12294}
12295
12296#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12298pub struct CommandName(pub Box<str>);
12299#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12301pub struct LastOutput(pub Box<FormattedText>);
12302#[derive(Component)]
12327pub struct CommandBlockMinecart;
12328impl CommandBlockMinecart {
12329 fn apply_metadata(
12330 entity: &mut bevy_ecs::system::EntityCommands,
12331 d: EntityDataItem,
12332 ) -> Result<(), UpdateMetadataError> {
12333 match d.index {
12334 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12335 13 => {
12336 entity.insert(CommandName(d.value.into_string()?));
12337 }
12338 14 => {
12339 entity.insert(LastOutput(d.value.into_formatted_text()?));
12340 }
12341 _ => {}
12342 }
12343 Ok(())
12344 }
12345}
12346
12347#[derive(Bundle)]
12351pub struct CommandBlockMinecartMetadataBundle {
12352 _marker: CommandBlockMinecart,
12353 parent: AbstractMinecartMetadataBundle,
12354 command_name: CommandName,
12355 last_output: LastOutput,
12356}
12357impl Default for CommandBlockMinecartMetadataBundle {
12358 fn default() -> Self {
12359 Self {
12360 _marker: CommandBlockMinecart,
12361 parent: Default::default(),
12362 command_name: CommandName("".into()),
12363 last_output: LastOutput(Default::default()),
12364 }
12365 }
12366}
12367
12368#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12370pub struct Fuel(pub bool);
12371#[derive(Component)]
12394pub struct FurnaceMinecart;
12395impl FurnaceMinecart {
12396 fn apply_metadata(
12397 entity: &mut bevy_ecs::system::EntityCommands,
12398 d: EntityDataItem,
12399 ) -> Result<(), UpdateMetadataError> {
12400 match d.index {
12401 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12402 13 => {
12403 entity.insert(Fuel(d.value.into_boolean()?));
12404 }
12405 _ => {}
12406 }
12407 Ok(())
12408 }
12409}
12410
12411#[derive(Bundle)]
12415pub struct FurnaceMinecartMetadataBundle {
12416 _marker: FurnaceMinecart,
12417 parent: AbstractMinecartMetadataBundle,
12418 fuel: Fuel,
12419}
12420impl Default for FurnaceMinecartMetadataBundle {
12421 fn default() -> Self {
12422 Self {
12423 _marker: FurnaceMinecart,
12424 parent: Default::default(),
12425 fuel: Fuel(false),
12426 }
12427 }
12428}
12429
12430#[derive(Component)]
12450pub struct HopperMinecart;
12451impl HopperMinecart {
12452 fn apply_metadata(
12453 entity: &mut bevy_ecs::system::EntityCommands,
12454 d: EntityDataItem,
12455 ) -> Result<(), UpdateMetadataError> {
12456 match d.index {
12457 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12458 _ => {}
12459 }
12460 Ok(())
12461 }
12462}
12463
12464#[derive(Bundle)]
12468pub struct HopperMinecartMetadataBundle {
12469 _marker: HopperMinecart,
12470 parent: AbstractMinecartMetadataBundle,
12471}
12472impl Default for HopperMinecartMetadataBundle {
12473 fn default() -> Self {
12474 Self {
12475 _marker: HopperMinecart,
12476 parent: Default::default(),
12477 }
12478 }
12479}
12480
12481#[derive(Component)]
12501pub struct Minecart;
12502impl Minecart {
12503 fn apply_metadata(
12504 entity: &mut bevy_ecs::system::EntityCommands,
12505 d: EntityDataItem,
12506 ) -> Result<(), UpdateMetadataError> {
12507 match d.index {
12508 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12509 _ => {}
12510 }
12511 Ok(())
12512 }
12513}
12514
12515#[derive(Bundle)]
12519pub struct MinecartMetadataBundle {
12520 _marker: Minecart,
12521 parent: AbstractMinecartMetadataBundle,
12522}
12523impl Default for MinecartMetadataBundle {
12524 fn default() -> Self {
12525 Self {
12526 _marker: Minecart,
12527 parent: Default::default(),
12528 }
12529 }
12530}
12531
12532#[derive(Component)]
12552pub struct SpawnerMinecart;
12553impl SpawnerMinecart {
12554 fn apply_metadata(
12555 entity: &mut bevy_ecs::system::EntityCommands,
12556 d: EntityDataItem,
12557 ) -> Result<(), UpdateMetadataError> {
12558 match d.index {
12559 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12560 _ => {}
12561 }
12562 Ok(())
12563 }
12564}
12565
12566#[derive(Bundle)]
12570pub struct SpawnerMinecartMetadataBundle {
12571 _marker: SpawnerMinecart,
12572 parent: AbstractMinecartMetadataBundle,
12573}
12574impl Default for SpawnerMinecartMetadataBundle {
12575 fn default() -> Self {
12576 Self {
12577 _marker: SpawnerMinecart,
12578 parent: Default::default(),
12579 }
12580 }
12581}
12582
12583#[derive(Component)]
12603pub struct TntMinecart;
12604impl TntMinecart {
12605 fn apply_metadata(
12606 entity: &mut bevy_ecs::system::EntityCommands,
12607 d: EntityDataItem,
12608 ) -> Result<(), UpdateMetadataError> {
12609 match d.index {
12610 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12611 _ => {}
12612 }
12613 Ok(())
12614 }
12615}
12616
12617#[derive(Bundle)]
12621pub struct TntMinecartMetadataBundle {
12622 _marker: TntMinecart,
12623 parent: AbstractMinecartMetadataBundle,
12624}
12625impl Default for TntMinecartMetadataBundle {
12626 fn default() -> Self {
12627 Self {
12628 _marker: TntMinecart,
12629 parent: Default::default(),
12630 }
12631 }
12632}
12633
12634pub fn apply_metadata(
12635 entity: &mut bevy_ecs::system::EntityCommands,
12636 entity_kind: EntityKind,
12637 items: Vec<EntityDataItem>,
12638) -> Result<(), UpdateMetadataError> {
12639 match entity_kind {
12640 EntityKind::AcaciaBoat => {
12641 for d in items {
12642 AcaciaBoat::apply_metadata(entity, d)?;
12643 }
12644 }
12645 EntityKind::AcaciaChestBoat => {
12646 for d in items {
12647 AcaciaChestBoat::apply_metadata(entity, d)?;
12648 }
12649 }
12650 EntityKind::Allay => {
12651 for d in items {
12652 Allay::apply_metadata(entity, d)?;
12653 }
12654 }
12655 EntityKind::AreaEffectCloud => {
12656 for d in items {
12657 AreaEffectCloud::apply_metadata(entity, d)?;
12658 }
12659 }
12660 EntityKind::Armadillo => {
12661 for d in items {
12662 Armadillo::apply_metadata(entity, d)?;
12663 }
12664 }
12665 EntityKind::ArmorStand => {
12666 for d in items {
12667 ArmorStand::apply_metadata(entity, d)?;
12668 }
12669 }
12670 EntityKind::Arrow => {
12671 for d in items {
12672 Arrow::apply_metadata(entity, d)?;
12673 }
12674 }
12675 EntityKind::Axolotl => {
12676 for d in items {
12677 Axolotl::apply_metadata(entity, d)?;
12678 }
12679 }
12680 EntityKind::BambooChestRaft => {
12681 for d in items {
12682 BambooChestRaft::apply_metadata(entity, d)?;
12683 }
12684 }
12685 EntityKind::BambooRaft => {
12686 for d in items {
12687 BambooRaft::apply_metadata(entity, d)?;
12688 }
12689 }
12690 EntityKind::Bat => {
12691 for d in items {
12692 Bat::apply_metadata(entity, d)?;
12693 }
12694 }
12695 EntityKind::Bee => {
12696 for d in items {
12697 Bee::apply_metadata(entity, d)?;
12698 }
12699 }
12700 EntityKind::BirchBoat => {
12701 for d in items {
12702 BirchBoat::apply_metadata(entity, d)?;
12703 }
12704 }
12705 EntityKind::BirchChestBoat => {
12706 for d in items {
12707 BirchChestBoat::apply_metadata(entity, d)?;
12708 }
12709 }
12710 EntityKind::Blaze => {
12711 for d in items {
12712 Blaze::apply_metadata(entity, d)?;
12713 }
12714 }
12715 EntityKind::BlockDisplay => {
12716 for d in items {
12717 BlockDisplay::apply_metadata(entity, d)?;
12718 }
12719 }
12720 EntityKind::Bogged => {
12721 for d in items {
12722 Bogged::apply_metadata(entity, d)?;
12723 }
12724 }
12725 EntityKind::Breeze => {
12726 for d in items {
12727 Breeze::apply_metadata(entity, d)?;
12728 }
12729 }
12730 EntityKind::BreezeWindCharge => {
12731 for d in items {
12732 BreezeWindCharge::apply_metadata(entity, d)?;
12733 }
12734 }
12735 EntityKind::Camel => {
12736 for d in items {
12737 Camel::apply_metadata(entity, d)?;
12738 }
12739 }
12740 EntityKind::CamelHusk => {
12741 for d in items {
12742 CamelHusk::apply_metadata(entity, d)?;
12743 }
12744 }
12745 EntityKind::Cat => {
12746 for d in items {
12747 Cat::apply_metadata(entity, d)?;
12748 }
12749 }
12750 EntityKind::CaveSpider => {
12751 for d in items {
12752 CaveSpider::apply_metadata(entity, d)?;
12753 }
12754 }
12755 EntityKind::CherryBoat => {
12756 for d in items {
12757 CherryBoat::apply_metadata(entity, d)?;
12758 }
12759 }
12760 EntityKind::CherryChestBoat => {
12761 for d in items {
12762 CherryChestBoat::apply_metadata(entity, d)?;
12763 }
12764 }
12765 EntityKind::ChestMinecart => {
12766 for d in items {
12767 ChestMinecart::apply_metadata(entity, d)?;
12768 }
12769 }
12770 EntityKind::Chicken => {
12771 for d in items {
12772 Chicken::apply_metadata(entity, d)?;
12773 }
12774 }
12775 EntityKind::Cod => {
12776 for d in items {
12777 Cod::apply_metadata(entity, d)?;
12778 }
12779 }
12780 EntityKind::CommandBlockMinecart => {
12781 for d in items {
12782 CommandBlockMinecart::apply_metadata(entity, d)?;
12783 }
12784 }
12785 EntityKind::CopperGolem => {
12786 for d in items {
12787 CopperGolem::apply_metadata(entity, d)?;
12788 }
12789 }
12790 EntityKind::Cow => {
12791 for d in items {
12792 Cow::apply_metadata(entity, d)?;
12793 }
12794 }
12795 EntityKind::Creaking => {
12796 for d in items {
12797 Creaking::apply_metadata(entity, d)?;
12798 }
12799 }
12800 EntityKind::Creeper => {
12801 for d in items {
12802 Creeper::apply_metadata(entity, d)?;
12803 }
12804 }
12805 EntityKind::DarkOakBoat => {
12806 for d in items {
12807 DarkOakBoat::apply_metadata(entity, d)?;
12808 }
12809 }
12810 EntityKind::DarkOakChestBoat => {
12811 for d in items {
12812 DarkOakChestBoat::apply_metadata(entity, d)?;
12813 }
12814 }
12815 EntityKind::Dolphin => {
12816 for d in items {
12817 Dolphin::apply_metadata(entity, d)?;
12818 }
12819 }
12820 EntityKind::Donkey => {
12821 for d in items {
12822 Donkey::apply_metadata(entity, d)?;
12823 }
12824 }
12825 EntityKind::DragonFireball => {
12826 for d in items {
12827 DragonFireball::apply_metadata(entity, d)?;
12828 }
12829 }
12830 EntityKind::Drowned => {
12831 for d in items {
12832 Drowned::apply_metadata(entity, d)?;
12833 }
12834 }
12835 EntityKind::Egg => {
12836 for d in items {
12837 Egg::apply_metadata(entity, d)?;
12838 }
12839 }
12840 EntityKind::ElderGuardian => {
12841 for d in items {
12842 ElderGuardian::apply_metadata(entity, d)?;
12843 }
12844 }
12845 EntityKind::EndCrystal => {
12846 for d in items {
12847 EndCrystal::apply_metadata(entity, d)?;
12848 }
12849 }
12850 EntityKind::EnderDragon => {
12851 for d in items {
12852 EnderDragon::apply_metadata(entity, d)?;
12853 }
12854 }
12855 EntityKind::EnderPearl => {
12856 for d in items {
12857 EnderPearl::apply_metadata(entity, d)?;
12858 }
12859 }
12860 EntityKind::Enderman => {
12861 for d in items {
12862 Enderman::apply_metadata(entity, d)?;
12863 }
12864 }
12865 EntityKind::Endermite => {
12866 for d in items {
12867 Endermite::apply_metadata(entity, d)?;
12868 }
12869 }
12870 EntityKind::Evoker => {
12871 for d in items {
12872 Evoker::apply_metadata(entity, d)?;
12873 }
12874 }
12875 EntityKind::EvokerFangs => {
12876 for d in items {
12877 EvokerFangs::apply_metadata(entity, d)?;
12878 }
12879 }
12880 EntityKind::ExperienceBottle => {
12881 for d in items {
12882 ExperienceBottle::apply_metadata(entity, d)?;
12883 }
12884 }
12885 EntityKind::ExperienceOrb => {
12886 for d in items {
12887 ExperienceOrb::apply_metadata(entity, d)?;
12888 }
12889 }
12890 EntityKind::EyeOfEnder => {
12891 for d in items {
12892 EyeOfEnder::apply_metadata(entity, d)?;
12893 }
12894 }
12895 EntityKind::FallingBlock => {
12896 for d in items {
12897 FallingBlock::apply_metadata(entity, d)?;
12898 }
12899 }
12900 EntityKind::Fireball => {
12901 for d in items {
12902 Fireball::apply_metadata(entity, d)?;
12903 }
12904 }
12905 EntityKind::FireworkRocket => {
12906 for d in items {
12907 FireworkRocket::apply_metadata(entity, d)?;
12908 }
12909 }
12910 EntityKind::FishingBobber => {
12911 for d in items {
12912 FishingBobber::apply_metadata(entity, d)?;
12913 }
12914 }
12915 EntityKind::Fox => {
12916 for d in items {
12917 Fox::apply_metadata(entity, d)?;
12918 }
12919 }
12920 EntityKind::Frog => {
12921 for d in items {
12922 Frog::apply_metadata(entity, d)?;
12923 }
12924 }
12925 EntityKind::FurnaceMinecart => {
12926 for d in items {
12927 FurnaceMinecart::apply_metadata(entity, d)?;
12928 }
12929 }
12930 EntityKind::Ghast => {
12931 for d in items {
12932 Ghast::apply_metadata(entity, d)?;
12933 }
12934 }
12935 EntityKind::Giant => {
12936 for d in items {
12937 Giant::apply_metadata(entity, d)?;
12938 }
12939 }
12940 EntityKind::GlowItemFrame => {
12941 for d in items {
12942 GlowItemFrame::apply_metadata(entity, d)?;
12943 }
12944 }
12945 EntityKind::GlowSquid => {
12946 for d in items {
12947 GlowSquid::apply_metadata(entity, d)?;
12948 }
12949 }
12950 EntityKind::Goat => {
12951 for d in items {
12952 Goat::apply_metadata(entity, d)?;
12953 }
12954 }
12955 EntityKind::Guardian => {
12956 for d in items {
12957 Guardian::apply_metadata(entity, d)?;
12958 }
12959 }
12960 EntityKind::HappyGhast => {
12961 for d in items {
12962 HappyGhast::apply_metadata(entity, d)?;
12963 }
12964 }
12965 EntityKind::Hoglin => {
12966 for d in items {
12967 Hoglin::apply_metadata(entity, d)?;
12968 }
12969 }
12970 EntityKind::HopperMinecart => {
12971 for d in items {
12972 HopperMinecart::apply_metadata(entity, d)?;
12973 }
12974 }
12975 EntityKind::Horse => {
12976 for d in items {
12977 Horse::apply_metadata(entity, d)?;
12978 }
12979 }
12980 EntityKind::Husk => {
12981 for d in items {
12982 Husk::apply_metadata(entity, d)?;
12983 }
12984 }
12985 EntityKind::Illusioner => {
12986 for d in items {
12987 Illusioner::apply_metadata(entity, d)?;
12988 }
12989 }
12990 EntityKind::Interaction => {
12991 for d in items {
12992 Interaction::apply_metadata(entity, d)?;
12993 }
12994 }
12995 EntityKind::IronGolem => {
12996 for d in items {
12997 IronGolem::apply_metadata(entity, d)?;
12998 }
12999 }
13000 EntityKind::Item => {
13001 for d in items {
13002 Item::apply_metadata(entity, d)?;
13003 }
13004 }
13005 EntityKind::ItemDisplay => {
13006 for d in items {
13007 ItemDisplay::apply_metadata(entity, d)?;
13008 }
13009 }
13010 EntityKind::ItemFrame => {
13011 for d in items {
13012 ItemFrame::apply_metadata(entity, d)?;
13013 }
13014 }
13015 EntityKind::JungleBoat => {
13016 for d in items {
13017 JungleBoat::apply_metadata(entity, d)?;
13018 }
13019 }
13020 EntityKind::JungleChestBoat => {
13021 for d in items {
13022 JungleChestBoat::apply_metadata(entity, d)?;
13023 }
13024 }
13025 EntityKind::LeashKnot => {
13026 for d in items {
13027 LeashKnot::apply_metadata(entity, d)?;
13028 }
13029 }
13030 EntityKind::LightningBolt => {
13031 for d in items {
13032 LightningBolt::apply_metadata(entity, d)?;
13033 }
13034 }
13035 EntityKind::LingeringPotion => {
13036 for d in items {
13037 LingeringPotion::apply_metadata(entity, d)?;
13038 }
13039 }
13040 EntityKind::Llama => {
13041 for d in items {
13042 Llama::apply_metadata(entity, d)?;
13043 }
13044 }
13045 EntityKind::LlamaSpit => {
13046 for d in items {
13047 LlamaSpit::apply_metadata(entity, d)?;
13048 }
13049 }
13050 EntityKind::MagmaCube => {
13051 for d in items {
13052 MagmaCube::apply_metadata(entity, d)?;
13053 }
13054 }
13055 EntityKind::MangroveBoat => {
13056 for d in items {
13057 MangroveBoat::apply_metadata(entity, d)?;
13058 }
13059 }
13060 EntityKind::MangroveChestBoat => {
13061 for d in items {
13062 MangroveChestBoat::apply_metadata(entity, d)?;
13063 }
13064 }
13065 EntityKind::Mannequin => {
13066 for d in items {
13067 Mannequin::apply_metadata(entity, d)?;
13068 }
13069 }
13070 EntityKind::Marker => {
13071 for d in items {
13072 Marker::apply_metadata(entity, d)?;
13073 }
13074 }
13075 EntityKind::Minecart => {
13076 for d in items {
13077 Minecart::apply_metadata(entity, d)?;
13078 }
13079 }
13080 EntityKind::Mooshroom => {
13081 for d in items {
13082 Mooshroom::apply_metadata(entity, d)?;
13083 }
13084 }
13085 EntityKind::Mule => {
13086 for d in items {
13087 Mule::apply_metadata(entity, d)?;
13088 }
13089 }
13090 EntityKind::Nautilus => {
13091 for d in items {
13092 Nautilus::apply_metadata(entity, d)?;
13093 }
13094 }
13095 EntityKind::OakBoat => {
13096 for d in items {
13097 OakBoat::apply_metadata(entity, d)?;
13098 }
13099 }
13100 EntityKind::OakChestBoat => {
13101 for d in items {
13102 OakChestBoat::apply_metadata(entity, d)?;
13103 }
13104 }
13105 EntityKind::Ocelot => {
13106 for d in items {
13107 Ocelot::apply_metadata(entity, d)?;
13108 }
13109 }
13110 EntityKind::OminousItemSpawner => {
13111 for d in items {
13112 OminousItemSpawner::apply_metadata(entity, d)?;
13113 }
13114 }
13115 EntityKind::Painting => {
13116 for d in items {
13117 Painting::apply_metadata(entity, d)?;
13118 }
13119 }
13120 EntityKind::PaleOakBoat => {
13121 for d in items {
13122 PaleOakBoat::apply_metadata(entity, d)?;
13123 }
13124 }
13125 EntityKind::PaleOakChestBoat => {
13126 for d in items {
13127 PaleOakChestBoat::apply_metadata(entity, d)?;
13128 }
13129 }
13130 EntityKind::Panda => {
13131 for d in items {
13132 Panda::apply_metadata(entity, d)?;
13133 }
13134 }
13135 EntityKind::Parched => {
13136 for d in items {
13137 Parched::apply_metadata(entity, d)?;
13138 }
13139 }
13140 EntityKind::Parrot => {
13141 for d in items {
13142 Parrot::apply_metadata(entity, d)?;
13143 }
13144 }
13145 EntityKind::Phantom => {
13146 for d in items {
13147 Phantom::apply_metadata(entity, d)?;
13148 }
13149 }
13150 EntityKind::Pig => {
13151 for d in items {
13152 Pig::apply_metadata(entity, d)?;
13153 }
13154 }
13155 EntityKind::Piglin => {
13156 for d in items {
13157 Piglin::apply_metadata(entity, d)?;
13158 }
13159 }
13160 EntityKind::PiglinBrute => {
13161 for d in items {
13162 PiglinBrute::apply_metadata(entity, d)?;
13163 }
13164 }
13165 EntityKind::Pillager => {
13166 for d in items {
13167 Pillager::apply_metadata(entity, d)?;
13168 }
13169 }
13170 EntityKind::Player => {
13171 for d in items {
13172 Player::apply_metadata(entity, d)?;
13173 }
13174 }
13175 EntityKind::PolarBear => {
13176 for d in items {
13177 PolarBear::apply_metadata(entity, d)?;
13178 }
13179 }
13180 EntityKind::Pufferfish => {
13181 for d in items {
13182 Pufferfish::apply_metadata(entity, d)?;
13183 }
13184 }
13185 EntityKind::Rabbit => {
13186 for d in items {
13187 Rabbit::apply_metadata(entity, d)?;
13188 }
13189 }
13190 EntityKind::Ravager => {
13191 for d in items {
13192 Ravager::apply_metadata(entity, d)?;
13193 }
13194 }
13195 EntityKind::Salmon => {
13196 for d in items {
13197 Salmon::apply_metadata(entity, d)?;
13198 }
13199 }
13200 EntityKind::Sheep => {
13201 for d in items {
13202 Sheep::apply_metadata(entity, d)?;
13203 }
13204 }
13205 EntityKind::Shulker => {
13206 for d in items {
13207 Shulker::apply_metadata(entity, d)?;
13208 }
13209 }
13210 EntityKind::ShulkerBullet => {
13211 for d in items {
13212 ShulkerBullet::apply_metadata(entity, d)?;
13213 }
13214 }
13215 EntityKind::Silverfish => {
13216 for d in items {
13217 Silverfish::apply_metadata(entity, d)?;
13218 }
13219 }
13220 EntityKind::Skeleton => {
13221 for d in items {
13222 Skeleton::apply_metadata(entity, d)?;
13223 }
13224 }
13225 EntityKind::SkeletonHorse => {
13226 for d in items {
13227 SkeletonHorse::apply_metadata(entity, d)?;
13228 }
13229 }
13230 EntityKind::Slime => {
13231 for d in items {
13232 Slime::apply_metadata(entity, d)?;
13233 }
13234 }
13235 EntityKind::SmallFireball => {
13236 for d in items {
13237 SmallFireball::apply_metadata(entity, d)?;
13238 }
13239 }
13240 EntityKind::Sniffer => {
13241 for d in items {
13242 Sniffer::apply_metadata(entity, d)?;
13243 }
13244 }
13245 EntityKind::SnowGolem => {
13246 for d in items {
13247 SnowGolem::apply_metadata(entity, d)?;
13248 }
13249 }
13250 EntityKind::Snowball => {
13251 for d in items {
13252 Snowball::apply_metadata(entity, d)?;
13253 }
13254 }
13255 EntityKind::SpawnerMinecart => {
13256 for d in items {
13257 SpawnerMinecart::apply_metadata(entity, d)?;
13258 }
13259 }
13260 EntityKind::SpectralArrow => {
13261 for d in items {
13262 SpectralArrow::apply_metadata(entity, d)?;
13263 }
13264 }
13265 EntityKind::Spider => {
13266 for d in items {
13267 Spider::apply_metadata(entity, d)?;
13268 }
13269 }
13270 EntityKind::SplashPotion => {
13271 for d in items {
13272 SplashPotion::apply_metadata(entity, d)?;
13273 }
13274 }
13275 EntityKind::SpruceBoat => {
13276 for d in items {
13277 SpruceBoat::apply_metadata(entity, d)?;
13278 }
13279 }
13280 EntityKind::SpruceChestBoat => {
13281 for d in items {
13282 SpruceChestBoat::apply_metadata(entity, d)?;
13283 }
13284 }
13285 EntityKind::Squid => {
13286 for d in items {
13287 Squid::apply_metadata(entity, d)?;
13288 }
13289 }
13290 EntityKind::Stray => {
13291 for d in items {
13292 Stray::apply_metadata(entity, d)?;
13293 }
13294 }
13295 EntityKind::Strider => {
13296 for d in items {
13297 Strider::apply_metadata(entity, d)?;
13298 }
13299 }
13300 EntityKind::Tadpole => {
13301 for d in items {
13302 Tadpole::apply_metadata(entity, d)?;
13303 }
13304 }
13305 EntityKind::TextDisplay => {
13306 for d in items {
13307 TextDisplay::apply_metadata(entity, d)?;
13308 }
13309 }
13310 EntityKind::Tnt => {
13311 for d in items {
13312 Tnt::apply_metadata(entity, d)?;
13313 }
13314 }
13315 EntityKind::TntMinecart => {
13316 for d in items {
13317 TntMinecart::apply_metadata(entity, d)?;
13318 }
13319 }
13320 EntityKind::TraderLlama => {
13321 for d in items {
13322 TraderLlama::apply_metadata(entity, d)?;
13323 }
13324 }
13325 EntityKind::Trident => {
13326 for d in items {
13327 Trident::apply_metadata(entity, d)?;
13328 }
13329 }
13330 EntityKind::TropicalFish => {
13331 for d in items {
13332 TropicalFish::apply_metadata(entity, d)?;
13333 }
13334 }
13335 EntityKind::Turtle => {
13336 for d in items {
13337 Turtle::apply_metadata(entity, d)?;
13338 }
13339 }
13340 EntityKind::Vex => {
13341 for d in items {
13342 Vex::apply_metadata(entity, d)?;
13343 }
13344 }
13345 EntityKind::Villager => {
13346 for d in items {
13347 Villager::apply_metadata(entity, d)?;
13348 }
13349 }
13350 EntityKind::Vindicator => {
13351 for d in items {
13352 Vindicator::apply_metadata(entity, d)?;
13353 }
13354 }
13355 EntityKind::WanderingTrader => {
13356 for d in items {
13357 WanderingTrader::apply_metadata(entity, d)?;
13358 }
13359 }
13360 EntityKind::Warden => {
13361 for d in items {
13362 Warden::apply_metadata(entity, d)?;
13363 }
13364 }
13365 EntityKind::WindCharge => {
13366 for d in items {
13367 WindCharge::apply_metadata(entity, d)?;
13368 }
13369 }
13370 EntityKind::Witch => {
13371 for d in items {
13372 Witch::apply_metadata(entity, d)?;
13373 }
13374 }
13375 EntityKind::Wither => {
13376 for d in items {
13377 Wither::apply_metadata(entity, d)?;
13378 }
13379 }
13380 EntityKind::WitherSkeleton => {
13381 for d in items {
13382 WitherSkeleton::apply_metadata(entity, d)?;
13383 }
13384 }
13385 EntityKind::WitherSkull => {
13386 for d in items {
13387 WitherSkull::apply_metadata(entity, d)?;
13388 }
13389 }
13390 EntityKind::Wolf => {
13391 for d in items {
13392 Wolf::apply_metadata(entity, d)?;
13393 }
13394 }
13395 EntityKind::Zoglin => {
13396 for d in items {
13397 Zoglin::apply_metadata(entity, d)?;
13398 }
13399 }
13400 EntityKind::Zombie => {
13401 for d in items {
13402 Zombie::apply_metadata(entity, d)?;
13403 }
13404 }
13405 EntityKind::ZombieHorse => {
13406 for d in items {
13407 ZombieHorse::apply_metadata(entity, d)?;
13408 }
13409 }
13410 EntityKind::ZombieNautilus => {
13411 for d in items {
13412 ZombieNautilus::apply_metadata(entity, d)?;
13413 }
13414 }
13415 EntityKind::ZombieVillager => {
13416 for d in items {
13417 ZombieVillager::apply_metadata(entity, d)?;
13418 }
13419 }
13420 EntityKind::ZombifiedPiglin => {
13421 for d in items {
13422 ZombifiedPiglin::apply_metadata(entity, d)?;
13423 }
13424 }
13425 }
13426 Ok(())
13427}
13428
13429pub fn apply_default_metadata(entity: &mut bevy_ecs::system::EntityCommands, kind: EntityKind) {
13430 match kind {
13431 EntityKind::AcaciaBoat => {
13432 entity.insert(AcaciaBoatMetadataBundle::default());
13433 }
13434 EntityKind::AcaciaChestBoat => {
13435 entity.insert(AcaciaChestBoatMetadataBundle::default());
13436 }
13437 EntityKind::Allay => {
13438 entity.insert(AllayMetadataBundle::default());
13439 }
13440 EntityKind::AreaEffectCloud => {
13441 entity.insert(AreaEffectCloudMetadataBundle::default());
13442 }
13443 EntityKind::Armadillo => {
13444 entity.insert(ArmadilloMetadataBundle::default());
13445 }
13446 EntityKind::ArmorStand => {
13447 entity.insert(ArmorStandMetadataBundle::default());
13448 }
13449 EntityKind::Arrow => {
13450 entity.insert(ArrowMetadataBundle::default());
13451 }
13452 EntityKind::Axolotl => {
13453 entity.insert(AxolotlMetadataBundle::default());
13454 }
13455 EntityKind::BambooChestRaft => {
13456 entity.insert(BambooChestRaftMetadataBundle::default());
13457 }
13458 EntityKind::BambooRaft => {
13459 entity.insert(BambooRaftMetadataBundle::default());
13460 }
13461 EntityKind::Bat => {
13462 entity.insert(BatMetadataBundle::default());
13463 }
13464 EntityKind::Bee => {
13465 entity.insert(BeeMetadataBundle::default());
13466 }
13467 EntityKind::BirchBoat => {
13468 entity.insert(BirchBoatMetadataBundle::default());
13469 }
13470 EntityKind::BirchChestBoat => {
13471 entity.insert(BirchChestBoatMetadataBundle::default());
13472 }
13473 EntityKind::Blaze => {
13474 entity.insert(BlazeMetadataBundle::default());
13475 }
13476 EntityKind::BlockDisplay => {
13477 entity.insert(BlockDisplayMetadataBundle::default());
13478 }
13479 EntityKind::Bogged => {
13480 entity.insert(BoggedMetadataBundle::default());
13481 }
13482 EntityKind::Breeze => {
13483 entity.insert(BreezeMetadataBundle::default());
13484 }
13485 EntityKind::BreezeWindCharge => {
13486 entity.insert(BreezeWindChargeMetadataBundle::default());
13487 }
13488 EntityKind::Camel => {
13489 entity.insert(CamelMetadataBundle::default());
13490 }
13491 EntityKind::CamelHusk => {
13492 entity.insert(CamelHuskMetadataBundle::default());
13493 }
13494 EntityKind::Cat => {
13495 entity.insert(CatMetadataBundle::default());
13496 }
13497 EntityKind::CaveSpider => {
13498 entity.insert(CaveSpiderMetadataBundle::default());
13499 }
13500 EntityKind::CherryBoat => {
13501 entity.insert(CherryBoatMetadataBundle::default());
13502 }
13503 EntityKind::CherryChestBoat => {
13504 entity.insert(CherryChestBoatMetadataBundle::default());
13505 }
13506 EntityKind::ChestMinecart => {
13507 entity.insert(ChestMinecartMetadataBundle::default());
13508 }
13509 EntityKind::Chicken => {
13510 entity.insert(ChickenMetadataBundle::default());
13511 }
13512 EntityKind::Cod => {
13513 entity.insert(CodMetadataBundle::default());
13514 }
13515 EntityKind::CommandBlockMinecart => {
13516 entity.insert(CommandBlockMinecartMetadataBundle::default());
13517 }
13518 EntityKind::CopperGolem => {
13519 entity.insert(CopperGolemMetadataBundle::default());
13520 }
13521 EntityKind::Cow => {
13522 entity.insert(CowMetadataBundle::default());
13523 }
13524 EntityKind::Creaking => {
13525 entity.insert(CreakingMetadataBundle::default());
13526 }
13527 EntityKind::Creeper => {
13528 entity.insert(CreeperMetadataBundle::default());
13529 }
13530 EntityKind::DarkOakBoat => {
13531 entity.insert(DarkOakBoatMetadataBundle::default());
13532 }
13533 EntityKind::DarkOakChestBoat => {
13534 entity.insert(DarkOakChestBoatMetadataBundle::default());
13535 }
13536 EntityKind::Dolphin => {
13537 entity.insert(DolphinMetadataBundle::default());
13538 }
13539 EntityKind::Donkey => {
13540 entity.insert(DonkeyMetadataBundle::default());
13541 }
13542 EntityKind::DragonFireball => {
13543 entity.insert(DragonFireballMetadataBundle::default());
13544 }
13545 EntityKind::Drowned => {
13546 entity.insert(DrownedMetadataBundle::default());
13547 }
13548 EntityKind::Egg => {
13549 entity.insert(EggMetadataBundle::default());
13550 }
13551 EntityKind::ElderGuardian => {
13552 entity.insert(ElderGuardianMetadataBundle::default());
13553 }
13554 EntityKind::EndCrystal => {
13555 entity.insert(EndCrystalMetadataBundle::default());
13556 }
13557 EntityKind::EnderDragon => {
13558 entity.insert(EnderDragonMetadataBundle::default());
13559 }
13560 EntityKind::EnderPearl => {
13561 entity.insert(EnderPearlMetadataBundle::default());
13562 }
13563 EntityKind::Enderman => {
13564 entity.insert(EndermanMetadataBundle::default());
13565 }
13566 EntityKind::Endermite => {
13567 entity.insert(EndermiteMetadataBundle::default());
13568 }
13569 EntityKind::Evoker => {
13570 entity.insert(EvokerMetadataBundle::default());
13571 }
13572 EntityKind::EvokerFangs => {
13573 entity.insert(EvokerFangsMetadataBundle::default());
13574 }
13575 EntityKind::ExperienceBottle => {
13576 entity.insert(ExperienceBottleMetadataBundle::default());
13577 }
13578 EntityKind::ExperienceOrb => {
13579 entity.insert(ExperienceOrbMetadataBundle::default());
13580 }
13581 EntityKind::EyeOfEnder => {
13582 entity.insert(EyeOfEnderMetadataBundle::default());
13583 }
13584 EntityKind::FallingBlock => {
13585 entity.insert(FallingBlockMetadataBundle::default());
13586 }
13587 EntityKind::Fireball => {
13588 entity.insert(FireballMetadataBundle::default());
13589 }
13590 EntityKind::FireworkRocket => {
13591 entity.insert(FireworkRocketMetadataBundle::default());
13592 }
13593 EntityKind::FishingBobber => {
13594 entity.insert(FishingBobberMetadataBundle::default());
13595 }
13596 EntityKind::Fox => {
13597 entity.insert(FoxMetadataBundle::default());
13598 }
13599 EntityKind::Frog => {
13600 entity.insert(FrogMetadataBundle::default());
13601 }
13602 EntityKind::FurnaceMinecart => {
13603 entity.insert(FurnaceMinecartMetadataBundle::default());
13604 }
13605 EntityKind::Ghast => {
13606 entity.insert(GhastMetadataBundle::default());
13607 }
13608 EntityKind::Giant => {
13609 entity.insert(GiantMetadataBundle::default());
13610 }
13611 EntityKind::GlowItemFrame => {
13612 entity.insert(GlowItemFrameMetadataBundle::default());
13613 }
13614 EntityKind::GlowSquid => {
13615 entity.insert(GlowSquidMetadataBundle::default());
13616 }
13617 EntityKind::Goat => {
13618 entity.insert(GoatMetadataBundle::default());
13619 }
13620 EntityKind::Guardian => {
13621 entity.insert(GuardianMetadataBundle::default());
13622 }
13623 EntityKind::HappyGhast => {
13624 entity.insert(HappyGhastMetadataBundle::default());
13625 }
13626 EntityKind::Hoglin => {
13627 entity.insert(HoglinMetadataBundle::default());
13628 }
13629 EntityKind::HopperMinecart => {
13630 entity.insert(HopperMinecartMetadataBundle::default());
13631 }
13632 EntityKind::Horse => {
13633 entity.insert(HorseMetadataBundle::default());
13634 }
13635 EntityKind::Husk => {
13636 entity.insert(HuskMetadataBundle::default());
13637 }
13638 EntityKind::Illusioner => {
13639 entity.insert(IllusionerMetadataBundle::default());
13640 }
13641 EntityKind::Interaction => {
13642 entity.insert(InteractionMetadataBundle::default());
13643 }
13644 EntityKind::IronGolem => {
13645 entity.insert(IronGolemMetadataBundle::default());
13646 }
13647 EntityKind::Item => {
13648 entity.insert(ItemMetadataBundle::default());
13649 }
13650 EntityKind::ItemDisplay => {
13651 entity.insert(ItemDisplayMetadataBundle::default());
13652 }
13653 EntityKind::ItemFrame => {
13654 entity.insert(ItemFrameMetadataBundle::default());
13655 }
13656 EntityKind::JungleBoat => {
13657 entity.insert(JungleBoatMetadataBundle::default());
13658 }
13659 EntityKind::JungleChestBoat => {
13660 entity.insert(JungleChestBoatMetadataBundle::default());
13661 }
13662 EntityKind::LeashKnot => {
13663 entity.insert(LeashKnotMetadataBundle::default());
13664 }
13665 EntityKind::LightningBolt => {
13666 entity.insert(LightningBoltMetadataBundle::default());
13667 }
13668 EntityKind::LingeringPotion => {
13669 entity.insert(LingeringPotionMetadataBundle::default());
13670 }
13671 EntityKind::Llama => {
13672 entity.insert(LlamaMetadataBundle::default());
13673 }
13674 EntityKind::LlamaSpit => {
13675 entity.insert(LlamaSpitMetadataBundle::default());
13676 }
13677 EntityKind::MagmaCube => {
13678 entity.insert(MagmaCubeMetadataBundle::default());
13679 }
13680 EntityKind::MangroveBoat => {
13681 entity.insert(MangroveBoatMetadataBundle::default());
13682 }
13683 EntityKind::MangroveChestBoat => {
13684 entity.insert(MangroveChestBoatMetadataBundle::default());
13685 }
13686 EntityKind::Mannequin => {
13687 entity.insert(MannequinMetadataBundle::default());
13688 }
13689 EntityKind::Marker => {
13690 entity.insert(MarkerMetadataBundle::default());
13691 }
13692 EntityKind::Minecart => {
13693 entity.insert(MinecartMetadataBundle::default());
13694 }
13695 EntityKind::Mooshroom => {
13696 entity.insert(MooshroomMetadataBundle::default());
13697 }
13698 EntityKind::Mule => {
13699 entity.insert(MuleMetadataBundle::default());
13700 }
13701 EntityKind::Nautilus => {
13702 entity.insert(NautilusMetadataBundle::default());
13703 }
13704 EntityKind::OakBoat => {
13705 entity.insert(OakBoatMetadataBundle::default());
13706 }
13707 EntityKind::OakChestBoat => {
13708 entity.insert(OakChestBoatMetadataBundle::default());
13709 }
13710 EntityKind::Ocelot => {
13711 entity.insert(OcelotMetadataBundle::default());
13712 }
13713 EntityKind::OminousItemSpawner => {
13714 entity.insert(OminousItemSpawnerMetadataBundle::default());
13715 }
13716 EntityKind::Painting => {
13717 entity.insert(PaintingMetadataBundle::default());
13718 }
13719 EntityKind::PaleOakBoat => {
13720 entity.insert(PaleOakBoatMetadataBundle::default());
13721 }
13722 EntityKind::PaleOakChestBoat => {
13723 entity.insert(PaleOakChestBoatMetadataBundle::default());
13724 }
13725 EntityKind::Panda => {
13726 entity.insert(PandaMetadataBundle::default());
13727 }
13728 EntityKind::Parched => {
13729 entity.insert(ParchedMetadataBundle::default());
13730 }
13731 EntityKind::Parrot => {
13732 entity.insert(ParrotMetadataBundle::default());
13733 }
13734 EntityKind::Phantom => {
13735 entity.insert(PhantomMetadataBundle::default());
13736 }
13737 EntityKind::Pig => {
13738 entity.insert(PigMetadataBundle::default());
13739 }
13740 EntityKind::Piglin => {
13741 entity.insert(PiglinMetadataBundle::default());
13742 }
13743 EntityKind::PiglinBrute => {
13744 entity.insert(PiglinBruteMetadataBundle::default());
13745 }
13746 EntityKind::Pillager => {
13747 entity.insert(PillagerMetadataBundle::default());
13748 }
13749 EntityKind::Player => {
13750 entity.insert(PlayerMetadataBundle::default());
13751 }
13752 EntityKind::PolarBear => {
13753 entity.insert(PolarBearMetadataBundle::default());
13754 }
13755 EntityKind::Pufferfish => {
13756 entity.insert(PufferfishMetadataBundle::default());
13757 }
13758 EntityKind::Rabbit => {
13759 entity.insert(RabbitMetadataBundle::default());
13760 }
13761 EntityKind::Ravager => {
13762 entity.insert(RavagerMetadataBundle::default());
13763 }
13764 EntityKind::Salmon => {
13765 entity.insert(SalmonMetadataBundle::default());
13766 }
13767 EntityKind::Sheep => {
13768 entity.insert(SheepMetadataBundle::default());
13769 }
13770 EntityKind::Shulker => {
13771 entity.insert(ShulkerMetadataBundle::default());
13772 }
13773 EntityKind::ShulkerBullet => {
13774 entity.insert(ShulkerBulletMetadataBundle::default());
13775 }
13776 EntityKind::Silverfish => {
13777 entity.insert(SilverfishMetadataBundle::default());
13778 }
13779 EntityKind::Skeleton => {
13780 entity.insert(SkeletonMetadataBundle::default());
13781 }
13782 EntityKind::SkeletonHorse => {
13783 entity.insert(SkeletonHorseMetadataBundle::default());
13784 }
13785 EntityKind::Slime => {
13786 entity.insert(SlimeMetadataBundle::default());
13787 }
13788 EntityKind::SmallFireball => {
13789 entity.insert(SmallFireballMetadataBundle::default());
13790 }
13791 EntityKind::Sniffer => {
13792 entity.insert(SnifferMetadataBundle::default());
13793 }
13794 EntityKind::SnowGolem => {
13795 entity.insert(SnowGolemMetadataBundle::default());
13796 }
13797 EntityKind::Snowball => {
13798 entity.insert(SnowballMetadataBundle::default());
13799 }
13800 EntityKind::SpawnerMinecart => {
13801 entity.insert(SpawnerMinecartMetadataBundle::default());
13802 }
13803 EntityKind::SpectralArrow => {
13804 entity.insert(SpectralArrowMetadataBundle::default());
13805 }
13806 EntityKind::Spider => {
13807 entity.insert(SpiderMetadataBundle::default());
13808 }
13809 EntityKind::SplashPotion => {
13810 entity.insert(SplashPotionMetadataBundle::default());
13811 }
13812 EntityKind::SpruceBoat => {
13813 entity.insert(SpruceBoatMetadataBundle::default());
13814 }
13815 EntityKind::SpruceChestBoat => {
13816 entity.insert(SpruceChestBoatMetadataBundle::default());
13817 }
13818 EntityKind::Squid => {
13819 entity.insert(SquidMetadataBundle::default());
13820 }
13821 EntityKind::Stray => {
13822 entity.insert(StrayMetadataBundle::default());
13823 }
13824 EntityKind::Strider => {
13825 entity.insert(StriderMetadataBundle::default());
13826 }
13827 EntityKind::Tadpole => {
13828 entity.insert(TadpoleMetadataBundle::default());
13829 }
13830 EntityKind::TextDisplay => {
13831 entity.insert(TextDisplayMetadataBundle::default());
13832 }
13833 EntityKind::Tnt => {
13834 entity.insert(TntMetadataBundle::default());
13835 }
13836 EntityKind::TntMinecart => {
13837 entity.insert(TntMinecartMetadataBundle::default());
13838 }
13839 EntityKind::TraderLlama => {
13840 entity.insert(TraderLlamaMetadataBundle::default());
13841 }
13842 EntityKind::Trident => {
13843 entity.insert(TridentMetadataBundle::default());
13844 }
13845 EntityKind::TropicalFish => {
13846 entity.insert(TropicalFishMetadataBundle::default());
13847 }
13848 EntityKind::Turtle => {
13849 entity.insert(TurtleMetadataBundle::default());
13850 }
13851 EntityKind::Vex => {
13852 entity.insert(VexMetadataBundle::default());
13853 }
13854 EntityKind::Villager => {
13855 entity.insert(VillagerMetadataBundle::default());
13856 }
13857 EntityKind::Vindicator => {
13858 entity.insert(VindicatorMetadataBundle::default());
13859 }
13860 EntityKind::WanderingTrader => {
13861 entity.insert(WanderingTraderMetadataBundle::default());
13862 }
13863 EntityKind::Warden => {
13864 entity.insert(WardenMetadataBundle::default());
13865 }
13866 EntityKind::WindCharge => {
13867 entity.insert(WindChargeMetadataBundle::default());
13868 }
13869 EntityKind::Witch => {
13870 entity.insert(WitchMetadataBundle::default());
13871 }
13872 EntityKind::Wither => {
13873 entity.insert(WitherMetadataBundle::default());
13874 }
13875 EntityKind::WitherSkeleton => {
13876 entity.insert(WitherSkeletonMetadataBundle::default());
13877 }
13878 EntityKind::WitherSkull => {
13879 entity.insert(WitherSkullMetadataBundle::default());
13880 }
13881 EntityKind::Wolf => {
13882 entity.insert(WolfMetadataBundle::default());
13883 }
13884 EntityKind::Zoglin => {
13885 entity.insert(ZoglinMetadataBundle::default());
13886 }
13887 EntityKind::Zombie => {
13888 entity.insert(ZombieMetadataBundle::default());
13889 }
13890 EntityKind::ZombieHorse => {
13891 entity.insert(ZombieHorseMetadataBundle::default());
13892 }
13893 EntityKind::ZombieNautilus => {
13894 entity.insert(ZombieNautilusMetadataBundle::default());
13895 }
13896 EntityKind::ZombieVillager => {
13897 entity.insert(ZombieVillagerMetadataBundle::default());
13898 }
13899 EntityKind::ZombifiedPiglin => {
13900 entity.insert(ZombifiedPiglinMetadataBundle::default());
13901 }
13902 }
13903}