1#![allow(clippy::single_match, non_snake_case)]
198
199use azalea_chat::FormattedText;
200use azalea_core::{
201 direction::Direction,
202 position::{BlockPos, Vec3f32},
203};
204use azalea_inventory::{ItemStack, components};
205use azalea_registry::{DataRegistry, builtin::EntityKind};
206use bevy_ecs::{bundle::Bundle, component::Component};
207use derive_more::{Deref, DerefMut};
208use thiserror::Error;
209use uuid::Uuid;
210
211use super::{
212 ArmadilloStateKind, CopperGolemStateKind, EntityDataItem, EntityDataValue, OptionalUnsignedInt,
213 Pose, Quaternion, Rotations, SnifferStateKind, VillagerData, WeatheringCopperStateKind,
214};
215use crate::{HumanoidArm, particle::Particle};
216
217#[derive(Error, Debug)]
218pub enum UpdateMetadataError {
219 #[error("Wrong type ({0:?})")]
220 WrongType(EntityDataValue),
221}
222impl From<EntityDataValue> for UpdateMetadataError {
223 fn from(value: EntityDataValue) -> Self {
224 Self::WrongType(value)
225 }
226}
227
228#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
229pub struct OnFire(pub bool);
231#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
232pub struct AbstractEntityShiftKeyDown(pub bool);
234#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
235pub struct Sprinting(pub bool);
237#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
238pub struct Swimming(pub bool);
240#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
241pub struct CurrentlyGlowing(pub bool);
243#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
244pub struct Invisible(pub bool);
246#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
247pub struct FallFlying(pub bool);
249#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
251pub struct AirSupply(pub i32);
252#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
254pub struct CustomName(pub Option<Box<FormattedText>>);
255#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
257pub struct CustomNameVisible(pub bool);
258#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
260pub struct Silent(pub bool);
261#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
263pub struct NoGravity(pub bool);
264#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
266pub struct TicksFrozen(pub i32);
267#[derive(Component)]
474pub struct AbstractEntity;
475impl AbstractEntity {
476 fn apply_metadata(
477 entity: &mut bevy_ecs::system::EntityCommands,
478 d: EntityDataItem,
479 ) -> Result<(), UpdateMetadataError> {
480 match d.index {
481 0 => {
482 let bitfield = d.value.into_byte()?;
483 entity.insert(OnFire(bitfield & 0x1 != 0));
484 entity.insert(AbstractEntityShiftKeyDown(bitfield & 0x2 != 0));
485 entity.insert(Sprinting(bitfield & 0x8 != 0));
486 entity.insert(Swimming(bitfield & 0x10 != 0));
487 entity.insert(CurrentlyGlowing(bitfield & 0x40 != 0));
488 entity.insert(Invisible(bitfield & 0x20 != 0));
489 entity.insert(FallFlying(bitfield & 0x80 != 0));
490 }
491 1 => {
492 entity.insert(AirSupply(d.value.into_int()?));
493 }
494 2 => {
495 entity.insert(CustomName(d.value.into_optional_formatted_text()?));
496 }
497 3 => {
498 entity.insert(CustomNameVisible(d.value.into_boolean()?));
499 }
500 4 => {
501 entity.insert(Silent(d.value.into_boolean()?));
502 }
503 5 => {
504 entity.insert(NoGravity(d.value.into_boolean()?));
505 }
506 6 => {
507 entity.insert(d.value.into_pose()?);
508 }
509 7 => {
510 entity.insert(TicksFrozen(d.value.into_int()?));
511 }
512 _ => {}
513 }
514 Ok(())
515 }
516}
517
518#[derive(Bundle)]
522pub struct AbstractEntityMetadataBundle {
523 _marker: AbstractEntity,
524 on_fire: OnFire,
525 abstract_entity_shift_key_down: AbstractEntityShiftKeyDown,
526 sprinting: Sprinting,
527 swimming: Swimming,
528 currently_glowing: CurrentlyGlowing,
529 invisible: Invisible,
530 fall_flying: FallFlying,
531 air_supply: AirSupply,
532 custom_name: CustomName,
533 custom_name_visible: CustomNameVisible,
534 silent: Silent,
535 no_gravity: NoGravity,
536 pose: Pose,
537 ticks_frozen: TicksFrozen,
538}
539impl Default for AbstractEntityMetadataBundle {
540 fn default() -> Self {
541 Self {
542 _marker: AbstractEntity,
543 on_fire: OnFire(false),
544 abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false),
545 sprinting: Sprinting(false),
546 swimming: Swimming(false),
547 currently_glowing: CurrentlyGlowing(false),
548 invisible: Invisible(false),
549 fall_flying: FallFlying(false),
550 air_supply: AirSupply(Default::default()),
551 custom_name: CustomName(Default::default()),
552 custom_name_visible: CustomNameVisible(Default::default()),
553 silent: Silent(Default::default()),
554 no_gravity: NoGravity(Default::default()),
555 pose: Pose::default(),
556 ticks_frozen: TicksFrozen(Default::default()),
557 }
558 }
559}
560
561#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
563pub struct Radius(pub f32);
564#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
566pub struct Waiting(pub bool);
567#[derive(Component)]
589pub struct AreaEffectCloud;
590impl AreaEffectCloud {
591 fn apply_metadata(
592 entity: &mut bevy_ecs::system::EntityCommands,
593 d: EntityDataItem,
594 ) -> Result<(), UpdateMetadataError> {
595 match d.index {
596 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
597 8 => {
598 entity.insert(Radius(d.value.into_float()?));
599 }
600 9 => {
601 entity.insert(Waiting(d.value.into_boolean()?));
602 }
603 10 => {
604 entity.insert(d.value.into_particle()?);
605 }
606 _ => {}
607 }
608 Ok(())
609 }
610}
611
612#[derive(Bundle)]
616pub struct AreaEffectCloudMetadataBundle {
617 _marker: AreaEffectCloud,
618 parent: AbstractEntityMetadataBundle,
619 radius: Radius,
620 waiting: Waiting,
621 particle: Particle,
622}
623impl Default for AreaEffectCloudMetadataBundle {
624 fn default() -> Self {
625 Self {
626 _marker: AreaEffectCloud,
627 parent: Default::default(),
628 radius: Radius(3.0),
629 waiting: Waiting(false),
630 particle: Particle::default(),
631 }
632 }
633}
634
635#[derive(Component)]
653pub struct BreezeWindCharge;
654impl BreezeWindCharge {
655 fn apply_metadata(
656 entity: &mut bevy_ecs::system::EntityCommands,
657 d: EntityDataItem,
658 ) -> Result<(), UpdateMetadataError> {
659 match d.index {
660 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
661 _ => {}
662 }
663 Ok(())
664 }
665}
666
667#[derive(Bundle)]
671pub struct BreezeWindChargeMetadataBundle {
672 _marker: BreezeWindCharge,
673 parent: AbstractEntityMetadataBundle,
674}
675impl Default for BreezeWindChargeMetadataBundle {
676 fn default() -> Self {
677 Self {
678 _marker: BreezeWindCharge,
679 parent: Default::default(),
680 }
681 }
682}
683
684#[derive(Component)]
702pub struct DragonFireball;
703impl DragonFireball {
704 fn apply_metadata(
705 entity: &mut bevy_ecs::system::EntityCommands,
706 d: EntityDataItem,
707 ) -> Result<(), UpdateMetadataError> {
708 match d.index {
709 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
710 _ => {}
711 }
712 Ok(())
713 }
714}
715
716#[derive(Bundle)]
720pub struct DragonFireballMetadataBundle {
721 _marker: DragonFireball,
722 parent: AbstractEntityMetadataBundle,
723}
724impl Default for DragonFireballMetadataBundle {
725 fn default() -> Self {
726 Self {
727 _marker: DragonFireball,
728 parent: Default::default(),
729 }
730 }
731}
732
733#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
735pub struct BeamTarget(pub Option<BlockPos>);
736#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
738pub struct ShowBottom(pub bool);
739#[derive(Component)]
761pub struct EndCrystal;
762impl EndCrystal {
763 fn apply_metadata(
764 entity: &mut bevy_ecs::system::EntityCommands,
765 d: EntityDataItem,
766 ) -> Result<(), UpdateMetadataError> {
767 match d.index {
768 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
769 8 => {
770 entity.insert(BeamTarget(d.value.into_optional_block_pos()?));
771 }
772 9 => {
773 entity.insert(ShowBottom(d.value.into_boolean()?));
774 }
775 _ => {}
776 }
777 Ok(())
778 }
779}
780
781#[derive(Bundle)]
785pub struct EndCrystalMetadataBundle {
786 _marker: EndCrystal,
787 parent: AbstractEntityMetadataBundle,
788 beam_target: BeamTarget,
789 show_bottom: ShowBottom,
790}
791impl Default for EndCrystalMetadataBundle {
792 fn default() -> Self {
793 Self {
794 _marker: EndCrystal,
795 parent: Default::default(),
796 beam_target: BeamTarget(None),
797 show_bottom: ShowBottom(true),
798 }
799 }
800}
801
802#[derive(Component)]
820pub struct EvokerFangs;
821impl EvokerFangs {
822 fn apply_metadata(
823 entity: &mut bevy_ecs::system::EntityCommands,
824 d: EntityDataItem,
825 ) -> Result<(), UpdateMetadataError> {
826 match d.index {
827 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
828 _ => {}
829 }
830 Ok(())
831 }
832}
833
834#[derive(Bundle)]
838pub struct EvokerFangsMetadataBundle {
839 _marker: EvokerFangs,
840 parent: AbstractEntityMetadataBundle,
841}
842impl Default for EvokerFangsMetadataBundle {
843 fn default() -> Self {
844 Self {
845 _marker: EvokerFangs,
846 parent: Default::default(),
847 }
848 }
849}
850
851#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
853pub struct Value(pub i32);
854#[derive(Component)]
875pub struct ExperienceOrb;
876impl ExperienceOrb {
877 fn apply_metadata(
878 entity: &mut bevy_ecs::system::EntityCommands,
879 d: EntityDataItem,
880 ) -> Result<(), UpdateMetadataError> {
881 match d.index {
882 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
883 8 => {
884 entity.insert(Value(d.value.into_int()?));
885 }
886 _ => {}
887 }
888 Ok(())
889 }
890}
891
892#[derive(Bundle)]
896pub struct ExperienceOrbMetadataBundle {
897 _marker: ExperienceOrb,
898 parent: AbstractEntityMetadataBundle,
899 value: Value,
900}
901impl Default for ExperienceOrbMetadataBundle {
902 fn default() -> Self {
903 Self {
904 _marker: ExperienceOrb,
905 parent: Default::default(),
906 value: Value(0),
907 }
908 }
909}
910
911#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
913pub struct EyeOfEnderItemStack(pub ItemStack);
914#[derive(Component)]
935pub struct EyeOfEnder;
936impl EyeOfEnder {
937 fn apply_metadata(
938 entity: &mut bevy_ecs::system::EntityCommands,
939 d: EntityDataItem,
940 ) -> Result<(), UpdateMetadataError> {
941 match d.index {
942 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
943 8 => {
944 entity.insert(EyeOfEnderItemStack(d.value.into_item_stack()?));
945 }
946 _ => {}
947 }
948 Ok(())
949 }
950}
951
952#[derive(Bundle)]
956pub struct EyeOfEnderMetadataBundle {
957 _marker: EyeOfEnder,
958 parent: AbstractEntityMetadataBundle,
959 eye_of_ender_item_stack: EyeOfEnderItemStack,
960}
961impl Default for EyeOfEnderMetadataBundle {
962 fn default() -> Self {
963 Self {
964 _marker: EyeOfEnder,
965 parent: Default::default(),
966 eye_of_ender_item_stack: EyeOfEnderItemStack(Default::default()),
967 }
968 }
969}
970
971#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
973pub struct StartPos(pub BlockPos);
974#[derive(Component)]
995pub struct FallingBlock;
996impl FallingBlock {
997 fn apply_metadata(
998 entity: &mut bevy_ecs::system::EntityCommands,
999 d: EntityDataItem,
1000 ) -> Result<(), UpdateMetadataError> {
1001 match d.index {
1002 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1003 8 => {
1004 entity.insert(StartPos(d.value.into_block_pos()?));
1005 }
1006 _ => {}
1007 }
1008 Ok(())
1009 }
1010}
1011
1012#[derive(Bundle)]
1016pub struct FallingBlockMetadataBundle {
1017 _marker: FallingBlock,
1018 parent: AbstractEntityMetadataBundle,
1019 start_pos: StartPos,
1020}
1021impl Default for FallingBlockMetadataBundle {
1022 fn default() -> Self {
1023 Self {
1024 _marker: FallingBlock,
1025 parent: Default::default(),
1026 start_pos: StartPos(BlockPos::new(0, 0, 0)),
1027 }
1028 }
1029}
1030
1031#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1033pub struct FireballItemStack(pub ItemStack);
1034#[derive(Component)]
1055pub struct Fireball;
1056impl Fireball {
1057 fn apply_metadata(
1058 entity: &mut bevy_ecs::system::EntityCommands,
1059 d: EntityDataItem,
1060 ) -> Result<(), UpdateMetadataError> {
1061 match d.index {
1062 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1063 8 => {
1064 entity.insert(FireballItemStack(d.value.into_item_stack()?));
1065 }
1066 _ => {}
1067 }
1068 Ok(())
1069 }
1070}
1071
1072#[derive(Bundle)]
1076pub struct FireballMetadataBundle {
1077 _marker: Fireball,
1078 parent: AbstractEntityMetadataBundle,
1079 fireball_item_stack: FireballItemStack,
1080}
1081impl Default for FireballMetadataBundle {
1082 fn default() -> Self {
1083 Self {
1084 _marker: Fireball,
1085 parent: Default::default(),
1086 fireball_item_stack: FireballItemStack(Default::default()),
1087 }
1088 }
1089}
1090
1091#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1093pub struct FireworksItem(pub ItemStack);
1094#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1096pub struct AttachedToTarget(pub OptionalUnsignedInt);
1097#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1099pub struct ShotAtAngle(pub bool);
1100#[derive(Component)]
1123pub struct FireworkRocket;
1124impl FireworkRocket {
1125 fn apply_metadata(
1126 entity: &mut bevy_ecs::system::EntityCommands,
1127 d: EntityDataItem,
1128 ) -> Result<(), UpdateMetadataError> {
1129 match d.index {
1130 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1131 8 => {
1132 entity.insert(FireworksItem(d.value.into_item_stack()?));
1133 }
1134 9 => {
1135 entity.insert(AttachedToTarget(d.value.into_optional_unsigned_int()?));
1136 }
1137 10 => {
1138 entity.insert(ShotAtAngle(d.value.into_boolean()?));
1139 }
1140 _ => {}
1141 }
1142 Ok(())
1143 }
1144}
1145
1146#[derive(Bundle)]
1150pub struct FireworkRocketMetadataBundle {
1151 _marker: FireworkRocket,
1152 parent: AbstractEntityMetadataBundle,
1153 fireworks_item: FireworksItem,
1154 attached_to_target: AttachedToTarget,
1155 shot_at_angle: ShotAtAngle,
1156}
1157impl Default for FireworkRocketMetadataBundle {
1158 fn default() -> Self {
1159 Self {
1160 _marker: FireworkRocket,
1161 parent: Default::default(),
1162 fireworks_item: FireworksItem(Default::default()),
1163 attached_to_target: AttachedToTarget(OptionalUnsignedInt(None)),
1164 shot_at_angle: ShotAtAngle(false),
1165 }
1166 }
1167}
1168
1169#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1171pub struct HookedEntity(pub i32);
1172#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1174pub struct Biting(pub bool);
1175#[derive(Component)]
1197pub struct FishingBobber;
1198impl FishingBobber {
1199 fn apply_metadata(
1200 entity: &mut bevy_ecs::system::EntityCommands,
1201 d: EntityDataItem,
1202 ) -> Result<(), UpdateMetadataError> {
1203 match d.index {
1204 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1205 8 => {
1206 entity.insert(HookedEntity(d.value.into_int()?));
1207 }
1208 9 => {
1209 entity.insert(Biting(d.value.into_boolean()?));
1210 }
1211 _ => {}
1212 }
1213 Ok(())
1214 }
1215}
1216
1217#[derive(Bundle)]
1221pub struct FishingBobberMetadataBundle {
1222 _marker: FishingBobber,
1223 parent: AbstractEntityMetadataBundle,
1224 hooked_entity: HookedEntity,
1225 biting: Biting,
1226}
1227impl Default for FishingBobberMetadataBundle {
1228 fn default() -> Self {
1229 Self {
1230 _marker: FishingBobber,
1231 parent: Default::default(),
1232 hooked_entity: HookedEntity(0),
1233 biting: Biting(false),
1234 }
1235 }
1236}
1237
1238#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1240pub struct InteractionWidth(pub f32);
1241#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1243pub struct InteractionHeight(pub f32);
1244#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1246pub struct Response(pub bool);
1247#[derive(Component)]
1270pub struct Interaction;
1271impl Interaction {
1272 fn apply_metadata(
1273 entity: &mut bevy_ecs::system::EntityCommands,
1274 d: EntityDataItem,
1275 ) -> Result<(), UpdateMetadataError> {
1276 match d.index {
1277 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1278 8 => {
1279 entity.insert(InteractionWidth(d.value.into_float()?));
1280 }
1281 9 => {
1282 entity.insert(InteractionHeight(d.value.into_float()?));
1283 }
1284 10 => {
1285 entity.insert(Response(d.value.into_boolean()?));
1286 }
1287 _ => {}
1288 }
1289 Ok(())
1290 }
1291}
1292
1293#[derive(Bundle)]
1297pub struct InteractionMetadataBundle {
1298 _marker: Interaction,
1299 parent: AbstractEntityMetadataBundle,
1300 interaction_width: InteractionWidth,
1301 interaction_height: InteractionHeight,
1302 response: Response,
1303}
1304impl Default for InteractionMetadataBundle {
1305 fn default() -> Self {
1306 Self {
1307 _marker: Interaction,
1308 parent: Default::default(),
1309 interaction_width: InteractionWidth(1.0),
1310 interaction_height: InteractionHeight(1.0),
1311 response: Response(false),
1312 }
1313 }
1314}
1315
1316#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1318pub struct ItemItem(pub ItemStack);
1319#[derive(Component)]
1339pub struct Item;
1340impl Item {
1341 fn apply_metadata(
1342 entity: &mut bevy_ecs::system::EntityCommands,
1343 d: EntityDataItem,
1344 ) -> Result<(), UpdateMetadataError> {
1345 match d.index {
1346 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1347 8 => {
1348 entity.insert(ItemItem(d.value.into_item_stack()?));
1349 }
1350 _ => {}
1351 }
1352 Ok(())
1353 }
1354}
1355
1356#[derive(Bundle)]
1360pub struct ItemMetadataBundle {
1361 _marker: Item,
1362 parent: AbstractEntityMetadataBundle,
1363 item_item: ItemItem,
1364}
1365impl Default for ItemMetadataBundle {
1366 fn default() -> Self {
1367 Self {
1368 _marker: Item,
1369 parent: Default::default(),
1370 item_item: ItemItem(Default::default()),
1371 }
1372 }
1373}
1374
1375#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1377pub struct ItemFrameDirection(pub Direction);
1378#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1380pub struct ItemFrameItem(pub ItemStack);
1381#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1383pub struct Rotation(pub i32);
1384#[derive(Component)]
1407pub struct ItemFrame;
1408impl ItemFrame {
1409 fn apply_metadata(
1410 entity: &mut bevy_ecs::system::EntityCommands,
1411 d: EntityDataItem,
1412 ) -> Result<(), UpdateMetadataError> {
1413 match d.index {
1414 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1415 8 => {
1416 entity.insert(ItemFrameDirection(d.value.into_direction()?));
1417 }
1418 9 => {
1419 entity.insert(ItemFrameItem(d.value.into_item_stack()?));
1420 }
1421 10 => {
1422 entity.insert(Rotation(d.value.into_int()?));
1423 }
1424 _ => {}
1425 }
1426 Ok(())
1427 }
1428}
1429
1430#[derive(Bundle)]
1434pub struct ItemFrameMetadataBundle {
1435 _marker: ItemFrame,
1436 parent: AbstractEntityMetadataBundle,
1437 item_frame_direction: ItemFrameDirection,
1438 item_frame_item: ItemFrameItem,
1439 rotation: Rotation,
1440}
1441impl Default for ItemFrameMetadataBundle {
1442 fn default() -> Self {
1443 Self {
1444 _marker: ItemFrame,
1445 parent: Default::default(),
1446 item_frame_direction: ItemFrameDirection(Default::default()),
1447 item_frame_item: ItemFrameItem(Default::default()),
1448 rotation: Rotation(0),
1449 }
1450 }
1451}
1452
1453#[derive(Component)]
1472pub struct GlowItemFrame;
1473impl GlowItemFrame {
1474 fn apply_metadata(
1475 entity: &mut bevy_ecs::system::EntityCommands,
1476 d: EntityDataItem,
1477 ) -> Result<(), UpdateMetadataError> {
1478 match d.index {
1479 0..=10 => ItemFrame::apply_metadata(entity, d)?,
1480 _ => {}
1481 }
1482 Ok(())
1483 }
1484}
1485
1486#[derive(Bundle)]
1490pub struct GlowItemFrameMetadataBundle {
1491 _marker: GlowItemFrame,
1492 parent: ItemFrameMetadataBundle,
1493}
1494impl Default for GlowItemFrameMetadataBundle {
1495 fn default() -> Self {
1496 Self {
1497 _marker: GlowItemFrame,
1498 parent: Default::default(),
1499 }
1500 }
1501}
1502
1503#[derive(Component)]
1521pub struct LeashKnot;
1522impl LeashKnot {
1523 fn apply_metadata(
1524 entity: &mut bevy_ecs::system::EntityCommands,
1525 d: EntityDataItem,
1526 ) -> Result<(), UpdateMetadataError> {
1527 match d.index {
1528 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1529 _ => {}
1530 }
1531 Ok(())
1532 }
1533}
1534
1535#[derive(Bundle)]
1539pub struct LeashKnotMetadataBundle {
1540 _marker: LeashKnot,
1541 parent: AbstractEntityMetadataBundle,
1542}
1543impl Default for LeashKnotMetadataBundle {
1544 fn default() -> Self {
1545 Self {
1546 _marker: LeashKnot,
1547 parent: Default::default(),
1548 }
1549 }
1550}
1551
1552#[derive(Component)]
1570pub struct LightningBolt;
1571impl LightningBolt {
1572 fn apply_metadata(
1573 entity: &mut bevy_ecs::system::EntityCommands,
1574 d: EntityDataItem,
1575 ) -> Result<(), UpdateMetadataError> {
1576 match d.index {
1577 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1578 _ => {}
1579 }
1580 Ok(())
1581 }
1582}
1583
1584#[derive(Bundle)]
1588pub struct LightningBoltMetadataBundle {
1589 _marker: LightningBolt,
1590 parent: AbstractEntityMetadataBundle,
1591}
1592impl Default for LightningBoltMetadataBundle {
1593 fn default() -> Self {
1594 Self {
1595 _marker: LightningBolt,
1596 parent: Default::default(),
1597 }
1598 }
1599}
1600
1601#[derive(Component)]
1619pub struct LlamaSpit;
1620impl LlamaSpit {
1621 fn apply_metadata(
1622 entity: &mut bevy_ecs::system::EntityCommands,
1623 d: EntityDataItem,
1624 ) -> Result<(), UpdateMetadataError> {
1625 match d.index {
1626 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1627 _ => {}
1628 }
1629 Ok(())
1630 }
1631}
1632
1633#[derive(Bundle)]
1637pub struct LlamaSpitMetadataBundle {
1638 _marker: LlamaSpit,
1639 parent: AbstractEntityMetadataBundle,
1640}
1641impl Default for LlamaSpitMetadataBundle {
1642 fn default() -> Self {
1643 Self {
1644 _marker: LlamaSpit,
1645 parent: Default::default(),
1646 }
1647 }
1648}
1649
1650#[derive(Component)]
1668pub struct Marker;
1669impl Marker {
1670 fn apply_metadata(
1671 entity: &mut bevy_ecs::system::EntityCommands,
1672 d: EntityDataItem,
1673 ) -> Result<(), UpdateMetadataError> {
1674 match d.index {
1675 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1676 _ => {}
1677 }
1678 Ok(())
1679 }
1680}
1681
1682#[derive(Bundle)]
1686pub struct MarkerMetadataBundle {
1687 _marker: Marker,
1688 parent: AbstractEntityMetadataBundle,
1689}
1690impl Default for MarkerMetadataBundle {
1691 fn default() -> Self {
1692 Self {
1693 _marker: Marker,
1694 parent: Default::default(),
1695 }
1696 }
1697}
1698
1699#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1701pub struct OminousItemSpawnerItem(pub ItemStack);
1702#[derive(Component)]
1723pub struct OminousItemSpawner;
1724impl OminousItemSpawner {
1725 fn apply_metadata(
1726 entity: &mut bevy_ecs::system::EntityCommands,
1727 d: EntityDataItem,
1728 ) -> Result<(), UpdateMetadataError> {
1729 match d.index {
1730 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1731 8 => {
1732 entity.insert(OminousItemSpawnerItem(d.value.into_item_stack()?));
1733 }
1734 _ => {}
1735 }
1736 Ok(())
1737 }
1738}
1739
1740#[derive(Bundle)]
1744pub struct OminousItemSpawnerMetadataBundle {
1745 _marker: OminousItemSpawner,
1746 parent: AbstractEntityMetadataBundle,
1747 ominous_item_spawner_item: OminousItemSpawnerItem,
1748}
1749impl Default for OminousItemSpawnerMetadataBundle {
1750 fn default() -> Self {
1751 Self {
1752 _marker: OminousItemSpawner,
1753 parent: Default::default(),
1754 ominous_item_spawner_item: OminousItemSpawnerItem(Default::default()),
1755 }
1756 }
1757}
1758
1759#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1761pub struct PaintingDirection(pub Direction);
1762#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1764pub struct PaintingVariant(pub azalea_registry::data::PaintingVariant);
1765#[derive(Component)]
1787pub struct Painting;
1788impl Painting {
1789 fn apply_metadata(
1790 entity: &mut bevy_ecs::system::EntityCommands,
1791 d: EntityDataItem,
1792 ) -> Result<(), UpdateMetadataError> {
1793 match d.index {
1794 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1795 8 => {
1796 entity.insert(PaintingDirection(d.value.into_direction()?));
1797 }
1798 9 => {
1799 entity.insert(PaintingVariant(d.value.into_painting_variant()?));
1800 }
1801 _ => {}
1802 }
1803 Ok(())
1804 }
1805}
1806
1807#[derive(Bundle)]
1811pub struct PaintingMetadataBundle {
1812 _marker: Painting,
1813 parent: AbstractEntityMetadataBundle,
1814 painting_direction: PaintingDirection,
1815 painting_variant: PaintingVariant,
1816}
1817impl Default for PaintingMetadataBundle {
1818 fn default() -> Self {
1819 Self {
1820 _marker: Painting,
1821 parent: Default::default(),
1822 painting_direction: PaintingDirection(Default::default()),
1823 painting_variant: PaintingVariant(azalea_registry::data::PaintingVariant::new_raw(0)),
1824 }
1825 }
1826}
1827
1828#[derive(Component)]
1846pub struct ShulkerBullet;
1847impl ShulkerBullet {
1848 fn apply_metadata(
1849 entity: &mut bevy_ecs::system::EntityCommands,
1850 d: EntityDataItem,
1851 ) -> Result<(), UpdateMetadataError> {
1852 match d.index {
1853 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1854 _ => {}
1855 }
1856 Ok(())
1857 }
1858}
1859
1860#[derive(Bundle)]
1864pub struct ShulkerBulletMetadataBundle {
1865 _marker: ShulkerBullet,
1866 parent: AbstractEntityMetadataBundle,
1867}
1868impl Default for ShulkerBulletMetadataBundle {
1869 fn default() -> Self {
1870 Self {
1871 _marker: ShulkerBullet,
1872 parent: Default::default(),
1873 }
1874 }
1875}
1876
1877#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1879pub struct SmallFireballItemStack(pub ItemStack);
1880#[derive(Component)]
1901pub struct SmallFireball;
1902impl SmallFireball {
1903 fn apply_metadata(
1904 entity: &mut bevy_ecs::system::EntityCommands,
1905 d: EntityDataItem,
1906 ) -> Result<(), UpdateMetadataError> {
1907 match d.index {
1908 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1909 8 => {
1910 entity.insert(SmallFireballItemStack(d.value.into_item_stack()?));
1911 }
1912 _ => {}
1913 }
1914 Ok(())
1915 }
1916}
1917
1918#[derive(Bundle)]
1922pub struct SmallFireballMetadataBundle {
1923 _marker: SmallFireball,
1924 parent: AbstractEntityMetadataBundle,
1925 small_fireball_item_stack: SmallFireballItemStack,
1926}
1927impl Default for SmallFireballMetadataBundle {
1928 fn default() -> Self {
1929 Self {
1930 _marker: SmallFireball,
1931 parent: Default::default(),
1932 small_fireball_item_stack: SmallFireballItemStack(Default::default()),
1933 }
1934 }
1935}
1936
1937#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1939pub struct Fuse(pub i32);
1940#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1942pub struct TntBlockState(pub azalea_block::BlockState);
1943#[derive(Component)]
1964pub struct Tnt;
1965impl Tnt {
1966 fn apply_metadata(
1967 entity: &mut bevy_ecs::system::EntityCommands,
1968 d: EntityDataItem,
1969 ) -> Result<(), UpdateMetadataError> {
1970 match d.index {
1971 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1972 8 => {
1973 entity.insert(Fuse(d.value.into_int()?));
1974 }
1975 9 => {
1976 entity.insert(TntBlockState(d.value.into_block_state()?));
1977 }
1978 _ => {}
1979 }
1980 Ok(())
1981 }
1982}
1983
1984#[derive(Bundle)]
1988pub struct TntMetadataBundle {
1989 _marker: Tnt,
1990 parent: AbstractEntityMetadataBundle,
1991 fuse: Fuse,
1992 tnt_block_state: TntBlockState,
1993}
1994impl Default for TntMetadataBundle {
1995 fn default() -> Self {
1996 Self {
1997 _marker: Tnt,
1998 parent: Default::default(),
1999 fuse: Fuse(80),
2000 tnt_block_state: TntBlockState(Default::default()),
2001 }
2002 }
2003}
2004
2005#[derive(Component)]
2023pub struct WindCharge;
2024impl WindCharge {
2025 fn apply_metadata(
2026 entity: &mut bevy_ecs::system::EntityCommands,
2027 d: EntityDataItem,
2028 ) -> Result<(), UpdateMetadataError> {
2029 match d.index {
2030 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2031 _ => {}
2032 }
2033 Ok(())
2034 }
2035}
2036
2037#[derive(Bundle)]
2041pub struct WindChargeMetadataBundle {
2042 _marker: WindCharge,
2043 parent: AbstractEntityMetadataBundle,
2044}
2045impl Default for WindChargeMetadataBundle {
2046 fn default() -> Self {
2047 Self {
2048 _marker: WindCharge,
2049 parent: Default::default(),
2050 }
2051 }
2052}
2053
2054#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2056pub struct Dangerous(pub bool);
2057#[derive(Component)]
2078pub struct WitherSkull;
2079impl WitherSkull {
2080 fn apply_metadata(
2081 entity: &mut bevy_ecs::system::EntityCommands,
2082 d: EntityDataItem,
2083 ) -> Result<(), UpdateMetadataError> {
2084 match d.index {
2085 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2086 8 => {
2087 entity.insert(Dangerous(d.value.into_boolean()?));
2088 }
2089 _ => {}
2090 }
2091 Ok(())
2092 }
2093}
2094
2095#[derive(Bundle)]
2099pub struct WitherSkullMetadataBundle {
2100 _marker: WitherSkull,
2101 parent: AbstractEntityMetadataBundle,
2102 dangerous: Dangerous,
2103}
2104impl Default for WitherSkullMetadataBundle {
2105 fn default() -> Self {
2106 Self {
2107 _marker: WitherSkull,
2108 parent: Default::default(),
2109 dangerous: Dangerous(false),
2110 }
2111 }
2112}
2113
2114#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
2115pub struct CritArrow(pub bool);
2117#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
2118pub struct NoPhysics(pub bool);
2120#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2122pub struct PierceLevel(pub u8);
2123#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2125pub struct InGround(pub bool);
2126#[derive(Component)]
2152pub struct AbstractArrow;
2153impl AbstractArrow {
2154 fn apply_metadata(
2155 entity: &mut bevy_ecs::system::EntityCommands,
2156 d: EntityDataItem,
2157 ) -> Result<(), UpdateMetadataError> {
2158 match d.index {
2159 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2160 8 => {
2161 let bitfield = d.value.into_byte()?;
2162 entity.insert(CritArrow(bitfield & 0x1 != 0));
2163 entity.insert(NoPhysics(bitfield & 0x2 != 0));
2164 }
2165 9 => {
2166 entity.insert(PierceLevel(d.value.into_byte()?));
2167 }
2168 10 => {
2169 entity.insert(InGround(d.value.into_boolean()?));
2170 }
2171 _ => {}
2172 }
2173 Ok(())
2174 }
2175}
2176
2177#[derive(Bundle)]
2181pub struct AbstractArrowMetadataBundle {
2182 _marker: AbstractArrow,
2183 parent: AbstractEntityMetadataBundle,
2184 crit_arrow: CritArrow,
2185 no_physics: NoPhysics,
2186 pierce_level: PierceLevel,
2187 in_ground: InGround,
2188}
2189impl Default for AbstractArrowMetadataBundle {
2190 fn default() -> Self {
2191 Self {
2192 _marker: AbstractArrow,
2193 parent: Default::default(),
2194 crit_arrow: CritArrow(false),
2195 no_physics: NoPhysics(false),
2196 pierce_level: PierceLevel(0),
2197 in_ground: InGround(false),
2198 }
2199 }
2200}
2201
2202#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2204pub struct EffectColor(pub i32);
2205#[derive(Component)]
2226pub struct Arrow;
2227impl Arrow {
2228 fn apply_metadata(
2229 entity: &mut bevy_ecs::system::EntityCommands,
2230 d: EntityDataItem,
2231 ) -> Result<(), UpdateMetadataError> {
2232 match d.index {
2233 0..=10 => AbstractArrow::apply_metadata(entity, d)?,
2234 11 => {
2235 entity.insert(EffectColor(d.value.into_int()?));
2236 }
2237 _ => {}
2238 }
2239 Ok(())
2240 }
2241}
2242
2243#[derive(Bundle)]
2247pub struct ArrowMetadataBundle {
2248 _marker: Arrow,
2249 parent: AbstractArrowMetadataBundle,
2250 effect_color: EffectColor,
2251}
2252impl Default for ArrowMetadataBundle {
2253 fn default() -> Self {
2254 Self {
2255 _marker: Arrow,
2256 parent: Default::default(),
2257 effect_color: EffectColor(-1),
2258 }
2259 }
2260}
2261
2262#[derive(Component)]
2281pub struct SpectralArrow;
2282impl SpectralArrow {
2283 fn apply_metadata(
2284 entity: &mut bevy_ecs::system::EntityCommands,
2285 d: EntityDataItem,
2286 ) -> Result<(), UpdateMetadataError> {
2287 match d.index {
2288 0..=10 => AbstractArrow::apply_metadata(entity, d)?,
2289 _ => {}
2290 }
2291 Ok(())
2292 }
2293}
2294
2295#[derive(Bundle)]
2299pub struct SpectralArrowMetadataBundle {
2300 _marker: SpectralArrow,
2301 parent: AbstractArrowMetadataBundle,
2302}
2303impl Default for SpectralArrowMetadataBundle {
2304 fn default() -> Self {
2305 Self {
2306 _marker: SpectralArrow,
2307 parent: Default::default(),
2308 }
2309 }
2310}
2311
2312#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2314pub struct Loyalty(pub u8);
2315#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2317pub struct Foil(pub bool);
2318#[derive(Component)]
2340pub struct Trident;
2341impl Trident {
2342 fn apply_metadata(
2343 entity: &mut bevy_ecs::system::EntityCommands,
2344 d: EntityDataItem,
2345 ) -> Result<(), UpdateMetadataError> {
2346 match d.index {
2347 0..=10 => AbstractArrow::apply_metadata(entity, d)?,
2348 11 => {
2349 entity.insert(Loyalty(d.value.into_byte()?));
2350 }
2351 12 => {
2352 entity.insert(Foil(d.value.into_boolean()?));
2353 }
2354 _ => {}
2355 }
2356 Ok(())
2357 }
2358}
2359
2360#[derive(Bundle)]
2364pub struct TridentMetadataBundle {
2365 _marker: Trident,
2366 parent: AbstractArrowMetadataBundle,
2367 loyalty: Loyalty,
2368 foil: Foil,
2369}
2370impl Default for TridentMetadataBundle {
2371 fn default() -> Self {
2372 Self {
2373 _marker: Trident,
2374 parent: Default::default(),
2375 loyalty: Loyalty(0),
2376 foil: Foil(false),
2377 }
2378 }
2379}
2380
2381#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2383pub struct TransformationInterpolationStartDeltaTicks(pub i32);
2384#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2386pub struct TransformationInterpolationDuration(pub i32);
2387#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2389pub struct PosRotInterpolationDuration(pub i32);
2390#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2392pub struct Translation(pub Vec3f32);
2393#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2395pub struct Scale(pub Vec3f32);
2396#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2398pub struct LeftRotation(pub Quaternion);
2399#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2401pub struct RightRotation(pub Quaternion);
2402#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2404pub struct BillboardRenderConstraints(pub u8);
2405#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2407pub struct BrightnessOverride(pub i32);
2408#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2410pub struct ViewRange(pub f32);
2411#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2413pub struct ShadowRadius(pub f32);
2414#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2416pub struct ShadowStrength(pub f32);
2417#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2419pub struct AbstractDisplayWidth(pub f32);
2420#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2422pub struct AbstractDisplayHeight(pub f32);
2423#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2425pub struct GlowColorOverride(pub i32);
2426#[derive(Component)]
2463pub struct AbstractDisplay;
2464impl AbstractDisplay {
2465 fn apply_metadata(
2466 entity: &mut bevy_ecs::system::EntityCommands,
2467 d: EntityDataItem,
2468 ) -> Result<(), UpdateMetadataError> {
2469 match d.index {
2470 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2471 8 => {
2472 entity.insert(TransformationInterpolationStartDeltaTicks(
2473 d.value.into_int()?,
2474 ));
2475 }
2476 9 => {
2477 entity.insert(TransformationInterpolationDuration(d.value.into_int()?));
2478 }
2479 10 => {
2480 entity.insert(PosRotInterpolationDuration(d.value.into_int()?));
2481 }
2482 11 => {
2483 entity.insert(Translation(d.value.into_vector3()?));
2484 }
2485 12 => {
2486 entity.insert(Scale(d.value.into_vector3()?));
2487 }
2488 13 => {
2489 entity.insert(LeftRotation(d.value.into_quaternion()?));
2490 }
2491 14 => {
2492 entity.insert(RightRotation(d.value.into_quaternion()?));
2493 }
2494 15 => {
2495 entity.insert(BillboardRenderConstraints(d.value.into_byte()?));
2496 }
2497 16 => {
2498 entity.insert(BrightnessOverride(d.value.into_int()?));
2499 }
2500 17 => {
2501 entity.insert(ViewRange(d.value.into_float()?));
2502 }
2503 18 => {
2504 entity.insert(ShadowRadius(d.value.into_float()?));
2505 }
2506 19 => {
2507 entity.insert(ShadowStrength(d.value.into_float()?));
2508 }
2509 20 => {
2510 entity.insert(AbstractDisplayWidth(d.value.into_float()?));
2511 }
2512 21 => {
2513 entity.insert(AbstractDisplayHeight(d.value.into_float()?));
2514 }
2515 22 => {
2516 entity.insert(GlowColorOverride(d.value.into_int()?));
2517 }
2518 _ => {}
2519 }
2520 Ok(())
2521 }
2522}
2523
2524#[derive(Bundle)]
2528pub struct AbstractDisplayMetadataBundle {
2529 _marker: AbstractDisplay,
2530 parent: AbstractEntityMetadataBundle,
2531 transformation_interpolation_start_delta_ticks: TransformationInterpolationStartDeltaTicks,
2532 transformation_interpolation_duration: TransformationInterpolationDuration,
2533 pos_rot_interpolation_duration: PosRotInterpolationDuration,
2534 translation: Translation,
2535 scale: Scale,
2536 left_rotation: LeftRotation,
2537 right_rotation: RightRotation,
2538 billboard_render_constraints: BillboardRenderConstraints,
2539 brightness_override: BrightnessOverride,
2540 view_range: ViewRange,
2541 shadow_radius: ShadowRadius,
2542 shadow_strength: ShadowStrength,
2543 abstract_display_width: AbstractDisplayWidth,
2544 abstract_display_height: AbstractDisplayHeight,
2545 glow_color_override: GlowColorOverride,
2546}
2547impl Default for AbstractDisplayMetadataBundle {
2548 fn default() -> Self {
2549 Self {
2550 _marker: AbstractDisplay,
2551 parent: Default::default(),
2552 transformation_interpolation_start_delta_ticks:
2553 TransformationInterpolationStartDeltaTicks(0),
2554 transformation_interpolation_duration: TransformationInterpolationDuration(0),
2555 pos_rot_interpolation_duration: PosRotInterpolationDuration(0),
2556 translation: Translation(Vec3f32 {
2557 x: 0.0,
2558 y: 0.0,
2559 z: 0.0,
2560 }),
2561 scale: Scale(Vec3f32 {
2562 x: 1.0,
2563 y: 1.0,
2564 z: 1.0,
2565 }),
2566 left_rotation: LeftRotation(Quaternion {
2567 x: 0.0,
2568 y: 0.0,
2569 z: 0.0,
2570 w: 1.0,
2571 }),
2572 right_rotation: RightRotation(Quaternion {
2573 x: 0.0,
2574 y: 0.0,
2575 z: 0.0,
2576 w: 1.0,
2577 }),
2578 billboard_render_constraints: BillboardRenderConstraints(Default::default()),
2579 brightness_override: BrightnessOverride(-1),
2580 view_range: ViewRange(1.0),
2581 shadow_radius: ShadowRadius(0.0),
2582 shadow_strength: ShadowStrength(1.0),
2583 abstract_display_width: AbstractDisplayWidth(0.0),
2584 abstract_display_height: AbstractDisplayHeight(0.0),
2585 glow_color_override: GlowColorOverride(-1),
2586 }
2587 }
2588}
2589
2590#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2592pub struct BlockDisplayBlockState(pub azalea_block::BlockState);
2593#[derive(Component)]
2615pub struct BlockDisplay;
2616impl BlockDisplay {
2617 fn apply_metadata(
2618 entity: &mut bevy_ecs::system::EntityCommands,
2619 d: EntityDataItem,
2620 ) -> Result<(), UpdateMetadataError> {
2621 match d.index {
2622 0..=22 => AbstractDisplay::apply_metadata(entity, d)?,
2623 23 => {
2624 entity.insert(BlockDisplayBlockState(d.value.into_block_state()?));
2625 }
2626 _ => {}
2627 }
2628 Ok(())
2629 }
2630}
2631
2632#[derive(Bundle)]
2636pub struct BlockDisplayMetadataBundle {
2637 _marker: BlockDisplay,
2638 parent: AbstractDisplayMetadataBundle,
2639 block_display_block_state: BlockDisplayBlockState,
2640}
2641impl Default for BlockDisplayMetadataBundle {
2642 fn default() -> Self {
2643 Self {
2644 _marker: BlockDisplay,
2645 parent: Default::default(),
2646 block_display_block_state: BlockDisplayBlockState(Default::default()),
2647 }
2648 }
2649}
2650
2651#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2653pub struct ItemDisplayItemStack(pub ItemStack);
2654#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2656pub struct ItemDisplayItemDisplay(pub u8);
2657#[derive(Component)]
2680pub struct ItemDisplay;
2681impl ItemDisplay {
2682 fn apply_metadata(
2683 entity: &mut bevy_ecs::system::EntityCommands,
2684 d: EntityDataItem,
2685 ) -> Result<(), UpdateMetadataError> {
2686 match d.index {
2687 0..=22 => AbstractDisplay::apply_metadata(entity, d)?,
2688 23 => {
2689 entity.insert(ItemDisplayItemStack(d.value.into_item_stack()?));
2690 }
2691 24 => {
2692 entity.insert(ItemDisplayItemDisplay(d.value.into_byte()?));
2693 }
2694 _ => {}
2695 }
2696 Ok(())
2697 }
2698}
2699
2700#[derive(Bundle)]
2704pub struct ItemDisplayMetadataBundle {
2705 _marker: ItemDisplay,
2706 parent: AbstractDisplayMetadataBundle,
2707 item_display_item_stack: ItemDisplayItemStack,
2708 item_display_item_display: ItemDisplayItemDisplay,
2709}
2710impl Default for ItemDisplayMetadataBundle {
2711 fn default() -> Self {
2712 Self {
2713 _marker: ItemDisplay,
2714 parent: Default::default(),
2715 item_display_item_stack: ItemDisplayItemStack(Default::default()),
2716 item_display_item_display: ItemDisplayItemDisplay(Default::default()),
2717 }
2718 }
2719}
2720
2721#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2723pub struct Text(pub Box<FormattedText>);
2724#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2726pub struct LineWidth(pub i32);
2727#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2729pub struct BackgroundColor(pub i32);
2730#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2732pub struct TextOpacity(pub u8);
2733#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2735pub struct StyleFlags(pub u8);
2736#[derive(Component)]
2762pub struct TextDisplay;
2763impl TextDisplay {
2764 fn apply_metadata(
2765 entity: &mut bevy_ecs::system::EntityCommands,
2766 d: EntityDataItem,
2767 ) -> Result<(), UpdateMetadataError> {
2768 match d.index {
2769 0..=22 => AbstractDisplay::apply_metadata(entity, d)?,
2770 23 => {
2771 entity.insert(Text(d.value.into_formatted_text()?));
2772 }
2773 24 => {
2774 entity.insert(LineWidth(d.value.into_int()?));
2775 }
2776 25 => {
2777 entity.insert(BackgroundColor(d.value.into_int()?));
2778 }
2779 26 => {
2780 entity.insert(TextOpacity(d.value.into_byte()?));
2781 }
2782 27 => {
2783 entity.insert(StyleFlags(d.value.into_byte()?));
2784 }
2785 _ => {}
2786 }
2787 Ok(())
2788 }
2789}
2790
2791#[derive(Bundle)]
2795pub struct TextDisplayMetadataBundle {
2796 _marker: TextDisplay,
2797 parent: AbstractDisplayMetadataBundle,
2798 text: Text,
2799 line_width: LineWidth,
2800 background_color: BackgroundColor,
2801 text_opacity: TextOpacity,
2802 style_flags: StyleFlags,
2803}
2804impl Default for TextDisplayMetadataBundle {
2805 fn default() -> Self {
2806 Self {
2807 _marker: TextDisplay,
2808 parent: Default::default(),
2809 text: Text(Default::default()),
2810 line_width: LineWidth(200),
2811 background_color: BackgroundColor(1073741824),
2812 text_opacity: TextOpacity(127),
2813 style_flags: StyleFlags(0),
2814 }
2815 }
2816}
2817
2818#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
2819pub struct AutoSpinAttack(pub bool);
2821#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
2822pub struct AbstractLivingUsingItem(pub bool);
2824#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2826pub struct Health(pub f32);
2827#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2829pub struct EffectParticles(pub Box<[Particle]>);
2830#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2832pub struct EffectAmbience(pub bool);
2833#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2835pub struct ArrowCount(pub i32);
2836#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2838pub struct StingerCount(pub i32);
2839#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2841pub struct SleepingPos(pub Option<BlockPos>);
2842#[derive(Component)]
2976pub struct AbstractLiving;
2977impl AbstractLiving {
2978 fn apply_metadata(
2979 entity: &mut bevy_ecs::system::EntityCommands,
2980 d: EntityDataItem,
2981 ) -> Result<(), UpdateMetadataError> {
2982 match d.index {
2983 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2984 8 => {
2985 let bitfield = d.value.into_byte()?;
2986 entity.insert(AutoSpinAttack(bitfield & 0x4 != 0));
2987 entity.insert(AbstractLivingUsingItem(bitfield & 0x1 != 0));
2988 }
2989 9 => {
2990 entity.insert(Health(d.value.into_float()?));
2991 }
2992 10 => {
2993 entity.insert(EffectParticles(d.value.into_particles()?));
2994 }
2995 11 => {
2996 entity.insert(EffectAmbience(d.value.into_boolean()?));
2997 }
2998 12 => {
2999 entity.insert(ArrowCount(d.value.into_int()?));
3000 }
3001 13 => {
3002 entity.insert(StingerCount(d.value.into_int()?));
3003 }
3004 14 => {
3005 entity.insert(SleepingPos(d.value.into_optional_block_pos()?));
3006 }
3007 _ => {}
3008 }
3009 Ok(())
3010 }
3011}
3012
3013#[derive(Bundle)]
3017pub struct AbstractLivingMetadataBundle {
3018 _marker: AbstractLiving,
3019 parent: AbstractEntityMetadataBundle,
3020 auto_spin_attack: AutoSpinAttack,
3021 abstract_living_using_item: AbstractLivingUsingItem,
3022 health: Health,
3023 effect_particles: EffectParticles,
3024 effect_ambience: EffectAmbience,
3025 arrow_count: ArrowCount,
3026 stinger_count: StingerCount,
3027 sleeping_pos: SleepingPos,
3028}
3029impl Default for AbstractLivingMetadataBundle {
3030 fn default() -> Self {
3031 Self {
3032 _marker: AbstractLiving,
3033 parent: Default::default(),
3034 auto_spin_attack: AutoSpinAttack(false),
3035 abstract_living_using_item: AbstractLivingUsingItem(false),
3036 health: Health(1.0),
3037 effect_particles: EffectParticles(Default::default()),
3038 effect_ambience: EffectAmbience(false),
3039 arrow_count: ArrowCount(0),
3040 stinger_count: StingerCount(0),
3041 sleeping_pos: SleepingPos(None),
3042 }
3043 }
3044}
3045
3046#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3047pub struct Small(pub bool);
3049#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3050pub struct ShowArms(pub bool);
3052#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3053pub struct ShowBasePlate(pub bool);
3055#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3056pub struct ArmorStandMarker(pub bool);
3058#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3060pub struct HeadPose(pub Rotations);
3061#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3063pub struct BodyPose(pub Rotations);
3064#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3066pub struct LeftArmPose(pub Rotations);
3067#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3069pub struct RightArmPose(pub Rotations);
3070#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3072pub struct LeftLegPose(pub Rotations);
3073#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3075pub struct RightLegPose(pub Rotations);
3076#[derive(Component)]
3107pub struct ArmorStand;
3108impl ArmorStand {
3109 fn apply_metadata(
3110 entity: &mut bevy_ecs::system::EntityCommands,
3111 d: EntityDataItem,
3112 ) -> Result<(), UpdateMetadataError> {
3113 match d.index {
3114 0..=14 => AbstractLiving::apply_metadata(entity, d)?,
3115 15 => {
3116 let bitfield = d.value.into_byte()?;
3117 entity.insert(Small(bitfield & 0x1 != 0));
3118 entity.insert(ShowArms(bitfield & 0x4 != 0));
3119 entity.insert(ShowBasePlate(bitfield & 0x8 != 0));
3120 entity.insert(ArmorStandMarker(bitfield & 0x10 != 0));
3121 }
3122 16 => {
3123 entity.insert(HeadPose(d.value.into_rotations()?));
3124 }
3125 17 => {
3126 entity.insert(BodyPose(d.value.into_rotations()?));
3127 }
3128 18 => {
3129 entity.insert(LeftArmPose(d.value.into_rotations()?));
3130 }
3131 19 => {
3132 entity.insert(RightArmPose(d.value.into_rotations()?));
3133 }
3134 20 => {
3135 entity.insert(LeftLegPose(d.value.into_rotations()?));
3136 }
3137 21 => {
3138 entity.insert(RightLegPose(d.value.into_rotations()?));
3139 }
3140 _ => {}
3141 }
3142 Ok(())
3143 }
3144}
3145
3146#[derive(Bundle)]
3150pub struct ArmorStandMetadataBundle {
3151 _marker: ArmorStand,
3152 parent: AbstractLivingMetadataBundle,
3153 small: Small,
3154 show_arms: ShowArms,
3155 show_base_plate: ShowBasePlate,
3156 armor_stand_marker: ArmorStandMarker,
3157 head_pose: HeadPose,
3158 body_pose: BodyPose,
3159 left_arm_pose: LeftArmPose,
3160 right_arm_pose: RightArmPose,
3161 left_leg_pose: LeftLegPose,
3162 right_leg_pose: RightLegPose,
3163}
3164impl Default for ArmorStandMetadataBundle {
3165 fn default() -> Self {
3166 Self {
3167 _marker: ArmorStand,
3168 parent: Default::default(),
3169 small: Small(false),
3170 show_arms: ShowArms(false),
3171 show_base_plate: ShowBasePlate(false),
3172 armor_stand_marker: ArmorStandMarker(false),
3173 head_pose: HeadPose(Default::default()),
3174 body_pose: BodyPose(Default::default()),
3175 left_arm_pose: LeftArmPose(Default::default()),
3176 right_arm_pose: RightArmPose(Default::default()),
3177 left_leg_pose: LeftLegPose(Default::default()),
3178 right_leg_pose: RightLegPose(Default::default()),
3179 }
3180 }
3181}
3182
3183#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3185pub struct PlayerMainHand(pub HumanoidArm);
3186#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3188pub struct PlayerModeCustomisation(pub u8);
3189#[derive(Component)]
3213pub struct AbstractAvatar;
3214impl AbstractAvatar {
3215 fn apply_metadata(
3216 entity: &mut bevy_ecs::system::EntityCommands,
3217 d: EntityDataItem,
3218 ) -> Result<(), UpdateMetadataError> {
3219 match d.index {
3220 0..=14 => AbstractLiving::apply_metadata(entity, d)?,
3221 15 => {
3222 entity.insert(PlayerMainHand(d.value.into_humanoid_arm()?));
3223 }
3224 16 => {
3225 entity.insert(PlayerModeCustomisation(d.value.into_byte()?));
3226 }
3227 _ => {}
3228 }
3229 Ok(())
3230 }
3231}
3232
3233#[derive(Bundle)]
3237pub struct AbstractAvatarMetadataBundle {
3238 _marker: AbstractAvatar,
3239 parent: AbstractLivingMetadataBundle,
3240 player_main_hand: PlayerMainHand,
3241 player_mode_customisation: PlayerModeCustomisation,
3242}
3243impl Default for AbstractAvatarMetadataBundle {
3244 fn default() -> Self {
3245 Self {
3246 _marker: AbstractAvatar,
3247 parent: Default::default(),
3248 player_main_hand: PlayerMainHand(Default::default()),
3249 player_mode_customisation: PlayerModeCustomisation(0),
3250 }
3251 }
3252}
3253
3254#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3256pub struct Profile(pub components::Profile);
3257#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3259pub struct Immovable(pub bool);
3260#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3262pub struct Description(pub Option<Box<FormattedText>>);
3263#[derive(Component)]
3288pub struct Mannequin;
3289impl Mannequin {
3290 fn apply_metadata(
3291 entity: &mut bevy_ecs::system::EntityCommands,
3292 d: EntityDataItem,
3293 ) -> Result<(), UpdateMetadataError> {
3294 match d.index {
3295 0..=16 => AbstractAvatar::apply_metadata(entity, d)?,
3296 17 => {
3297 entity.insert(Profile(d.value.into_resolvable_profile()?));
3298 }
3299 18 => {
3300 entity.insert(Immovable(d.value.into_boolean()?));
3301 }
3302 19 => {
3303 entity.insert(Description(d.value.into_optional_formatted_text()?));
3304 }
3305 _ => {}
3306 }
3307 Ok(())
3308 }
3309}
3310
3311#[derive(Bundle)]
3315pub struct MannequinMetadataBundle {
3316 _marker: Mannequin,
3317 parent: AbstractAvatarMetadataBundle,
3318 profile: Profile,
3319 immovable: Immovable,
3320 description: Description,
3321}
3322impl Default for MannequinMetadataBundle {
3323 fn default() -> Self {
3324 Self {
3325 _marker: Mannequin,
3326 parent: Default::default(),
3327 profile: Profile(Default::default()),
3328 immovable: Immovable(false),
3329 description: Description(Default::default()),
3330 }
3331 }
3332}
3333
3334#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3336pub struct PlayerAbsorption(pub f32);
3337#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3339pub struct Score(pub i32);
3340#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3342pub struct ShoulderParrotLeft(pub OptionalUnsignedInt);
3343#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3345pub struct ShoulderParrotRight(pub OptionalUnsignedInt);
3346#[derive(Component)]
3371pub struct Player;
3372impl Player {
3373 fn apply_metadata(
3374 entity: &mut bevy_ecs::system::EntityCommands,
3375 d: EntityDataItem,
3376 ) -> Result<(), UpdateMetadataError> {
3377 match d.index {
3378 0..=16 => AbstractAvatar::apply_metadata(entity, d)?,
3379 17 => {
3380 entity.insert(PlayerAbsorption(d.value.into_float()?));
3381 }
3382 18 => {
3383 entity.insert(Score(d.value.into_int()?));
3384 }
3385 19 => {
3386 entity.insert(ShoulderParrotLeft(d.value.into_optional_unsigned_int()?));
3387 }
3388 20 => {
3389 entity.insert(ShoulderParrotRight(d.value.into_optional_unsigned_int()?));
3390 }
3391 _ => {}
3392 }
3393 Ok(())
3394 }
3395}
3396
3397#[derive(Bundle)]
3401pub struct PlayerMetadataBundle {
3402 _marker: Player,
3403 parent: AbstractAvatarMetadataBundle,
3404 player_absorption: PlayerAbsorption,
3405 score: Score,
3406 shoulder_parrot_left: ShoulderParrotLeft,
3407 shoulder_parrot_right: ShoulderParrotRight,
3408}
3409impl Default for PlayerMetadataBundle {
3410 fn default() -> Self {
3411 Self {
3412 _marker: Player,
3413 parent: Default::default(),
3414 player_absorption: PlayerAbsorption(0.0),
3415 score: Score(0),
3416 shoulder_parrot_left: ShoulderParrotLeft(OptionalUnsignedInt(None)),
3417 shoulder_parrot_right: ShoulderParrotRight(OptionalUnsignedInt(None)),
3418 }
3419 }
3420}
3421
3422#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3423pub struct NoAi(pub bool);
3425#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3426pub struct LeftHanded(pub bool);
3428#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3429pub struct Aggressive(pub bool);
3431#[derive(Component)]
3556pub struct AbstractInsentient;
3557impl AbstractInsentient {
3558 fn apply_metadata(
3559 entity: &mut bevy_ecs::system::EntityCommands,
3560 d: EntityDataItem,
3561 ) -> Result<(), UpdateMetadataError> {
3562 match d.index {
3563 0..=14 => AbstractLiving::apply_metadata(entity, d)?,
3564 15 => {
3565 let bitfield = d.value.into_byte()?;
3566 entity.insert(NoAi(bitfield & 0x1 != 0));
3567 entity.insert(LeftHanded(bitfield & 0x2 != 0));
3568 entity.insert(Aggressive(bitfield & 0x4 != 0));
3569 }
3570 _ => {}
3571 }
3572 Ok(())
3573 }
3574}
3575
3576#[derive(Bundle)]
3580pub struct AbstractInsentientMetadataBundle {
3581 _marker: AbstractInsentient,
3582 parent: AbstractLivingMetadataBundle,
3583 no_ai: NoAi,
3584 left_handed: LeftHanded,
3585 aggressive: Aggressive,
3586}
3587impl Default for AbstractInsentientMetadataBundle {
3588 fn default() -> Self {
3589 Self {
3590 _marker: AbstractInsentient,
3591 parent: Default::default(),
3592 no_ai: NoAi(false),
3593 left_handed: LeftHanded(false),
3594 aggressive: Aggressive(false),
3595 }
3596 }
3597}
3598
3599#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3600pub struct Resting(pub bool);
3602#[derive(Component)]
3624pub struct Bat;
3625impl Bat {
3626 fn apply_metadata(
3627 entity: &mut bevy_ecs::system::EntityCommands,
3628 d: EntityDataItem,
3629 ) -> Result<(), UpdateMetadataError> {
3630 match d.index {
3631 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
3632 16 => {
3633 let bitfield = d.value.into_byte()?;
3634 entity.insert(Resting(bitfield & 0x1 != 0));
3635 }
3636 _ => {}
3637 }
3638 Ok(())
3639 }
3640}
3641
3642#[derive(Bundle)]
3646pub struct BatMetadataBundle {
3647 _marker: Bat,
3648 parent: AbstractInsentientMetadataBundle,
3649 resting: Resting,
3650}
3651impl Default for BatMetadataBundle {
3652 fn default() -> Self {
3653 Self {
3654 _marker: Bat,
3655 parent: Default::default(),
3656 resting: Resting(false),
3657 }
3658 }
3659}
3660
3661#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3663pub struct Phase(pub i32);
3664#[derive(Component)]
3687pub struct EnderDragon;
3688impl EnderDragon {
3689 fn apply_metadata(
3690 entity: &mut bevy_ecs::system::EntityCommands,
3691 d: EntityDataItem,
3692 ) -> Result<(), UpdateMetadataError> {
3693 match d.index {
3694 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
3695 16 => {
3696 entity.insert(Phase(d.value.into_int()?));
3697 }
3698 _ => {}
3699 }
3700 Ok(())
3701 }
3702}
3703
3704#[derive(Bundle)]
3708pub struct EnderDragonMetadataBundle {
3709 _marker: EnderDragon,
3710 parent: AbstractInsentientMetadataBundle,
3711 phase: Phase,
3712}
3713impl Default for EnderDragonMetadataBundle {
3714 fn default() -> Self {
3715 Self {
3716 _marker: EnderDragon,
3717 parent: Default::default(),
3718 phase: Phase(Default::default()),
3719 }
3720 }
3721}
3722
3723#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3725pub struct IsCharging(pub bool);
3726#[derive(Component)]
3748pub struct Ghast;
3749impl Ghast {
3750 fn apply_metadata(
3751 entity: &mut bevy_ecs::system::EntityCommands,
3752 d: EntityDataItem,
3753 ) -> Result<(), UpdateMetadataError> {
3754 match d.index {
3755 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
3756 16 => {
3757 entity.insert(IsCharging(d.value.into_boolean()?));
3758 }
3759 _ => {}
3760 }
3761 Ok(())
3762 }
3763}
3764
3765#[derive(Bundle)]
3769pub struct GhastMetadataBundle {
3770 _marker: Ghast,
3771 parent: AbstractInsentientMetadataBundle,
3772 is_charging: IsCharging,
3773}
3774impl Default for GhastMetadataBundle {
3775 fn default() -> Self {
3776 Self {
3777 _marker: Ghast,
3778 parent: Default::default(),
3779 is_charging: IsCharging(false),
3780 }
3781 }
3782}
3783
3784#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3786pub struct PhantomSize(pub i32);
3787#[derive(Component)]
3809pub struct Phantom;
3810impl Phantom {
3811 fn apply_metadata(
3812 entity: &mut bevy_ecs::system::EntityCommands,
3813 d: EntityDataItem,
3814 ) -> Result<(), UpdateMetadataError> {
3815 match d.index {
3816 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
3817 16 => {
3818 entity.insert(PhantomSize(d.value.into_int()?));
3819 }
3820 _ => {}
3821 }
3822 Ok(())
3823 }
3824}
3825
3826#[derive(Bundle)]
3830pub struct PhantomMetadataBundle {
3831 _marker: Phantom,
3832 parent: AbstractInsentientMetadataBundle,
3833 phantom_size: PhantomSize,
3834}
3835impl Default for PhantomMetadataBundle {
3836 fn default() -> Self {
3837 Self {
3838 _marker: Phantom,
3839 parent: Default::default(),
3840 phantom_size: PhantomSize(0),
3841 }
3842 }
3843}
3844
3845#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3847pub struct SlimeSize(pub i32);
3848#[derive(Component)]
3870pub struct Slime;
3871impl Slime {
3872 fn apply_metadata(
3873 entity: &mut bevy_ecs::system::EntityCommands,
3874 d: EntityDataItem,
3875 ) -> Result<(), UpdateMetadataError> {
3876 match d.index {
3877 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
3878 16 => {
3879 entity.insert(SlimeSize(d.value.into_int()?));
3880 }
3881 _ => {}
3882 }
3883 Ok(())
3884 }
3885}
3886
3887#[derive(Bundle)]
3891pub struct SlimeMetadataBundle {
3892 _marker: Slime,
3893 parent: AbstractInsentientMetadataBundle,
3894 slime_size: SlimeSize,
3895}
3896impl Default for SlimeMetadataBundle {
3897 fn default() -> Self {
3898 Self {
3899 _marker: Slime,
3900 parent: Default::default(),
3901 slime_size: SlimeSize(1),
3902 }
3903 }
3904}
3905
3906#[derive(Component)]
3927pub struct MagmaCube;
3928impl MagmaCube {
3929 fn apply_metadata(
3930 entity: &mut bevy_ecs::system::EntityCommands,
3931 d: EntityDataItem,
3932 ) -> Result<(), UpdateMetadataError> {
3933 match d.index {
3934 0..=16 => Slime::apply_metadata(entity, d)?,
3935 _ => {}
3936 }
3937 Ok(())
3938 }
3939}
3940
3941#[derive(Bundle)]
3945pub struct MagmaCubeMetadataBundle {
3946 _marker: MagmaCube,
3947 parent: SlimeMetadataBundle,
3948}
3949impl Default for MagmaCubeMetadataBundle {
3950 fn default() -> Self {
3951 Self {
3952 _marker: MagmaCube,
3953 parent: Default::default(),
3954 }
3955 }
3956}
3957
3958#[derive(Component)]
4072pub struct AbstractCreature;
4073impl AbstractCreature {
4074 fn apply_metadata(
4075 entity: &mut bevy_ecs::system::EntityCommands,
4076 d: EntityDataItem,
4077 ) -> Result<(), UpdateMetadataError> {
4078 match d.index {
4079 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
4080 _ => {}
4081 }
4082 Ok(())
4083 }
4084}
4085
4086#[derive(Bundle)]
4090pub struct AbstractCreatureMetadataBundle {
4091 _marker: AbstractCreature,
4092 parent: AbstractInsentientMetadataBundle,
4093}
4094impl Default for AbstractCreatureMetadataBundle {
4095 fn default() -> Self {
4096 Self {
4097 _marker: AbstractCreature,
4098 parent: Default::default(),
4099 }
4100 }
4101}
4102
4103#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4105pub struct Dancing(pub bool);
4106#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4108pub struct CanDuplicate(pub bool);
4109#[derive(Component)]
4133pub struct Allay;
4134impl Allay {
4135 fn apply_metadata(
4136 entity: &mut bevy_ecs::system::EntityCommands,
4137 d: EntityDataItem,
4138 ) -> Result<(), UpdateMetadataError> {
4139 match d.index {
4140 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4141 16 => {
4142 entity.insert(Dancing(d.value.into_boolean()?));
4143 }
4144 17 => {
4145 entity.insert(CanDuplicate(d.value.into_boolean()?));
4146 }
4147 _ => {}
4148 }
4149 Ok(())
4150 }
4151}
4152
4153#[derive(Bundle)]
4157pub struct AllayMetadataBundle {
4158 _marker: Allay,
4159 parent: AbstractCreatureMetadataBundle,
4160 dancing: Dancing,
4161 can_duplicate: CanDuplicate,
4162}
4163impl Default for AllayMetadataBundle {
4164 fn default() -> Self {
4165 Self {
4166 _marker: Allay,
4167 parent: Default::default(),
4168 dancing: Dancing(false),
4169 can_duplicate: CanDuplicate(true),
4170 }
4171 }
4172}
4173
4174#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4176pub struct WeatherState(pub WeatheringCopperStateKind);
4177#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4179pub struct CopperGolemState(pub CopperGolemStateKind);
4180#[derive(Component)]
4205pub struct CopperGolem;
4206impl CopperGolem {
4207 fn apply_metadata(
4208 entity: &mut bevy_ecs::system::EntityCommands,
4209 d: EntityDataItem,
4210 ) -> Result<(), UpdateMetadataError> {
4211 match d.index {
4212 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4213 16 => {
4214 entity.insert(WeatherState(d.value.into_weathering_copper_state()?));
4215 }
4216 17 => {
4217 entity.insert(CopperGolemState(d.value.into_copper_golem_state()?));
4218 }
4219 _ => {}
4220 }
4221 Ok(())
4222 }
4223}
4224
4225#[derive(Bundle)]
4229pub struct CopperGolemMetadataBundle {
4230 _marker: CopperGolem,
4231 parent: AbstractCreatureMetadataBundle,
4232 weather_state: WeatherState,
4233 copper_golem_state: CopperGolemState,
4234}
4235impl Default for CopperGolemMetadataBundle {
4236 fn default() -> Self {
4237 Self {
4238 _marker: CopperGolem,
4239 parent: Default::default(),
4240 weather_state: WeatherState(Default::default()),
4241 copper_golem_state: CopperGolemState(Default::default()),
4242 }
4243 }
4244}
4245
4246#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
4247pub struct PlayerCreated(pub bool);
4249#[derive(Component)]
4273pub struct IronGolem;
4274impl IronGolem {
4275 fn apply_metadata(
4276 entity: &mut bevy_ecs::system::EntityCommands,
4277 d: EntityDataItem,
4278 ) -> Result<(), UpdateMetadataError> {
4279 match d.index {
4280 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4281 16 => {
4282 let bitfield = d.value.into_byte()?;
4283 entity.insert(PlayerCreated(bitfield & 0x1 != 0));
4284 }
4285 _ => {}
4286 }
4287 Ok(())
4288 }
4289}
4290
4291#[derive(Bundle)]
4295pub struct IronGolemMetadataBundle {
4296 _marker: IronGolem,
4297 parent: AbstractCreatureMetadataBundle,
4298 player_created: PlayerCreated,
4299}
4300impl Default for IronGolemMetadataBundle {
4301 fn default() -> Self {
4302 Self {
4303 _marker: IronGolem,
4304 parent: Default::default(),
4305 player_created: PlayerCreated(false),
4306 }
4307 }
4308}
4309
4310#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4312pub struct PufferfishFromBucket(pub bool);
4313#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4315pub struct PuffState(pub i32);
4316#[derive(Component)]
4341pub struct Pufferfish;
4342impl Pufferfish {
4343 fn apply_metadata(
4344 entity: &mut bevy_ecs::system::EntityCommands,
4345 d: EntityDataItem,
4346 ) -> Result<(), UpdateMetadataError> {
4347 match d.index {
4348 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4349 16 => {
4350 entity.insert(PufferfishFromBucket(d.value.into_boolean()?));
4351 }
4352 17 => {
4353 entity.insert(PuffState(d.value.into_int()?));
4354 }
4355 _ => {}
4356 }
4357 Ok(())
4358 }
4359}
4360
4361#[derive(Bundle)]
4365pub struct PufferfishMetadataBundle {
4366 _marker: Pufferfish,
4367 parent: AbstractCreatureMetadataBundle,
4368 pufferfish_from_bucket: PufferfishFromBucket,
4369 puff_state: PuffState,
4370}
4371impl Default for PufferfishMetadataBundle {
4372 fn default() -> Self {
4373 Self {
4374 _marker: Pufferfish,
4375 parent: Default::default(),
4376 pufferfish_from_bucket: PufferfishFromBucket(false),
4377 puff_state: PuffState(0),
4378 }
4379 }
4380}
4381
4382#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4384pub struct AttachFace(pub Direction);
4385#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4387pub struct Peek(pub u8);
4388#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4390pub struct Color(pub u8);
4391#[derive(Component)]
4416pub struct Shulker;
4417impl Shulker {
4418 fn apply_metadata(
4419 entity: &mut bevy_ecs::system::EntityCommands,
4420 d: EntityDataItem,
4421 ) -> Result<(), UpdateMetadataError> {
4422 match d.index {
4423 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4424 16 => {
4425 entity.insert(AttachFace(d.value.into_direction()?));
4426 }
4427 17 => {
4428 entity.insert(Peek(d.value.into_byte()?));
4429 }
4430 18 => {
4431 entity.insert(Color(d.value.into_byte()?));
4432 }
4433 _ => {}
4434 }
4435 Ok(())
4436 }
4437}
4438
4439#[derive(Bundle)]
4443pub struct ShulkerMetadataBundle {
4444 _marker: Shulker,
4445 parent: AbstractCreatureMetadataBundle,
4446 attach_face: AttachFace,
4447 peek: Peek,
4448 color: Color,
4449}
4450impl Default for ShulkerMetadataBundle {
4451 fn default() -> Self {
4452 Self {
4453 _marker: Shulker,
4454 parent: Default::default(),
4455 attach_face: AttachFace(Default::default()),
4456 peek: Peek(0),
4457 color: Color(16),
4458 }
4459 }
4460}
4461
4462#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
4463pub struct HasPumpkin(pub bool);
4465#[derive(Component)]
4489pub struct SnowGolem;
4490impl SnowGolem {
4491 fn apply_metadata(
4492 entity: &mut bevy_ecs::system::EntityCommands,
4493 d: EntityDataItem,
4494 ) -> Result<(), UpdateMetadataError> {
4495 match d.index {
4496 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4497 16 => {
4498 let bitfield = d.value.into_byte()?;
4499 entity.insert(HasPumpkin(bitfield & 0x10 != 0));
4500 }
4501 _ => {}
4502 }
4503 Ok(())
4504 }
4505}
4506
4507#[derive(Bundle)]
4511pub struct SnowGolemMetadataBundle {
4512 _marker: SnowGolem,
4513 parent: AbstractCreatureMetadataBundle,
4514 has_pumpkin: HasPumpkin,
4515}
4516impl Default for SnowGolemMetadataBundle {
4517 fn default() -> Self {
4518 Self {
4519 _marker: SnowGolem,
4520 parent: Default::default(),
4521 has_pumpkin: HasPumpkin(true),
4522 }
4523 }
4524}
4525
4526#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4528pub struct TadpoleFromBucket(pub bool);
4529#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4531pub struct TadpoleAgeLocked(pub bool);
4532#[derive(Component)]
4556pub struct Tadpole;
4557impl Tadpole {
4558 fn apply_metadata(
4559 entity: &mut bevy_ecs::system::EntityCommands,
4560 d: EntityDataItem,
4561 ) -> Result<(), UpdateMetadataError> {
4562 match d.index {
4563 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4564 16 => {
4565 entity.insert(TadpoleFromBucket(d.value.into_boolean()?));
4566 }
4567 17 => {
4568 entity.insert(TadpoleAgeLocked(d.value.into_boolean()?));
4569 }
4570 _ => {}
4571 }
4572 Ok(())
4573 }
4574}
4575
4576#[derive(Bundle)]
4580pub struct TadpoleMetadataBundle {
4581 _marker: Tadpole,
4582 parent: AbstractCreatureMetadataBundle,
4583 tadpole_from_bucket: TadpoleFromBucket,
4584 tadpole_age_locked: TadpoleAgeLocked,
4585}
4586impl Default for TadpoleMetadataBundle {
4587 fn default() -> Self {
4588 Self {
4589 _marker: Tadpole,
4590 parent: Default::default(),
4591 tadpole_from_bucket: TadpoleFromBucket(false),
4592 tadpole_age_locked: TadpoleAgeLocked(false),
4593 }
4594 }
4595}
4596
4597#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4599pub struct AbstractAgeableBaby(pub bool);
4600#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4602pub struct AbstractAgeableAgeLocked(pub bool);
4603#[derive(Component)]
4672pub struct AbstractAgeable;
4673impl AbstractAgeable {
4674 fn apply_metadata(
4675 entity: &mut bevy_ecs::system::EntityCommands,
4676 d: EntityDataItem,
4677 ) -> Result<(), UpdateMetadataError> {
4678 match d.index {
4679 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4680 16 => {
4681 entity.insert(AbstractAgeableBaby(d.value.into_boolean()?));
4682 }
4683 17 => {
4684 entity.insert(AbstractAgeableAgeLocked(d.value.into_boolean()?));
4685 }
4686 _ => {}
4687 }
4688 Ok(())
4689 }
4690}
4691
4692#[derive(Bundle)]
4696pub struct AbstractAgeableMetadataBundle {
4697 _marker: AbstractAgeable,
4698 parent: AbstractCreatureMetadataBundle,
4699 abstract_ageable_baby: AbstractAgeableBaby,
4700 abstract_ageable_age_locked: AbstractAgeableAgeLocked,
4701}
4702impl Default for AbstractAgeableMetadataBundle {
4703 fn default() -> Self {
4704 Self {
4705 _marker: AbstractAgeable,
4706 parent: Default::default(),
4707 abstract_ageable_baby: AbstractAgeableBaby(false),
4708 abstract_ageable_age_locked: AbstractAgeableAgeLocked(false),
4709 }
4710 }
4711}
4712
4713#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4715pub struct GotFish(pub bool);
4716#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4718pub struct MoistnessLevel(pub i32);
4719#[derive(Component)]
4744pub struct Dolphin;
4745impl Dolphin {
4746 fn apply_metadata(
4747 entity: &mut bevy_ecs::system::EntityCommands,
4748 d: EntityDataItem,
4749 ) -> Result<(), UpdateMetadataError> {
4750 match d.index {
4751 0..=17 => AbstractAgeable::apply_metadata(entity, d)?,
4752 18 => {
4753 entity.insert(GotFish(d.value.into_boolean()?));
4754 }
4755 19 => {
4756 entity.insert(MoistnessLevel(d.value.into_int()?));
4757 }
4758 _ => {}
4759 }
4760 Ok(())
4761 }
4762}
4763
4764#[derive(Bundle)]
4768pub struct DolphinMetadataBundle {
4769 _marker: Dolphin,
4770 parent: AbstractAgeableMetadataBundle,
4771 got_fish: GotFish,
4772 moistness_level: MoistnessLevel,
4773}
4774impl Default for DolphinMetadataBundle {
4775 fn default() -> Self {
4776 Self {
4777 _marker: Dolphin,
4778 parent: Default::default(),
4779 got_fish: GotFish(false),
4780 moistness_level: MoistnessLevel(2400),
4781 }
4782 }
4783}
4784
4785#[derive(Component)]
4807pub struct Squid;
4808impl Squid {
4809 fn apply_metadata(
4810 entity: &mut bevy_ecs::system::EntityCommands,
4811 d: EntityDataItem,
4812 ) -> Result<(), UpdateMetadataError> {
4813 match d.index {
4814 0..=17 => AbstractAgeable::apply_metadata(entity, d)?,
4815 _ => {}
4816 }
4817 Ok(())
4818 }
4819}
4820
4821#[derive(Bundle)]
4825pub struct SquidMetadataBundle {
4826 _marker: Squid,
4827 parent: AbstractAgeableMetadataBundle,
4828}
4829impl Default for SquidMetadataBundle {
4830 fn default() -> Self {
4831 Self {
4832 _marker: Squid,
4833 parent: Default::default(),
4834 }
4835 }
4836}
4837
4838#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4840pub struct DarkTicksRemaining(pub i32);
4841#[derive(Component)]
4867pub struct GlowSquid;
4868impl GlowSquid {
4869 fn apply_metadata(
4870 entity: &mut bevy_ecs::system::EntityCommands,
4871 d: EntityDataItem,
4872 ) -> Result<(), UpdateMetadataError> {
4873 match d.index {
4874 0..=17 => Squid::apply_metadata(entity, d)?,
4875 18 => {
4876 entity.insert(DarkTicksRemaining(d.value.into_int()?));
4877 }
4878 _ => {}
4879 }
4880 Ok(())
4881 }
4882}
4883
4884#[derive(Bundle)]
4888pub struct GlowSquidMetadataBundle {
4889 _marker: GlowSquid,
4890 parent: SquidMetadataBundle,
4891 dark_ticks_remaining: DarkTicksRemaining,
4892}
4893impl Default for GlowSquidMetadataBundle {
4894 fn default() -> Self {
4895 Self {
4896 _marker: GlowSquid,
4897 parent: Default::default(),
4898 dark_ticks_remaining: DarkTicksRemaining(0),
4899 }
4900 }
4901}
4902
4903#[derive(Component)]
4962pub struct AbstractAnimal;
4963impl AbstractAnimal {
4964 fn apply_metadata(
4965 entity: &mut bevy_ecs::system::EntityCommands,
4966 d: EntityDataItem,
4967 ) -> Result<(), UpdateMetadataError> {
4968 match d.index {
4969 0..=17 => AbstractAgeable::apply_metadata(entity, d)?,
4970 _ => {}
4971 }
4972 Ok(())
4973 }
4974}
4975
4976#[derive(Bundle)]
4980pub struct AbstractAnimalMetadataBundle {
4981 _marker: AbstractAnimal,
4982 parent: AbstractAgeableMetadataBundle,
4983}
4984impl Default for AbstractAnimalMetadataBundle {
4985 fn default() -> Self {
4986 Self {
4987 _marker: AbstractAnimal,
4988 parent: Default::default(),
4989 }
4990 }
4991}
4992
4993#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4995pub struct ArmadilloState(pub ArmadilloStateKind);
4996#[derive(Component)]
5022pub struct Armadillo;
5023impl Armadillo {
5024 fn apply_metadata(
5025 entity: &mut bevy_ecs::system::EntityCommands,
5026 d: EntityDataItem,
5027 ) -> Result<(), UpdateMetadataError> {
5028 match d.index {
5029 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5030 18 => {
5031 entity.insert(ArmadilloState(d.value.into_armadillo_state()?));
5032 }
5033 _ => {}
5034 }
5035 Ok(())
5036 }
5037}
5038
5039#[derive(Bundle)]
5043pub struct ArmadilloMetadataBundle {
5044 _marker: Armadillo,
5045 parent: AbstractAnimalMetadataBundle,
5046 armadillo_state: ArmadilloState,
5047}
5048impl Default for ArmadilloMetadataBundle {
5049 fn default() -> Self {
5050 Self {
5051 _marker: Armadillo,
5052 parent: Default::default(),
5053 armadillo_state: ArmadilloState(Default::default()),
5054 }
5055 }
5056}
5057
5058#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5060pub struct AxolotlVariant(pub i32);
5061#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5063pub struct PlayingDead(pub bool);
5064#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5066pub struct AxolotlFromBucket(pub bool);
5067#[derive(Component)]
5094pub struct Axolotl;
5095impl Axolotl {
5096 fn apply_metadata(
5097 entity: &mut bevy_ecs::system::EntityCommands,
5098 d: EntityDataItem,
5099 ) -> Result<(), UpdateMetadataError> {
5100 match d.index {
5101 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5102 18 => {
5103 entity.insert(AxolotlVariant(d.value.into_int()?));
5104 }
5105 19 => {
5106 entity.insert(PlayingDead(d.value.into_boolean()?));
5107 }
5108 20 => {
5109 entity.insert(AxolotlFromBucket(d.value.into_boolean()?));
5110 }
5111 _ => {}
5112 }
5113 Ok(())
5114 }
5115}
5116
5117#[derive(Bundle)]
5121pub struct AxolotlMetadataBundle {
5122 _marker: Axolotl,
5123 parent: AbstractAnimalMetadataBundle,
5124 axolotl_variant: AxolotlVariant,
5125 playing_dead: PlayingDead,
5126 axolotl_from_bucket: AxolotlFromBucket,
5127}
5128impl Default for AxolotlMetadataBundle {
5129 fn default() -> Self {
5130 Self {
5131 _marker: Axolotl,
5132 parent: Default::default(),
5133 axolotl_variant: AxolotlVariant(0),
5134 playing_dead: PlayingDead(false),
5135 axolotl_from_bucket: AxolotlFromBucket(false),
5136 }
5137 }
5138}
5139
5140#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5141pub struct HasNectar(pub bool);
5143#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5144pub struct HasStung(pub bool);
5146#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5147pub struct BeeRolling(pub bool);
5149#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5151pub struct BeeAngerEndTime(pub i64);
5152#[derive(Component)]
5180pub struct Bee;
5181impl Bee {
5182 fn apply_metadata(
5183 entity: &mut bevy_ecs::system::EntityCommands,
5184 d: EntityDataItem,
5185 ) -> Result<(), UpdateMetadataError> {
5186 match d.index {
5187 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5188 18 => {
5189 let bitfield = d.value.into_byte()?;
5190 entity.insert(HasNectar(bitfield & 0x8 != 0));
5191 entity.insert(HasStung(bitfield & 0x4 != 0));
5192 entity.insert(BeeRolling(bitfield & 0x2 != 0));
5193 }
5194 19 => {
5195 entity.insert(BeeAngerEndTime(d.value.into_long()?));
5196 }
5197 _ => {}
5198 }
5199 Ok(())
5200 }
5201}
5202
5203#[derive(Bundle)]
5207pub struct BeeMetadataBundle {
5208 _marker: Bee,
5209 parent: AbstractAnimalMetadataBundle,
5210 has_nectar: HasNectar,
5211 has_stung: HasStung,
5212 bee_rolling: BeeRolling,
5213 bee_anger_end_time: BeeAngerEndTime,
5214}
5215impl Default for BeeMetadataBundle {
5216 fn default() -> Self {
5217 Self {
5218 _marker: Bee,
5219 parent: Default::default(),
5220 has_nectar: HasNectar(false),
5221 has_stung: HasStung(false),
5222 bee_rolling: BeeRolling(false),
5223 bee_anger_end_time: BeeAngerEndTime(-1),
5224 }
5225 }
5226}
5227
5228#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5230pub struct ChickenVariant(pub azalea_registry::data::ChickenVariant);
5231#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5233pub struct ChickenSoundVariant(pub azalea_registry::data::ChickenSoundVariant);
5234#[derive(Component)]
5260pub struct Chicken;
5261impl Chicken {
5262 fn apply_metadata(
5263 entity: &mut bevy_ecs::system::EntityCommands,
5264 d: EntityDataItem,
5265 ) -> Result<(), UpdateMetadataError> {
5266 match d.index {
5267 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5268 18 => {
5269 entity.insert(ChickenVariant(d.value.into_chicken_variant()?));
5270 }
5271 19 => {
5272 entity.insert(ChickenSoundVariant(d.value.into_chicken_sound_variant()?));
5273 }
5274 _ => {}
5275 }
5276 Ok(())
5277 }
5278}
5279
5280#[derive(Bundle)]
5284pub struct ChickenMetadataBundle {
5285 _marker: Chicken,
5286 parent: AbstractAnimalMetadataBundle,
5287 chicken_variant: ChickenVariant,
5288 chicken_sound_variant: ChickenSoundVariant,
5289}
5290impl Default for ChickenMetadataBundle {
5291 fn default() -> Self {
5292 Self {
5293 _marker: Chicken,
5294 parent: Default::default(),
5295 chicken_variant: ChickenVariant(azalea_registry::data::ChickenVariant::new_raw(0)),
5296 chicken_sound_variant: ChickenSoundVariant(
5297 azalea_registry::data::ChickenSoundVariant::new_raw(0),
5298 ),
5299 }
5300 }
5301}
5302
5303#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5305pub struct CowVariant(pub azalea_registry::data::CowVariant);
5306#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5308pub struct CowSoundVariant(pub azalea_registry::data::CowSoundVariant);
5309#[derive(Component)]
5335pub struct Cow;
5336impl Cow {
5337 fn apply_metadata(
5338 entity: &mut bevy_ecs::system::EntityCommands,
5339 d: EntityDataItem,
5340 ) -> Result<(), UpdateMetadataError> {
5341 match d.index {
5342 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5343 18 => {
5344 entity.insert(CowVariant(d.value.into_cow_variant()?));
5345 }
5346 19 => {
5347 entity.insert(CowSoundVariant(d.value.into_cow_sound_variant()?));
5348 }
5349 _ => {}
5350 }
5351 Ok(())
5352 }
5353}
5354
5355#[derive(Bundle)]
5359pub struct CowMetadataBundle {
5360 _marker: Cow,
5361 parent: AbstractAnimalMetadataBundle,
5362 cow_variant: CowVariant,
5363 cow_sound_variant: CowSoundVariant,
5364}
5365impl Default for CowMetadataBundle {
5366 fn default() -> Self {
5367 Self {
5368 _marker: Cow,
5369 parent: Default::default(),
5370 cow_variant: CowVariant(azalea_registry::data::CowVariant::new_raw(0)),
5371 cow_sound_variant: CowSoundVariant(azalea_registry::data::CowSoundVariant::new_raw(0)),
5372 }
5373 }
5374}
5375
5376#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5378pub struct FoxKind(pub i32);
5379#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5380pub struct FoxSitting(pub bool);
5382#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5383pub struct Faceplanted(pub bool);
5385#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5386pub struct Defending(pub bool);
5388#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5389pub struct Sleeping(pub bool);
5391#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5392pub struct Pouncing(pub bool);
5394#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5395pub struct FoxCrouching(pub bool);
5397#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5398pub struct FoxInterested(pub bool);
5400#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5402pub struct TrustedId0(pub Option<Uuid>);
5403#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5405pub struct TrustedId1(pub Option<Uuid>);
5406#[derive(Component)]
5440pub struct Fox;
5441impl Fox {
5442 fn apply_metadata(
5443 entity: &mut bevy_ecs::system::EntityCommands,
5444 d: EntityDataItem,
5445 ) -> Result<(), UpdateMetadataError> {
5446 match d.index {
5447 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5448 18 => {
5449 entity.insert(FoxKind(d.value.into_int()?));
5450 }
5451 19 => {
5452 let bitfield = d.value.into_byte()?;
5453 entity.insert(FoxSitting(bitfield & 0x1 != 0));
5454 entity.insert(Faceplanted(bitfield & 0x40 != 0));
5455 entity.insert(Defending(bitfield & 0x80 != 0));
5456 entity.insert(Sleeping(bitfield & 0x20 != 0));
5457 entity.insert(Pouncing(bitfield & 0x10 != 0));
5458 entity.insert(FoxCrouching(bitfield & 0x4 != 0));
5459 entity.insert(FoxInterested(bitfield & 0x8 != 0));
5460 }
5461 20 => {
5462 entity.insert(TrustedId0(d.value.into_optional_living_entity_reference()?));
5463 }
5464 21 => {
5465 entity.insert(TrustedId1(d.value.into_optional_living_entity_reference()?));
5466 }
5467 _ => {}
5468 }
5469 Ok(())
5470 }
5471}
5472
5473#[derive(Bundle)]
5477pub struct FoxMetadataBundle {
5478 _marker: Fox,
5479 parent: AbstractAnimalMetadataBundle,
5480 fox_kind: FoxKind,
5481 fox_sitting: FoxSitting,
5482 faceplanted: Faceplanted,
5483 defending: Defending,
5484 sleeping: Sleeping,
5485 pouncing: Pouncing,
5486 fox_crouching: FoxCrouching,
5487 fox_interested: FoxInterested,
5488 trusted_id_0: TrustedId0,
5489 trusted_id_1: TrustedId1,
5490}
5491impl Default for FoxMetadataBundle {
5492 fn default() -> Self {
5493 Self {
5494 _marker: Fox,
5495 parent: Default::default(),
5496 fox_kind: FoxKind(Default::default()),
5497 fox_sitting: FoxSitting(false),
5498 faceplanted: Faceplanted(false),
5499 defending: Defending(false),
5500 sleeping: Sleeping(false),
5501 pouncing: Pouncing(false),
5502 fox_crouching: FoxCrouching(false),
5503 fox_interested: FoxInterested(false),
5504 trusted_id_0: TrustedId0(None),
5505 trusted_id_1: TrustedId1(None),
5506 }
5507 }
5508}
5509
5510#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5512pub struct FrogVariant(pub azalea_registry::data::FrogVariant);
5513#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5515pub struct TongueTarget(pub OptionalUnsignedInt);
5516#[derive(Component)]
5542pub struct Frog;
5543impl Frog {
5544 fn apply_metadata(
5545 entity: &mut bevy_ecs::system::EntityCommands,
5546 d: EntityDataItem,
5547 ) -> Result<(), UpdateMetadataError> {
5548 match d.index {
5549 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5550 18 => {
5551 entity.insert(FrogVariant(d.value.into_frog_variant()?));
5552 }
5553 19 => {
5554 entity.insert(TongueTarget(d.value.into_optional_unsigned_int()?));
5555 }
5556 _ => {}
5557 }
5558 Ok(())
5559 }
5560}
5561
5562#[derive(Bundle)]
5566pub struct FrogMetadataBundle {
5567 _marker: Frog,
5568 parent: AbstractAnimalMetadataBundle,
5569 frog_variant: FrogVariant,
5570 tongue_target: TongueTarget,
5571}
5572impl Default for FrogMetadataBundle {
5573 fn default() -> Self {
5574 Self {
5575 _marker: Frog,
5576 parent: Default::default(),
5577 frog_variant: FrogVariant(azalea_registry::data::FrogVariant::new_raw(0)),
5578 tongue_target: TongueTarget(OptionalUnsignedInt(None)),
5579 }
5580 }
5581}
5582
5583#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5585pub struct IsScreamingGoat(pub bool);
5586#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5588pub struct HasLeftHorn(pub bool);
5589#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5591pub struct HasRightHorn(pub bool);
5592#[derive(Component)]
5619pub struct Goat;
5620impl Goat {
5621 fn apply_metadata(
5622 entity: &mut bevy_ecs::system::EntityCommands,
5623 d: EntityDataItem,
5624 ) -> Result<(), UpdateMetadataError> {
5625 match d.index {
5626 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5627 18 => {
5628 entity.insert(IsScreamingGoat(d.value.into_boolean()?));
5629 }
5630 19 => {
5631 entity.insert(HasLeftHorn(d.value.into_boolean()?));
5632 }
5633 20 => {
5634 entity.insert(HasRightHorn(d.value.into_boolean()?));
5635 }
5636 _ => {}
5637 }
5638 Ok(())
5639 }
5640}
5641
5642#[derive(Bundle)]
5646pub struct GoatMetadataBundle {
5647 _marker: Goat,
5648 parent: AbstractAnimalMetadataBundle,
5649 is_screaming_goat: IsScreamingGoat,
5650 has_left_horn: HasLeftHorn,
5651 has_right_horn: HasRightHorn,
5652}
5653impl Default for GoatMetadataBundle {
5654 fn default() -> Self {
5655 Self {
5656 _marker: Goat,
5657 parent: Default::default(),
5658 is_screaming_goat: IsScreamingGoat(false),
5659 has_left_horn: HasLeftHorn(true),
5660 has_right_horn: HasRightHorn(true),
5661 }
5662 }
5663}
5664
5665#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5667pub struct IsLeashHolder(pub bool);
5668#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5670pub struct StaysStill(pub bool);
5671#[derive(Component)]
5698pub struct HappyGhast;
5699impl HappyGhast {
5700 fn apply_metadata(
5701 entity: &mut bevy_ecs::system::EntityCommands,
5702 d: EntityDataItem,
5703 ) -> Result<(), UpdateMetadataError> {
5704 match d.index {
5705 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5706 18 => {
5707 entity.insert(IsLeashHolder(d.value.into_boolean()?));
5708 }
5709 19 => {
5710 entity.insert(StaysStill(d.value.into_boolean()?));
5711 }
5712 _ => {}
5713 }
5714 Ok(())
5715 }
5716}
5717
5718#[derive(Bundle)]
5722pub struct HappyGhastMetadataBundle {
5723 _marker: HappyGhast,
5724 parent: AbstractAnimalMetadataBundle,
5725 is_leash_holder: IsLeashHolder,
5726 stays_still: StaysStill,
5727}
5728impl Default for HappyGhastMetadataBundle {
5729 fn default() -> Self {
5730 Self {
5731 _marker: HappyGhast,
5732 parent: Default::default(),
5733 is_leash_holder: IsLeashHolder(false),
5734 stays_still: StaysStill(false),
5735 }
5736 }
5737}
5738
5739#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5741pub struct HoglinImmuneToZombification(pub bool);
5742#[derive(Component)]
5767pub struct Hoglin;
5768impl Hoglin {
5769 fn apply_metadata(
5770 entity: &mut bevy_ecs::system::EntityCommands,
5771 d: EntityDataItem,
5772 ) -> Result<(), UpdateMetadataError> {
5773 match d.index {
5774 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5775 18 => {
5776 entity.insert(HoglinImmuneToZombification(d.value.into_boolean()?));
5777 }
5778 _ => {}
5779 }
5780 Ok(())
5781 }
5782}
5783
5784#[derive(Bundle)]
5788pub struct HoglinMetadataBundle {
5789 _marker: Hoglin,
5790 parent: AbstractAnimalMetadataBundle,
5791 hoglin_immune_to_zombification: HoglinImmuneToZombification,
5792}
5793impl Default for HoglinMetadataBundle {
5794 fn default() -> Self {
5795 Self {
5796 _marker: Hoglin,
5797 parent: Default::default(),
5798 hoglin_immune_to_zombification: HoglinImmuneToZombification(false),
5799 }
5800 }
5801}
5802
5803#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5805pub struct MooshroomKind(pub i32);
5806#[derive(Component)]
5832pub struct Mooshroom;
5833impl Mooshroom {
5834 fn apply_metadata(
5835 entity: &mut bevy_ecs::system::EntityCommands,
5836 d: EntityDataItem,
5837 ) -> Result<(), UpdateMetadataError> {
5838 match d.index {
5839 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5840 18 => {
5841 entity.insert(MooshroomKind(d.value.into_int()?));
5842 }
5843 _ => {}
5844 }
5845 Ok(())
5846 }
5847}
5848
5849#[derive(Bundle)]
5853pub struct MooshroomMetadataBundle {
5854 _marker: Mooshroom,
5855 parent: AbstractAnimalMetadataBundle,
5856 mooshroom_kind: MooshroomKind,
5857}
5858impl Default for MooshroomMetadataBundle {
5859 fn default() -> Self {
5860 Self {
5861 _marker: Mooshroom,
5862 parent: Default::default(),
5863 mooshroom_kind: MooshroomKind(Default::default()),
5864 }
5865 }
5866}
5867
5868#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5870pub struct Trusting(pub bool);
5871#[derive(Component)]
5896pub struct Ocelot;
5897impl Ocelot {
5898 fn apply_metadata(
5899 entity: &mut bevy_ecs::system::EntityCommands,
5900 d: EntityDataItem,
5901 ) -> Result<(), UpdateMetadataError> {
5902 match d.index {
5903 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5904 18 => {
5905 entity.insert(Trusting(d.value.into_boolean()?));
5906 }
5907 _ => {}
5908 }
5909 Ok(())
5910 }
5911}
5912
5913#[derive(Bundle)]
5917pub struct OcelotMetadataBundle {
5918 _marker: Ocelot,
5919 parent: AbstractAnimalMetadataBundle,
5920 trusting: Trusting,
5921}
5922impl Default for OcelotMetadataBundle {
5923 fn default() -> Self {
5924 Self {
5925 _marker: Ocelot,
5926 parent: Default::default(),
5927 trusting: Trusting(false),
5928 }
5929 }
5930}
5931
5932#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5934pub struct PandaUnhappyCounter(pub i32);
5935#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5937pub struct SneezeCounter(pub i32);
5938#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5940pub struct EatCounter(pub i32);
5941#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5942pub struct Sneezing(pub bool);
5944#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5945pub struct PandaSitting(pub bool);
5947#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5948pub struct OnBack(pub bool);
5950#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5951pub struct PandaRolling(pub bool);
5953#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5955pub struct HiddenGene(pub u8);
5956#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5958pub struct PandaFlags(pub u8);
5959#[derive(Component)]
5992pub struct Panda;
5993impl Panda {
5994 fn apply_metadata(
5995 entity: &mut bevy_ecs::system::EntityCommands,
5996 d: EntityDataItem,
5997 ) -> Result<(), UpdateMetadataError> {
5998 match d.index {
5999 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6000 18 => {
6001 entity.insert(PandaUnhappyCounter(d.value.into_int()?));
6002 }
6003 19 => {
6004 entity.insert(SneezeCounter(d.value.into_int()?));
6005 }
6006 20 => {
6007 entity.insert(EatCounter(d.value.into_int()?));
6008 }
6009 21 => {
6010 let bitfield = d.value.into_byte()?;
6011 entity.insert(Sneezing(bitfield & 0x2 != 0));
6012 entity.insert(PandaSitting(bitfield & 0x8 != 0));
6013 entity.insert(OnBack(bitfield & 0x10 != 0));
6014 entity.insert(PandaRolling(bitfield & 0x4 != 0));
6015 }
6016 22 => {
6017 entity.insert(HiddenGene(d.value.into_byte()?));
6018 }
6019 23 => {
6020 entity.insert(PandaFlags(d.value.into_byte()?));
6021 }
6022 _ => {}
6023 }
6024 Ok(())
6025 }
6026}
6027
6028#[derive(Bundle)]
6032pub struct PandaMetadataBundle {
6033 _marker: Panda,
6034 parent: AbstractAnimalMetadataBundle,
6035 panda_unhappy_counter: PandaUnhappyCounter,
6036 sneeze_counter: SneezeCounter,
6037 eat_counter: EatCounter,
6038 sneezing: Sneezing,
6039 panda_sitting: PandaSitting,
6040 on_back: OnBack,
6041 panda_rolling: PandaRolling,
6042 hidden_gene: HiddenGene,
6043 panda_flags: PandaFlags,
6044}
6045impl Default for PandaMetadataBundle {
6046 fn default() -> Self {
6047 Self {
6048 _marker: Panda,
6049 parent: Default::default(),
6050 panda_unhappy_counter: PandaUnhappyCounter(0),
6051 sneeze_counter: SneezeCounter(0),
6052 eat_counter: EatCounter(0),
6053 sneezing: Sneezing(false),
6054 panda_sitting: PandaSitting(false),
6055 on_back: OnBack(false),
6056 panda_rolling: PandaRolling(false),
6057 hidden_gene: HiddenGene(0),
6058 panda_flags: PandaFlags(0),
6059 }
6060 }
6061}
6062
6063#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6065pub struct PigBoostTime(pub i32);
6066#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6068pub struct PigVariant(pub azalea_registry::data::PigVariant);
6069#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6071pub struct PigSoundVariant(pub azalea_registry::data::PigSoundVariant);
6072#[derive(Component)]
6099pub struct Pig;
6100impl Pig {
6101 fn apply_metadata(
6102 entity: &mut bevy_ecs::system::EntityCommands,
6103 d: EntityDataItem,
6104 ) -> Result<(), UpdateMetadataError> {
6105 match d.index {
6106 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6107 18 => {
6108 entity.insert(PigBoostTime(d.value.into_int()?));
6109 }
6110 19 => {
6111 entity.insert(PigVariant(d.value.into_pig_variant()?));
6112 }
6113 20 => {
6114 entity.insert(PigSoundVariant(d.value.into_pig_sound_variant()?));
6115 }
6116 _ => {}
6117 }
6118 Ok(())
6119 }
6120}
6121
6122#[derive(Bundle)]
6126pub struct PigMetadataBundle {
6127 _marker: Pig,
6128 parent: AbstractAnimalMetadataBundle,
6129 pig_boost_time: PigBoostTime,
6130 pig_variant: PigVariant,
6131 pig_sound_variant: PigSoundVariant,
6132}
6133impl Default for PigMetadataBundle {
6134 fn default() -> Self {
6135 Self {
6136 _marker: Pig,
6137 parent: Default::default(),
6138 pig_boost_time: PigBoostTime(0),
6139 pig_variant: PigVariant(azalea_registry::data::PigVariant::new_raw(0)),
6140 pig_sound_variant: PigSoundVariant(azalea_registry::data::PigSoundVariant::new_raw(0)),
6141 }
6142 }
6143}
6144
6145#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6147pub struct PolarBearStanding(pub bool);
6148#[derive(Component)]
6174pub struct PolarBear;
6175impl PolarBear {
6176 fn apply_metadata(
6177 entity: &mut bevy_ecs::system::EntityCommands,
6178 d: EntityDataItem,
6179 ) -> Result<(), UpdateMetadataError> {
6180 match d.index {
6181 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6182 18 => {
6183 entity.insert(PolarBearStanding(d.value.into_boolean()?));
6184 }
6185 _ => {}
6186 }
6187 Ok(())
6188 }
6189}
6190
6191#[derive(Bundle)]
6195pub struct PolarBearMetadataBundle {
6196 _marker: PolarBear,
6197 parent: AbstractAnimalMetadataBundle,
6198 polar_bear_standing: PolarBearStanding,
6199}
6200impl Default for PolarBearMetadataBundle {
6201 fn default() -> Self {
6202 Self {
6203 _marker: PolarBear,
6204 parent: Default::default(),
6205 polar_bear_standing: PolarBearStanding(false),
6206 }
6207 }
6208}
6209
6210#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6212pub struct RabbitKind(pub i32);
6213#[derive(Component)]
6238pub struct Rabbit;
6239impl Rabbit {
6240 fn apply_metadata(
6241 entity: &mut bevy_ecs::system::EntityCommands,
6242 d: EntityDataItem,
6243 ) -> Result<(), UpdateMetadataError> {
6244 match d.index {
6245 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6246 18 => {
6247 entity.insert(RabbitKind(d.value.into_int()?));
6248 }
6249 _ => {}
6250 }
6251 Ok(())
6252 }
6253}
6254
6255#[derive(Bundle)]
6259pub struct RabbitMetadataBundle {
6260 _marker: Rabbit,
6261 parent: AbstractAnimalMetadataBundle,
6262 rabbit_kind: RabbitKind,
6263}
6264impl Default for RabbitMetadataBundle {
6265 fn default() -> Self {
6266 Self {
6267 _marker: Rabbit,
6268 parent: Default::default(),
6269 rabbit_kind: RabbitKind(Default::default()),
6270 }
6271 }
6272}
6273
6274#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6275pub struct SheepSheared(pub bool);
6277#[derive(Component)]
6302pub struct Sheep;
6303impl Sheep {
6304 fn apply_metadata(
6305 entity: &mut bevy_ecs::system::EntityCommands,
6306 d: EntityDataItem,
6307 ) -> Result<(), UpdateMetadataError> {
6308 match d.index {
6309 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6310 18 => {
6311 let bitfield = d.value.into_byte()?;
6312 entity.insert(SheepSheared(bitfield & 0x10 != 0));
6313 }
6314 _ => {}
6315 }
6316 Ok(())
6317 }
6318}
6319
6320#[derive(Bundle)]
6324pub struct SheepMetadataBundle {
6325 _marker: Sheep,
6326 parent: AbstractAnimalMetadataBundle,
6327 sheep_sheared: SheepSheared,
6328}
6329impl Default for SheepMetadataBundle {
6330 fn default() -> Self {
6331 Self {
6332 _marker: Sheep,
6333 parent: Default::default(),
6334 sheep_sheared: SheepSheared(false),
6335 }
6336 }
6337}
6338
6339#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6341pub struct SnifferState(pub SnifferStateKind);
6342#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6344pub struct DropSeedAtTick(pub i32);
6345#[derive(Component)]
6371pub struct Sniffer;
6372impl Sniffer {
6373 fn apply_metadata(
6374 entity: &mut bevy_ecs::system::EntityCommands,
6375 d: EntityDataItem,
6376 ) -> Result<(), UpdateMetadataError> {
6377 match d.index {
6378 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6379 18 => {
6380 entity.insert(SnifferState(d.value.into_sniffer_state()?));
6381 }
6382 19 => {
6383 entity.insert(DropSeedAtTick(d.value.into_int()?));
6384 }
6385 _ => {}
6386 }
6387 Ok(())
6388 }
6389}
6390
6391#[derive(Bundle)]
6395pub struct SnifferMetadataBundle {
6396 _marker: Sniffer,
6397 parent: AbstractAnimalMetadataBundle,
6398 sniffer_state: SnifferState,
6399 drop_seed_at_tick: DropSeedAtTick,
6400}
6401impl Default for SnifferMetadataBundle {
6402 fn default() -> Self {
6403 Self {
6404 _marker: Sniffer,
6405 parent: Default::default(),
6406 sniffer_state: SnifferState(Default::default()),
6407 drop_seed_at_tick: DropSeedAtTick(0),
6408 }
6409 }
6410}
6411
6412#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6414pub struct StriderBoostTime(pub i32);
6415#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6417pub struct Suffocating(pub bool);
6418#[derive(Component)]
6444pub struct Strider;
6445impl Strider {
6446 fn apply_metadata(
6447 entity: &mut bevy_ecs::system::EntityCommands,
6448 d: EntityDataItem,
6449 ) -> Result<(), UpdateMetadataError> {
6450 match d.index {
6451 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6452 18 => {
6453 entity.insert(StriderBoostTime(d.value.into_int()?));
6454 }
6455 19 => {
6456 entity.insert(Suffocating(d.value.into_boolean()?));
6457 }
6458 _ => {}
6459 }
6460 Ok(())
6461 }
6462}
6463
6464#[derive(Bundle)]
6468pub struct StriderMetadataBundle {
6469 _marker: Strider,
6470 parent: AbstractAnimalMetadataBundle,
6471 strider_boost_time: StriderBoostTime,
6472 suffocating: Suffocating,
6473}
6474impl Default for StriderMetadataBundle {
6475 fn default() -> Self {
6476 Self {
6477 _marker: Strider,
6478 parent: Default::default(),
6479 strider_boost_time: StriderBoostTime(0),
6480 suffocating: Suffocating(false),
6481 }
6482 }
6483}
6484
6485#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6487pub struct HasEgg(pub bool);
6488#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6490pub struct LayingEgg(pub bool);
6491#[derive(Component)]
6517pub struct Turtle;
6518impl Turtle {
6519 fn apply_metadata(
6520 entity: &mut bevy_ecs::system::EntityCommands,
6521 d: EntityDataItem,
6522 ) -> Result<(), UpdateMetadataError> {
6523 match d.index {
6524 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6525 18 => {
6526 entity.insert(HasEgg(d.value.into_boolean()?));
6527 }
6528 19 => {
6529 entity.insert(LayingEgg(d.value.into_boolean()?));
6530 }
6531 _ => {}
6532 }
6533 Ok(())
6534 }
6535}
6536
6537#[derive(Bundle)]
6541pub struct TurtleMetadataBundle {
6542 _marker: Turtle,
6543 parent: AbstractAnimalMetadataBundle,
6544 has_egg: HasEgg,
6545 laying_egg: LayingEgg,
6546}
6547impl Default for TurtleMetadataBundle {
6548 fn default() -> Self {
6549 Self {
6550 _marker: Turtle,
6551 parent: Default::default(),
6552 has_egg: HasEgg(false),
6553 laying_egg: LayingEgg(false),
6554 }
6555 }
6556}
6557
6558#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6559pub struct Tamed(pub bool);
6561#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6562pub struct Eating(pub bool);
6564#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6565pub struct AbstractHorseStanding(pub bool);
6567#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6568pub struct Bred(pub bool);
6570#[derive(Component)]
6608pub struct AbstractHorse;
6609impl AbstractHorse {
6610 fn apply_metadata(
6611 entity: &mut bevy_ecs::system::EntityCommands,
6612 d: EntityDataItem,
6613 ) -> Result<(), UpdateMetadataError> {
6614 match d.index {
6615 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6616 18 => {
6617 let bitfield = d.value.into_byte()?;
6618 entity.insert(Tamed(bitfield & 0x2 != 0));
6619 entity.insert(Eating(bitfield & 0x10 != 0));
6620 entity.insert(AbstractHorseStanding(bitfield & 0x20 != 0));
6621 entity.insert(Bred(bitfield & 0x8 != 0));
6622 }
6623 _ => {}
6624 }
6625 Ok(())
6626 }
6627}
6628
6629#[derive(Bundle)]
6633pub struct AbstractHorseMetadataBundle {
6634 _marker: AbstractHorse,
6635 parent: AbstractAnimalMetadataBundle,
6636 tamed: Tamed,
6637 eating: Eating,
6638 abstract_horse_standing: AbstractHorseStanding,
6639 bred: Bred,
6640}
6641impl Default for AbstractHorseMetadataBundle {
6642 fn default() -> Self {
6643 Self {
6644 _marker: AbstractHorse,
6645 parent: Default::default(),
6646 tamed: Tamed(false),
6647 eating: Eating(false),
6648 abstract_horse_standing: AbstractHorseStanding(false),
6649 bred: Bred(false),
6650 }
6651 }
6652}
6653
6654#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6656pub struct CamelDash(pub bool);
6657#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6659pub struct LastPoseChangeTick(pub i64);
6660#[derive(Component)]
6687pub struct Camel;
6688impl Camel {
6689 fn apply_metadata(
6690 entity: &mut bevy_ecs::system::EntityCommands,
6691 d: EntityDataItem,
6692 ) -> Result<(), UpdateMetadataError> {
6693 match d.index {
6694 0..=18 => AbstractHorse::apply_metadata(entity, d)?,
6695 19 => {
6696 entity.insert(CamelDash(d.value.into_boolean()?));
6697 }
6698 20 => {
6699 entity.insert(LastPoseChangeTick(d.value.into_long()?));
6700 }
6701 _ => {}
6702 }
6703 Ok(())
6704 }
6705}
6706
6707#[derive(Bundle)]
6711pub struct CamelMetadataBundle {
6712 _marker: Camel,
6713 parent: AbstractHorseMetadataBundle,
6714 camel_dash: CamelDash,
6715 last_pose_change_tick: LastPoseChangeTick,
6716}
6717impl Default for CamelMetadataBundle {
6718 fn default() -> Self {
6719 Self {
6720 _marker: Camel,
6721 parent: Default::default(),
6722 camel_dash: CamelDash(false),
6723 last_pose_change_tick: LastPoseChangeTick(0),
6724 }
6725 }
6726}
6727
6728#[derive(Component)]
6753pub struct CamelHusk;
6754impl CamelHusk {
6755 fn apply_metadata(
6756 entity: &mut bevy_ecs::system::EntityCommands,
6757 d: EntityDataItem,
6758 ) -> Result<(), UpdateMetadataError> {
6759 match d.index {
6760 0..=20 => Camel::apply_metadata(entity, d)?,
6761 _ => {}
6762 }
6763 Ok(())
6764 }
6765}
6766
6767#[derive(Bundle)]
6771pub struct CamelHuskMetadataBundle {
6772 _marker: CamelHusk,
6773 parent: CamelMetadataBundle,
6774}
6775impl Default for CamelHuskMetadataBundle {
6776 fn default() -> Self {
6777 Self {
6778 _marker: CamelHusk,
6779 parent: Default::default(),
6780 }
6781 }
6782}
6783
6784#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6786pub struct HorseTypeVariant(pub i32);
6787#[derive(Component)]
6813pub struct Horse;
6814impl Horse {
6815 fn apply_metadata(
6816 entity: &mut bevy_ecs::system::EntityCommands,
6817 d: EntityDataItem,
6818 ) -> Result<(), UpdateMetadataError> {
6819 match d.index {
6820 0..=18 => AbstractHorse::apply_metadata(entity, d)?,
6821 19 => {
6822 entity.insert(HorseTypeVariant(d.value.into_int()?));
6823 }
6824 _ => {}
6825 }
6826 Ok(())
6827 }
6828}
6829
6830#[derive(Bundle)]
6834pub struct HorseMetadataBundle {
6835 _marker: Horse,
6836 parent: AbstractHorseMetadataBundle,
6837 horse_type_variant: HorseTypeVariant,
6838}
6839impl Default for HorseMetadataBundle {
6840 fn default() -> Self {
6841 Self {
6842 _marker: Horse,
6843 parent: Default::default(),
6844 horse_type_variant: HorseTypeVariant(0),
6845 }
6846 }
6847}
6848
6849#[derive(Component)]
6873pub struct SkeletonHorse;
6874impl SkeletonHorse {
6875 fn apply_metadata(
6876 entity: &mut bevy_ecs::system::EntityCommands,
6877 d: EntityDataItem,
6878 ) -> Result<(), UpdateMetadataError> {
6879 match d.index {
6880 0..=18 => AbstractHorse::apply_metadata(entity, d)?,
6881 _ => {}
6882 }
6883 Ok(())
6884 }
6885}
6886
6887#[derive(Bundle)]
6891pub struct SkeletonHorseMetadataBundle {
6892 _marker: SkeletonHorse,
6893 parent: AbstractHorseMetadataBundle,
6894}
6895impl Default for SkeletonHorseMetadataBundle {
6896 fn default() -> Self {
6897 Self {
6898 _marker: SkeletonHorse,
6899 parent: Default::default(),
6900 }
6901 }
6902}
6903
6904#[derive(Component)]
6928pub struct ZombieHorse;
6929impl ZombieHorse {
6930 fn apply_metadata(
6931 entity: &mut bevy_ecs::system::EntityCommands,
6932 d: EntityDataItem,
6933 ) -> Result<(), UpdateMetadataError> {
6934 match d.index {
6935 0..=18 => AbstractHorse::apply_metadata(entity, d)?,
6936 _ => {}
6937 }
6938 Ok(())
6939 }
6940}
6941
6942#[derive(Bundle)]
6946pub struct ZombieHorseMetadataBundle {
6947 _marker: ZombieHorse,
6948 parent: AbstractHorseMetadataBundle,
6949}
6950impl Default for ZombieHorseMetadataBundle {
6951 fn default() -> Self {
6952 Self {
6953 _marker: ZombieHorse,
6954 parent: Default::default(),
6955 }
6956 }
6957}
6958
6959#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6961pub struct Chest(pub bool);
6962#[derive(Component)]
6992pub struct AbstractChestedHorse;
6993impl AbstractChestedHorse {
6994 fn apply_metadata(
6995 entity: &mut bevy_ecs::system::EntityCommands,
6996 d: EntityDataItem,
6997 ) -> Result<(), UpdateMetadataError> {
6998 match d.index {
6999 0..=18 => AbstractHorse::apply_metadata(entity, d)?,
7000 19 => {
7001 entity.insert(Chest(d.value.into_boolean()?));
7002 }
7003 _ => {}
7004 }
7005 Ok(())
7006 }
7007}
7008
7009#[derive(Bundle)]
7013pub struct AbstractChestedHorseMetadataBundle {
7014 _marker: AbstractChestedHorse,
7015 parent: AbstractHorseMetadataBundle,
7016 chest: Chest,
7017}
7018impl Default for AbstractChestedHorseMetadataBundle {
7019 fn default() -> Self {
7020 Self {
7021 _marker: AbstractChestedHorse,
7022 parent: Default::default(),
7023 chest: Chest(false),
7024 }
7025 }
7026}
7027
7028#[derive(Component)]
7053pub struct Donkey;
7054impl Donkey {
7055 fn apply_metadata(
7056 entity: &mut bevy_ecs::system::EntityCommands,
7057 d: EntityDataItem,
7058 ) -> Result<(), UpdateMetadataError> {
7059 match d.index {
7060 0..=19 => AbstractChestedHorse::apply_metadata(entity, d)?,
7061 _ => {}
7062 }
7063 Ok(())
7064 }
7065}
7066
7067#[derive(Bundle)]
7071pub struct DonkeyMetadataBundle {
7072 _marker: Donkey,
7073 parent: AbstractChestedHorseMetadataBundle,
7074}
7075impl Default for DonkeyMetadataBundle {
7076 fn default() -> Self {
7077 Self {
7078 _marker: Donkey,
7079 parent: Default::default(),
7080 }
7081 }
7082}
7083
7084#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7086pub struct Strength(pub i32);
7087#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7089pub struct LlamaVariant(pub i32);
7090#[derive(Component)]
7118pub struct Llama;
7119impl Llama {
7120 fn apply_metadata(
7121 entity: &mut bevy_ecs::system::EntityCommands,
7122 d: EntityDataItem,
7123 ) -> Result<(), UpdateMetadataError> {
7124 match d.index {
7125 0..=19 => AbstractChestedHorse::apply_metadata(entity, d)?,
7126 20 => {
7127 entity.insert(Strength(d.value.into_int()?));
7128 }
7129 21 => {
7130 entity.insert(LlamaVariant(d.value.into_int()?));
7131 }
7132 _ => {}
7133 }
7134 Ok(())
7135 }
7136}
7137
7138#[derive(Bundle)]
7142pub struct LlamaMetadataBundle {
7143 _marker: Llama,
7144 parent: AbstractChestedHorseMetadataBundle,
7145 strength: Strength,
7146 llama_variant: LlamaVariant,
7147}
7148impl Default for LlamaMetadataBundle {
7149 fn default() -> Self {
7150 Self {
7151 _marker: Llama,
7152 parent: Default::default(),
7153 strength: Strength(0),
7154 llama_variant: LlamaVariant(0),
7155 }
7156 }
7157}
7158
7159#[derive(Component)]
7185pub struct TraderLlama;
7186impl TraderLlama {
7187 fn apply_metadata(
7188 entity: &mut bevy_ecs::system::EntityCommands,
7189 d: EntityDataItem,
7190 ) -> Result<(), UpdateMetadataError> {
7191 match d.index {
7192 0..=21 => Llama::apply_metadata(entity, d)?,
7193 _ => {}
7194 }
7195 Ok(())
7196 }
7197}
7198
7199#[derive(Bundle)]
7203pub struct TraderLlamaMetadataBundle {
7204 _marker: TraderLlama,
7205 parent: LlamaMetadataBundle,
7206}
7207impl Default for TraderLlamaMetadataBundle {
7208 fn default() -> Self {
7209 Self {
7210 _marker: TraderLlama,
7211 parent: Default::default(),
7212 }
7213 }
7214}
7215
7216#[derive(Component)]
7241pub struct Mule;
7242impl Mule {
7243 fn apply_metadata(
7244 entity: &mut bevy_ecs::system::EntityCommands,
7245 d: EntityDataItem,
7246 ) -> Result<(), UpdateMetadataError> {
7247 match d.index {
7248 0..=19 => AbstractChestedHorse::apply_metadata(entity, d)?,
7249 _ => {}
7250 }
7251 Ok(())
7252 }
7253}
7254
7255#[derive(Bundle)]
7259pub struct MuleMetadataBundle {
7260 _marker: Mule,
7261 parent: AbstractChestedHorseMetadataBundle,
7262}
7263impl Default for MuleMetadataBundle {
7264 fn default() -> Self {
7265 Self {
7266 _marker: Mule,
7267 parent: Default::default(),
7268 }
7269 }
7270}
7271
7272#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
7273pub struct Tame(pub bool);
7275#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
7276pub struct InSittingPose(pub bool);
7278#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7280pub struct Owneruuid(pub Option<Uuid>);
7281#[derive(Component)]
7314pub struct AbstractTameable;
7315impl AbstractTameable {
7316 fn apply_metadata(
7317 entity: &mut bevy_ecs::system::EntityCommands,
7318 d: EntityDataItem,
7319 ) -> Result<(), UpdateMetadataError> {
7320 match d.index {
7321 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
7322 18 => {
7323 let bitfield = d.value.into_byte()?;
7324 entity.insert(Tame(bitfield & 0x4 != 0));
7325 entity.insert(InSittingPose(bitfield & 0x1 != 0));
7326 }
7327 19 => {
7328 entity.insert(Owneruuid(d.value.into_optional_living_entity_reference()?));
7329 }
7330 _ => {}
7331 }
7332 Ok(())
7333 }
7334}
7335
7336#[derive(Bundle)]
7340pub struct AbstractTameableMetadataBundle {
7341 _marker: AbstractTameable,
7342 parent: AbstractAnimalMetadataBundle,
7343 tame: Tame,
7344 in_sitting_pose: InSittingPose,
7345 owneruuid: Owneruuid,
7346}
7347impl Default for AbstractTameableMetadataBundle {
7348 fn default() -> Self {
7349 Self {
7350 _marker: AbstractTameable,
7351 parent: Default::default(),
7352 tame: Tame(false),
7353 in_sitting_pose: InSittingPose(false),
7354 owneruuid: Owneruuid(None),
7355 }
7356 }
7357}
7358
7359#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7361pub struct CatVariant(pub azalea_registry::data::CatVariant);
7362#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7364pub struct IsLying(pub bool);
7365#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7367pub struct RelaxStateOne(pub bool);
7368#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7370pub struct CatCollarColor(pub i32);
7371#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7373pub struct CatSoundVariant(pub azalea_registry::data::CatSoundVariant);
7374#[derive(Component)]
7404pub struct Cat;
7405impl Cat {
7406 fn apply_metadata(
7407 entity: &mut bevy_ecs::system::EntityCommands,
7408 d: EntityDataItem,
7409 ) -> Result<(), UpdateMetadataError> {
7410 match d.index {
7411 0..=19 => AbstractTameable::apply_metadata(entity, d)?,
7412 20 => {
7413 entity.insert(CatVariant(d.value.into_cat_variant()?));
7414 }
7415 21 => {
7416 entity.insert(IsLying(d.value.into_boolean()?));
7417 }
7418 22 => {
7419 entity.insert(RelaxStateOne(d.value.into_boolean()?));
7420 }
7421 23 => {
7422 entity.insert(CatCollarColor(d.value.into_int()?));
7423 }
7424 24 => {
7425 entity.insert(CatSoundVariant(d.value.into_cat_sound_variant()?));
7426 }
7427 _ => {}
7428 }
7429 Ok(())
7430 }
7431}
7432
7433#[derive(Bundle)]
7437pub struct CatMetadataBundle {
7438 _marker: Cat,
7439 parent: AbstractTameableMetadataBundle,
7440 cat_variant: CatVariant,
7441 is_lying: IsLying,
7442 relax_state_one: RelaxStateOne,
7443 cat_collar_color: CatCollarColor,
7444 cat_sound_variant: CatSoundVariant,
7445}
7446impl Default for CatMetadataBundle {
7447 fn default() -> Self {
7448 Self {
7449 _marker: Cat,
7450 parent: Default::default(),
7451 cat_variant: CatVariant(azalea_registry::data::CatVariant::new_raw(0)),
7452 is_lying: IsLying(false),
7453 relax_state_one: RelaxStateOne(false),
7454 cat_collar_color: CatCollarColor(Default::default()),
7455 cat_sound_variant: CatSoundVariant(azalea_registry::data::CatSoundVariant::new_raw(0)),
7456 }
7457 }
7458}
7459
7460#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7462pub struct ParrotVariant(pub i32);
7463#[derive(Component)]
7489pub struct Parrot;
7490impl Parrot {
7491 fn apply_metadata(
7492 entity: &mut bevy_ecs::system::EntityCommands,
7493 d: EntityDataItem,
7494 ) -> Result<(), UpdateMetadataError> {
7495 match d.index {
7496 0..=19 => AbstractTameable::apply_metadata(entity, d)?,
7497 20 => {
7498 entity.insert(ParrotVariant(d.value.into_int()?));
7499 }
7500 _ => {}
7501 }
7502 Ok(())
7503 }
7504}
7505
7506#[derive(Bundle)]
7510pub struct ParrotMetadataBundle {
7511 _marker: Parrot,
7512 parent: AbstractTameableMetadataBundle,
7513 parrot_variant: ParrotVariant,
7514}
7515impl Default for ParrotMetadataBundle {
7516 fn default() -> Self {
7517 Self {
7518 _marker: Parrot,
7519 parent: Default::default(),
7520 parrot_variant: ParrotVariant(Default::default()),
7521 }
7522 }
7523}
7524
7525#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7527pub struct WolfInterested(pub bool);
7528#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7530pub struct WolfCollarColor(pub i32);
7531#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7533pub struct WolfAngerEndTime(pub i64);
7534#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7536pub struct WolfVariant(pub azalea_registry::data::WolfVariant);
7537#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7539pub struct WolfSoundVariant(pub azalea_registry::data::WolfSoundVariant);
7540#[derive(Component)]
7570pub struct Wolf;
7571impl Wolf {
7572 fn apply_metadata(
7573 entity: &mut bevy_ecs::system::EntityCommands,
7574 d: EntityDataItem,
7575 ) -> Result<(), UpdateMetadataError> {
7576 match d.index {
7577 0..=19 => AbstractTameable::apply_metadata(entity, d)?,
7578 20 => {
7579 entity.insert(WolfInterested(d.value.into_boolean()?));
7580 }
7581 21 => {
7582 entity.insert(WolfCollarColor(d.value.into_int()?));
7583 }
7584 22 => {
7585 entity.insert(WolfAngerEndTime(d.value.into_long()?));
7586 }
7587 23 => {
7588 entity.insert(WolfVariant(d.value.into_wolf_variant()?));
7589 }
7590 24 => {
7591 entity.insert(WolfSoundVariant(d.value.into_wolf_sound_variant()?));
7592 }
7593 _ => {}
7594 }
7595 Ok(())
7596 }
7597}
7598
7599#[derive(Bundle)]
7603pub struct WolfMetadataBundle {
7604 _marker: Wolf,
7605 parent: AbstractTameableMetadataBundle,
7606 wolf_interested: WolfInterested,
7607 wolf_collar_color: WolfCollarColor,
7608 wolf_anger_end_time: WolfAngerEndTime,
7609 wolf_variant: WolfVariant,
7610 wolf_sound_variant: WolfSoundVariant,
7611}
7612impl Default for WolfMetadataBundle {
7613 fn default() -> Self {
7614 Self {
7615 _marker: Wolf,
7616 parent: Default::default(),
7617 wolf_interested: WolfInterested(false),
7618 wolf_collar_color: WolfCollarColor(Default::default()),
7619 wolf_anger_end_time: WolfAngerEndTime(-1),
7620 wolf_variant: WolfVariant(azalea_registry::data::WolfVariant::new_raw(0)),
7621 wolf_sound_variant: WolfSoundVariant(azalea_registry::data::WolfSoundVariant::new_raw(
7622 0,
7623 )),
7624 }
7625 }
7626}
7627
7628#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7630pub struct AbstractNautilusDash(pub bool);
7631#[derive(Component)]
7659pub struct AbstractNautilus;
7660impl AbstractNautilus {
7661 fn apply_metadata(
7662 entity: &mut bevy_ecs::system::EntityCommands,
7663 d: EntityDataItem,
7664 ) -> Result<(), UpdateMetadataError> {
7665 match d.index {
7666 0..=19 => AbstractTameable::apply_metadata(entity, d)?,
7667 20 => {
7668 entity.insert(AbstractNautilusDash(d.value.into_boolean()?));
7669 }
7670 _ => {}
7671 }
7672 Ok(())
7673 }
7674}
7675
7676#[derive(Bundle)]
7680pub struct AbstractNautilusMetadataBundle {
7681 _marker: AbstractNautilus,
7682 parent: AbstractTameableMetadataBundle,
7683 abstract_nautilus_dash: AbstractNautilusDash,
7684}
7685impl Default for AbstractNautilusMetadataBundle {
7686 fn default() -> Self {
7687 Self {
7688 _marker: AbstractNautilus,
7689 parent: Default::default(),
7690 abstract_nautilus_dash: AbstractNautilusDash(false),
7691 }
7692 }
7693}
7694
7695#[derive(Component)]
7720pub struct Nautilus;
7721impl Nautilus {
7722 fn apply_metadata(
7723 entity: &mut bevy_ecs::system::EntityCommands,
7724 d: EntityDataItem,
7725 ) -> Result<(), UpdateMetadataError> {
7726 match d.index {
7727 0..=20 => AbstractNautilus::apply_metadata(entity, d)?,
7728 _ => {}
7729 }
7730 Ok(())
7731 }
7732}
7733
7734#[derive(Bundle)]
7738pub struct NautilusMetadataBundle {
7739 _marker: Nautilus,
7740 parent: AbstractNautilusMetadataBundle,
7741}
7742impl Default for NautilusMetadataBundle {
7743 fn default() -> Self {
7744 Self {
7745 _marker: Nautilus,
7746 parent: Default::default(),
7747 }
7748 }
7749}
7750
7751#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7753pub struct ZombieNautilusVariant(pub azalea_registry::data::ZombieNautilusVariant);
7754#[derive(Component)]
7782pub struct ZombieNautilus;
7783impl ZombieNautilus {
7784 fn apply_metadata(
7785 entity: &mut bevy_ecs::system::EntityCommands,
7786 d: EntityDataItem,
7787 ) -> Result<(), UpdateMetadataError> {
7788 match d.index {
7789 0..=20 => AbstractNautilus::apply_metadata(entity, d)?,
7790 21 => {
7791 entity.insert(ZombieNautilusVariant(
7792 d.value.into_zombie_nautilus_variant()?,
7793 ));
7794 }
7795 _ => {}
7796 }
7797 Ok(())
7798 }
7799}
7800
7801#[derive(Bundle)]
7805pub struct ZombieNautilusMetadataBundle {
7806 _marker: ZombieNautilus,
7807 parent: AbstractNautilusMetadataBundle,
7808 zombie_nautilus_variant: ZombieNautilusVariant,
7809}
7810impl Default for ZombieNautilusMetadataBundle {
7811 fn default() -> Self {
7812 Self {
7813 _marker: ZombieNautilus,
7814 parent: Default::default(),
7815 zombie_nautilus_variant: ZombieNautilusVariant(
7816 azalea_registry::data::ZombieNautilusVariant::new_raw(0),
7817 ),
7818 }
7819 }
7820}
7821
7822#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7824pub struct AbstractVillagerUnhappyCounter(pub i32);
7825#[derive(Component)]
7851pub struct AbstractVillager;
7852impl AbstractVillager {
7853 fn apply_metadata(
7854 entity: &mut bevy_ecs::system::EntityCommands,
7855 d: EntityDataItem,
7856 ) -> Result<(), UpdateMetadataError> {
7857 match d.index {
7858 0..=17 => AbstractAgeable::apply_metadata(entity, d)?,
7859 18 => {
7860 entity.insert(AbstractVillagerUnhappyCounter(d.value.into_int()?));
7861 }
7862 _ => {}
7863 }
7864 Ok(())
7865 }
7866}
7867
7868#[derive(Bundle)]
7872pub struct AbstractVillagerMetadataBundle {
7873 _marker: AbstractVillager,
7874 parent: AbstractAgeableMetadataBundle,
7875 abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter,
7876}
7877impl Default for AbstractVillagerMetadataBundle {
7878 fn default() -> Self {
7879 Self {
7880 _marker: AbstractVillager,
7881 parent: Default::default(),
7882 abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter(0),
7883 }
7884 }
7885}
7886
7887#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7889pub struct VillagerVillagerData(pub VillagerData);
7890#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7892pub struct VillagerVillagerDataFinalized(pub bool);
7893#[derive(Component)]
7920pub struct Villager;
7921impl Villager {
7922 fn apply_metadata(
7923 entity: &mut bevy_ecs::system::EntityCommands,
7924 d: EntityDataItem,
7925 ) -> Result<(), UpdateMetadataError> {
7926 match d.index {
7927 0..=18 => AbstractVillager::apply_metadata(entity, d)?,
7928 19 => {
7929 entity.insert(VillagerVillagerData(d.value.into_villager_data()?));
7930 }
7931 20 => {
7932 entity.insert(VillagerVillagerDataFinalized(d.value.into_boolean()?));
7933 }
7934 _ => {}
7935 }
7936 Ok(())
7937 }
7938}
7939
7940#[derive(Bundle)]
7944pub struct VillagerMetadataBundle {
7945 _marker: Villager,
7946 parent: AbstractVillagerMetadataBundle,
7947 villager_villager_data: VillagerVillagerData,
7948 villager_villager_data_finalized: VillagerVillagerDataFinalized,
7949}
7950impl Default for VillagerMetadataBundle {
7951 fn default() -> Self {
7952 Self {
7953 _marker: Villager,
7954 parent: Default::default(),
7955 villager_villager_data: VillagerVillagerData(VillagerData {
7956 kind: azalea_registry::builtin::VillagerKind::Plains,
7957 profession: azalea_registry::builtin::VillagerProfession::None,
7958 level: 0,
7959 }),
7960 villager_villager_data_finalized: VillagerVillagerDataFinalized(false),
7961 }
7962 }
7963}
7964
7965#[derive(Component)]
7988pub struct WanderingTrader;
7989impl WanderingTrader {
7990 fn apply_metadata(
7991 entity: &mut bevy_ecs::system::EntityCommands,
7992 d: EntityDataItem,
7993 ) -> Result<(), UpdateMetadataError> {
7994 match d.index {
7995 0..=18 => AbstractVillager::apply_metadata(entity, d)?,
7996 _ => {}
7997 }
7998 Ok(())
7999 }
8000}
8001
8002#[derive(Bundle)]
8006pub struct WanderingTraderMetadataBundle {
8007 _marker: WanderingTrader,
8008 parent: AbstractVillagerMetadataBundle,
8009}
8010impl Default for WanderingTraderMetadataBundle {
8011 fn default() -> Self {
8012 Self {
8013 _marker: WanderingTrader,
8014 parent: Default::default(),
8015 }
8016 }
8017}
8018
8019#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8021pub struct AbstractFishFromBucket(pub bool);
8022#[derive(Component)]
8048pub struct AbstractFish;
8049impl AbstractFish {
8050 fn apply_metadata(
8051 entity: &mut bevy_ecs::system::EntityCommands,
8052 d: EntityDataItem,
8053 ) -> Result<(), UpdateMetadataError> {
8054 match d.index {
8055 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
8056 16 => {
8057 entity.insert(AbstractFishFromBucket(d.value.into_boolean()?));
8058 }
8059 _ => {}
8060 }
8061 Ok(())
8062 }
8063}
8064
8065#[derive(Bundle)]
8069pub struct AbstractFishMetadataBundle {
8070 _marker: AbstractFish,
8071 parent: AbstractCreatureMetadataBundle,
8072 abstract_fish_from_bucket: AbstractFishFromBucket,
8073}
8074impl Default for AbstractFishMetadataBundle {
8075 fn default() -> Self {
8076 Self {
8077 _marker: AbstractFish,
8078 parent: Default::default(),
8079 abstract_fish_from_bucket: AbstractFishFromBucket(false),
8080 }
8081 }
8082}
8083
8084#[derive(Component)]
8106pub struct Cod;
8107impl Cod {
8108 fn apply_metadata(
8109 entity: &mut bevy_ecs::system::EntityCommands,
8110 d: EntityDataItem,
8111 ) -> Result<(), UpdateMetadataError> {
8112 match d.index {
8113 0..=16 => AbstractFish::apply_metadata(entity, d)?,
8114 _ => {}
8115 }
8116 Ok(())
8117 }
8118}
8119
8120#[derive(Bundle)]
8124pub struct CodMetadataBundle {
8125 _marker: Cod,
8126 parent: AbstractFishMetadataBundle,
8127}
8128impl Default for CodMetadataBundle {
8129 fn default() -> Self {
8130 Self {
8131 _marker: Cod,
8132 parent: Default::default(),
8133 }
8134 }
8135}
8136
8137#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8139pub struct SalmonKind(pub i32);
8140#[derive(Component)]
8164pub struct Salmon;
8165impl Salmon {
8166 fn apply_metadata(
8167 entity: &mut bevy_ecs::system::EntityCommands,
8168 d: EntityDataItem,
8169 ) -> Result<(), UpdateMetadataError> {
8170 match d.index {
8171 0..=16 => AbstractFish::apply_metadata(entity, d)?,
8172 17 => {
8173 entity.insert(SalmonKind(d.value.into_int()?));
8174 }
8175 _ => {}
8176 }
8177 Ok(())
8178 }
8179}
8180
8181#[derive(Bundle)]
8185pub struct SalmonMetadataBundle {
8186 _marker: Salmon,
8187 parent: AbstractFishMetadataBundle,
8188 salmon_kind: SalmonKind,
8189}
8190impl Default for SalmonMetadataBundle {
8191 fn default() -> Self {
8192 Self {
8193 _marker: Salmon,
8194 parent: Default::default(),
8195 salmon_kind: SalmonKind(Default::default()),
8196 }
8197 }
8198}
8199
8200#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8202pub struct TropicalFishTypeVariant(pub i32);
8203#[derive(Component)]
8228pub struct TropicalFish;
8229impl TropicalFish {
8230 fn apply_metadata(
8231 entity: &mut bevy_ecs::system::EntityCommands,
8232 d: EntityDataItem,
8233 ) -> Result<(), UpdateMetadataError> {
8234 match d.index {
8235 0..=16 => AbstractFish::apply_metadata(entity, d)?,
8236 17 => {
8237 entity.insert(TropicalFishTypeVariant(d.value.into_int()?));
8238 }
8239 _ => {}
8240 }
8241 Ok(())
8242 }
8243}
8244
8245#[derive(Bundle)]
8249pub struct TropicalFishMetadataBundle {
8250 _marker: TropicalFish,
8251 parent: AbstractFishMetadataBundle,
8252 tropical_fish_type_variant: TropicalFishTypeVariant,
8253}
8254impl Default for TropicalFishMetadataBundle {
8255 fn default() -> Self {
8256 Self {
8257 _marker: TropicalFish,
8258 parent: Default::default(),
8259 tropical_fish_type_variant: TropicalFishTypeVariant(Default::default()),
8260 }
8261 }
8262}
8263
8264#[derive(Component)]
8321pub struct AbstractMonster;
8322impl AbstractMonster {
8323 fn apply_metadata(
8324 entity: &mut bevy_ecs::system::EntityCommands,
8325 d: EntityDataItem,
8326 ) -> Result<(), UpdateMetadataError> {
8327 match d.index {
8328 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
8329 _ => {}
8330 }
8331 Ok(())
8332 }
8333}
8334
8335#[derive(Bundle)]
8339pub struct AbstractMonsterMetadataBundle {
8340 _marker: AbstractMonster,
8341 parent: AbstractCreatureMetadataBundle,
8342}
8343impl Default for AbstractMonsterMetadataBundle {
8344 fn default() -> Self {
8345 Self {
8346 _marker: AbstractMonster,
8347 parent: Default::default(),
8348 }
8349 }
8350}
8351
8352#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
8353pub struct Charged(pub bool);
8355#[derive(Component)]
8379pub struct Blaze;
8380impl Blaze {
8381 fn apply_metadata(
8382 entity: &mut bevy_ecs::system::EntityCommands,
8383 d: EntityDataItem,
8384 ) -> Result<(), UpdateMetadataError> {
8385 match d.index {
8386 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8387 16 => {
8388 let bitfield = d.value.into_byte()?;
8389 entity.insert(Charged(bitfield & 0x1 != 0));
8390 }
8391 _ => {}
8392 }
8393 Ok(())
8394 }
8395}
8396
8397#[derive(Bundle)]
8401pub struct BlazeMetadataBundle {
8402 _marker: Blaze,
8403 parent: AbstractMonsterMetadataBundle,
8404 charged: Charged,
8405}
8406impl Default for BlazeMetadataBundle {
8407 fn default() -> Self {
8408 Self {
8409 _marker: Blaze,
8410 parent: Default::default(),
8411 charged: Charged(false),
8412 }
8413 }
8414}
8415
8416#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8418pub struct BoggedSheared(pub bool);
8419#[derive(Component)]
8443pub struct Bogged;
8444impl Bogged {
8445 fn apply_metadata(
8446 entity: &mut bevy_ecs::system::EntityCommands,
8447 d: EntityDataItem,
8448 ) -> Result<(), UpdateMetadataError> {
8449 match d.index {
8450 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8451 16 => {
8452 entity.insert(BoggedSheared(d.value.into_boolean()?));
8453 }
8454 _ => {}
8455 }
8456 Ok(())
8457 }
8458}
8459
8460#[derive(Bundle)]
8464pub struct BoggedMetadataBundle {
8465 _marker: Bogged,
8466 parent: AbstractMonsterMetadataBundle,
8467 bogged_sheared: BoggedSheared,
8468}
8469impl Default for BoggedMetadataBundle {
8470 fn default() -> Self {
8471 Self {
8472 _marker: Bogged,
8473 parent: Default::default(),
8474 bogged_sheared: BoggedSheared(false),
8475 }
8476 }
8477}
8478
8479#[derive(Component)]
8501pub struct Breeze;
8502impl Breeze {
8503 fn apply_metadata(
8504 entity: &mut bevy_ecs::system::EntityCommands,
8505 d: EntityDataItem,
8506 ) -> Result<(), UpdateMetadataError> {
8507 match d.index {
8508 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8509 _ => {}
8510 }
8511 Ok(())
8512 }
8513}
8514
8515#[derive(Bundle)]
8519pub struct BreezeMetadataBundle {
8520 _marker: Breeze,
8521 parent: AbstractMonsterMetadataBundle,
8522}
8523impl Default for BreezeMetadataBundle {
8524 fn default() -> Self {
8525 Self {
8526 _marker: Breeze,
8527 parent: Default::default(),
8528 }
8529 }
8530}
8531
8532#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8534pub struct CanMove(pub bool);
8535#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8537pub struct IsActive(pub bool);
8538#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8540pub struct IsTearingDown(pub bool);
8541#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8543pub struct HomePos(pub Option<BlockPos>);
8544#[derive(Component)]
8572pub struct Creaking;
8573impl Creaking {
8574 fn apply_metadata(
8575 entity: &mut bevy_ecs::system::EntityCommands,
8576 d: EntityDataItem,
8577 ) -> Result<(), UpdateMetadataError> {
8578 match d.index {
8579 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8580 16 => {
8581 entity.insert(CanMove(d.value.into_boolean()?));
8582 }
8583 17 => {
8584 entity.insert(IsActive(d.value.into_boolean()?));
8585 }
8586 18 => {
8587 entity.insert(IsTearingDown(d.value.into_boolean()?));
8588 }
8589 19 => {
8590 entity.insert(HomePos(d.value.into_optional_block_pos()?));
8591 }
8592 _ => {}
8593 }
8594 Ok(())
8595 }
8596}
8597
8598#[derive(Bundle)]
8602pub struct CreakingMetadataBundle {
8603 _marker: Creaking,
8604 parent: AbstractMonsterMetadataBundle,
8605 can_move: CanMove,
8606 is_active: IsActive,
8607 is_tearing_down: IsTearingDown,
8608 home_pos: HomePos,
8609}
8610impl Default for CreakingMetadataBundle {
8611 fn default() -> Self {
8612 Self {
8613 _marker: Creaking,
8614 parent: Default::default(),
8615 can_move: CanMove(true),
8616 is_active: IsActive(false),
8617 is_tearing_down: IsTearingDown(false),
8618 home_pos: HomePos(None),
8619 }
8620 }
8621}
8622
8623#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8625pub struct SwellDir(pub i32);
8626#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8628pub struct IsPowered(pub bool);
8629#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8631pub struct IsIgnited(pub bool);
8632#[derive(Component)]
8658pub struct Creeper;
8659impl Creeper {
8660 fn apply_metadata(
8661 entity: &mut bevy_ecs::system::EntityCommands,
8662 d: EntityDataItem,
8663 ) -> Result<(), UpdateMetadataError> {
8664 match d.index {
8665 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8666 16 => {
8667 entity.insert(SwellDir(d.value.into_int()?));
8668 }
8669 17 => {
8670 entity.insert(IsPowered(d.value.into_boolean()?));
8671 }
8672 18 => {
8673 entity.insert(IsIgnited(d.value.into_boolean()?));
8674 }
8675 _ => {}
8676 }
8677 Ok(())
8678 }
8679}
8680
8681#[derive(Bundle)]
8685pub struct CreeperMetadataBundle {
8686 _marker: Creeper,
8687 parent: AbstractMonsterMetadataBundle,
8688 swell_dir: SwellDir,
8689 is_powered: IsPowered,
8690 is_ignited: IsIgnited,
8691}
8692impl Default for CreeperMetadataBundle {
8693 fn default() -> Self {
8694 Self {
8695 _marker: Creeper,
8696 parent: Default::default(),
8697 swell_dir: SwellDir(-1),
8698 is_powered: IsPowered(false),
8699 is_ignited: IsIgnited(false),
8700 }
8701 }
8702}
8703
8704#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8706pub struct CarryState(pub azalea_block::BlockState);
8707#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8709pub struct Creepy(pub bool);
8710#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8712pub struct StaredAt(pub bool);
8713#[derive(Component)]
8740pub struct Enderman;
8741impl Enderman {
8742 fn apply_metadata(
8743 entity: &mut bevy_ecs::system::EntityCommands,
8744 d: EntityDataItem,
8745 ) -> Result<(), UpdateMetadataError> {
8746 match d.index {
8747 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8748 16 => {
8749 entity.insert(CarryState(d.value.into_optional_block_state()?));
8750 }
8751 17 => {
8752 entity.insert(Creepy(d.value.into_boolean()?));
8753 }
8754 18 => {
8755 entity.insert(StaredAt(d.value.into_boolean()?));
8756 }
8757 _ => {}
8758 }
8759 Ok(())
8760 }
8761}
8762
8763#[derive(Bundle)]
8767pub struct EndermanMetadataBundle {
8768 _marker: Enderman,
8769 parent: AbstractMonsterMetadataBundle,
8770 carry_state: CarryState,
8771 creepy: Creepy,
8772 stared_at: StaredAt,
8773}
8774impl Default for EndermanMetadataBundle {
8775 fn default() -> Self {
8776 Self {
8777 _marker: Enderman,
8778 parent: Default::default(),
8779 carry_state: CarryState(azalea_block::BlockState::AIR),
8780 creepy: Creepy(false),
8781 stared_at: StaredAt(false),
8782 }
8783 }
8784}
8785
8786#[derive(Component)]
8808pub struct Endermite;
8809impl Endermite {
8810 fn apply_metadata(
8811 entity: &mut bevy_ecs::system::EntityCommands,
8812 d: EntityDataItem,
8813 ) -> Result<(), UpdateMetadataError> {
8814 match d.index {
8815 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8816 _ => {}
8817 }
8818 Ok(())
8819 }
8820}
8821
8822#[derive(Bundle)]
8826pub struct EndermiteMetadataBundle {
8827 _marker: Endermite,
8828 parent: AbstractMonsterMetadataBundle,
8829}
8830impl Default for EndermiteMetadataBundle {
8831 fn default() -> Self {
8832 Self {
8833 _marker: Endermite,
8834 parent: Default::default(),
8835 }
8836 }
8837}
8838
8839#[derive(Component)]
8861pub struct Giant;
8862impl Giant {
8863 fn apply_metadata(
8864 entity: &mut bevy_ecs::system::EntityCommands,
8865 d: EntityDataItem,
8866 ) -> Result<(), UpdateMetadataError> {
8867 match d.index {
8868 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8869 _ => {}
8870 }
8871 Ok(())
8872 }
8873}
8874
8875#[derive(Bundle)]
8879pub struct GiantMetadataBundle {
8880 _marker: Giant,
8881 parent: AbstractMonsterMetadataBundle,
8882}
8883impl Default for GiantMetadataBundle {
8884 fn default() -> Self {
8885 Self {
8886 _marker: Giant,
8887 parent: Default::default(),
8888 }
8889 }
8890}
8891
8892#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8894pub struct Moving(pub bool);
8895#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8897pub struct AttackTarget(pub i32);
8898#[derive(Component)]
8924pub struct Guardian;
8925impl Guardian {
8926 fn apply_metadata(
8927 entity: &mut bevy_ecs::system::EntityCommands,
8928 d: EntityDataItem,
8929 ) -> Result<(), UpdateMetadataError> {
8930 match d.index {
8931 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8932 16 => {
8933 entity.insert(Moving(d.value.into_boolean()?));
8934 }
8935 17 => {
8936 entity.insert(AttackTarget(d.value.into_int()?));
8937 }
8938 _ => {}
8939 }
8940 Ok(())
8941 }
8942}
8943
8944#[derive(Bundle)]
8948pub struct GuardianMetadataBundle {
8949 _marker: Guardian,
8950 parent: AbstractMonsterMetadataBundle,
8951 moving: Moving,
8952 attack_target: AttackTarget,
8953}
8954impl Default for GuardianMetadataBundle {
8955 fn default() -> Self {
8956 Self {
8957 _marker: Guardian,
8958 parent: Default::default(),
8959 moving: Moving(false),
8960 attack_target: AttackTarget(0),
8961 }
8962 }
8963}
8964
8965#[derive(Component)]
8988pub struct ElderGuardian;
8989impl ElderGuardian {
8990 fn apply_metadata(
8991 entity: &mut bevy_ecs::system::EntityCommands,
8992 d: EntityDataItem,
8993 ) -> Result<(), UpdateMetadataError> {
8994 match d.index {
8995 0..=17 => Guardian::apply_metadata(entity, d)?,
8996 _ => {}
8997 }
8998 Ok(())
8999 }
9000}
9001
9002#[derive(Bundle)]
9006pub struct ElderGuardianMetadataBundle {
9007 _marker: ElderGuardian,
9008 parent: GuardianMetadataBundle,
9009}
9010impl Default for ElderGuardianMetadataBundle {
9011 fn default() -> Self {
9012 Self {
9013 _marker: ElderGuardian,
9014 parent: Default::default(),
9015 }
9016 }
9017}
9018
9019#[derive(Component)]
9041pub struct Parched;
9042impl Parched {
9043 fn apply_metadata(
9044 entity: &mut bevy_ecs::system::EntityCommands,
9045 d: EntityDataItem,
9046 ) -> Result<(), UpdateMetadataError> {
9047 match d.index {
9048 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9049 _ => {}
9050 }
9051 Ok(())
9052 }
9053}
9054
9055#[derive(Bundle)]
9059pub struct ParchedMetadataBundle {
9060 _marker: Parched,
9061 parent: AbstractMonsterMetadataBundle,
9062}
9063impl Default for ParchedMetadataBundle {
9064 fn default() -> Self {
9065 Self {
9066 _marker: Parched,
9067 parent: Default::default(),
9068 }
9069 }
9070}
9071
9072#[derive(Component)]
9094pub struct Silverfish;
9095impl Silverfish {
9096 fn apply_metadata(
9097 entity: &mut bevy_ecs::system::EntityCommands,
9098 d: EntityDataItem,
9099 ) -> Result<(), UpdateMetadataError> {
9100 match d.index {
9101 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9102 _ => {}
9103 }
9104 Ok(())
9105 }
9106}
9107
9108#[derive(Bundle)]
9112pub struct SilverfishMetadataBundle {
9113 _marker: Silverfish,
9114 parent: AbstractMonsterMetadataBundle,
9115}
9116impl Default for SilverfishMetadataBundle {
9117 fn default() -> Self {
9118 Self {
9119 _marker: Silverfish,
9120 parent: Default::default(),
9121 }
9122 }
9123}
9124
9125#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9127pub struct StrayConversion(pub bool);
9128#[derive(Component)]
9153pub struct Skeleton;
9154impl Skeleton {
9155 fn apply_metadata(
9156 entity: &mut bevy_ecs::system::EntityCommands,
9157 d: EntityDataItem,
9158 ) -> Result<(), UpdateMetadataError> {
9159 match d.index {
9160 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9161 16 => {
9162 entity.insert(StrayConversion(d.value.into_boolean()?));
9163 }
9164 _ => {}
9165 }
9166 Ok(())
9167 }
9168}
9169
9170#[derive(Bundle)]
9174pub struct SkeletonMetadataBundle {
9175 _marker: Skeleton,
9176 parent: AbstractMonsterMetadataBundle,
9177 stray_conversion: StrayConversion,
9178}
9179impl Default for SkeletonMetadataBundle {
9180 fn default() -> Self {
9181 Self {
9182 _marker: Skeleton,
9183 parent: Default::default(),
9184 stray_conversion: StrayConversion(false),
9185 }
9186 }
9187}
9188
9189#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
9190pub struct Climbing(pub bool);
9192#[derive(Component)]
9216pub struct Spider;
9217impl Spider {
9218 fn apply_metadata(
9219 entity: &mut bevy_ecs::system::EntityCommands,
9220 d: EntityDataItem,
9221 ) -> Result<(), UpdateMetadataError> {
9222 match d.index {
9223 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9224 16 => {
9225 let bitfield = d.value.into_byte()?;
9226 entity.insert(Climbing(bitfield & 0x1 != 0));
9227 }
9228 _ => {}
9229 }
9230 Ok(())
9231 }
9232}
9233
9234#[derive(Bundle)]
9238pub struct SpiderMetadataBundle {
9239 _marker: Spider,
9240 parent: AbstractMonsterMetadataBundle,
9241 climbing: Climbing,
9242}
9243impl Default for SpiderMetadataBundle {
9244 fn default() -> Self {
9245 Self {
9246 _marker: Spider,
9247 parent: Default::default(),
9248 climbing: Climbing(false),
9249 }
9250 }
9251}
9252
9253#[derive(Component)]
9276pub struct CaveSpider;
9277impl CaveSpider {
9278 fn apply_metadata(
9279 entity: &mut bevy_ecs::system::EntityCommands,
9280 d: EntityDataItem,
9281 ) -> Result<(), UpdateMetadataError> {
9282 match d.index {
9283 0..=16 => Spider::apply_metadata(entity, d)?,
9284 _ => {}
9285 }
9286 Ok(())
9287 }
9288}
9289
9290#[derive(Bundle)]
9294pub struct CaveSpiderMetadataBundle {
9295 _marker: CaveSpider,
9296 parent: SpiderMetadataBundle,
9297}
9298impl Default for CaveSpiderMetadataBundle {
9299 fn default() -> Self {
9300 Self {
9301 _marker: CaveSpider,
9302 parent: Default::default(),
9303 }
9304 }
9305}
9306
9307#[derive(Component)]
9329pub struct Stray;
9330impl Stray {
9331 fn apply_metadata(
9332 entity: &mut bevy_ecs::system::EntityCommands,
9333 d: EntityDataItem,
9334 ) -> Result<(), UpdateMetadataError> {
9335 match d.index {
9336 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9337 _ => {}
9338 }
9339 Ok(())
9340 }
9341}
9342
9343#[derive(Bundle)]
9347pub struct StrayMetadataBundle {
9348 _marker: Stray,
9349 parent: AbstractMonsterMetadataBundle,
9350}
9351impl Default for StrayMetadataBundle {
9352 fn default() -> Self {
9353 Self {
9354 _marker: Stray,
9355 parent: Default::default(),
9356 }
9357 }
9358}
9359
9360#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9362pub struct VexFlags(pub u8);
9363#[derive(Component)]
9387pub struct Vex;
9388impl Vex {
9389 fn apply_metadata(
9390 entity: &mut bevy_ecs::system::EntityCommands,
9391 d: EntityDataItem,
9392 ) -> Result<(), UpdateMetadataError> {
9393 match d.index {
9394 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9395 16 => {
9396 entity.insert(VexFlags(d.value.into_byte()?));
9397 }
9398 _ => {}
9399 }
9400 Ok(())
9401 }
9402}
9403
9404#[derive(Bundle)]
9408pub struct VexMetadataBundle {
9409 _marker: Vex,
9410 parent: AbstractMonsterMetadataBundle,
9411 vex_flags: VexFlags,
9412}
9413impl Default for VexMetadataBundle {
9414 fn default() -> Self {
9415 Self {
9416 _marker: Vex,
9417 parent: Default::default(),
9418 vex_flags: VexFlags(0),
9419 }
9420 }
9421}
9422
9423#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9425pub struct ClientAngerLevel(pub i32);
9426#[derive(Component)]
9450pub struct Warden;
9451impl Warden {
9452 fn apply_metadata(
9453 entity: &mut bevy_ecs::system::EntityCommands,
9454 d: EntityDataItem,
9455 ) -> Result<(), UpdateMetadataError> {
9456 match d.index {
9457 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9458 16 => {
9459 entity.insert(ClientAngerLevel(d.value.into_int()?));
9460 }
9461 _ => {}
9462 }
9463 Ok(())
9464 }
9465}
9466
9467#[derive(Bundle)]
9471pub struct WardenMetadataBundle {
9472 _marker: Warden,
9473 parent: AbstractMonsterMetadataBundle,
9474 client_anger_level: ClientAngerLevel,
9475}
9476impl Default for WardenMetadataBundle {
9477 fn default() -> Self {
9478 Self {
9479 _marker: Warden,
9480 parent: Default::default(),
9481 client_anger_level: ClientAngerLevel(0),
9482 }
9483 }
9484}
9485
9486#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9488pub struct TargetA(pub i32);
9489#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9491pub struct TargetB(pub i32);
9492#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9494pub struct TargetC(pub i32);
9495#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9497pub struct Inv(pub i32);
9498#[derive(Component)]
9525pub struct Wither;
9526impl Wither {
9527 fn apply_metadata(
9528 entity: &mut bevy_ecs::system::EntityCommands,
9529 d: EntityDataItem,
9530 ) -> Result<(), UpdateMetadataError> {
9531 match d.index {
9532 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9533 16 => {
9534 entity.insert(TargetA(d.value.into_int()?));
9535 }
9536 17 => {
9537 entity.insert(TargetB(d.value.into_int()?));
9538 }
9539 18 => {
9540 entity.insert(TargetC(d.value.into_int()?));
9541 }
9542 19 => {
9543 entity.insert(Inv(d.value.into_int()?));
9544 }
9545 _ => {}
9546 }
9547 Ok(())
9548 }
9549}
9550
9551#[derive(Bundle)]
9555pub struct WitherMetadataBundle {
9556 _marker: Wither,
9557 parent: AbstractMonsterMetadataBundle,
9558 target_a: TargetA,
9559 target_b: TargetB,
9560 target_c: TargetC,
9561 inv: Inv,
9562}
9563impl Default for WitherMetadataBundle {
9564 fn default() -> Self {
9565 Self {
9566 _marker: Wither,
9567 parent: Default::default(),
9568 target_a: TargetA(0),
9569 target_b: TargetB(0),
9570 target_c: TargetC(0),
9571 inv: Inv(0),
9572 }
9573 }
9574}
9575
9576#[derive(Component)]
9598pub struct WitherSkeleton;
9599impl WitherSkeleton {
9600 fn apply_metadata(
9601 entity: &mut bevy_ecs::system::EntityCommands,
9602 d: EntityDataItem,
9603 ) -> Result<(), UpdateMetadataError> {
9604 match d.index {
9605 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9606 _ => {}
9607 }
9608 Ok(())
9609 }
9610}
9611
9612#[derive(Bundle)]
9616pub struct WitherSkeletonMetadataBundle {
9617 _marker: WitherSkeleton,
9618 parent: AbstractMonsterMetadataBundle,
9619}
9620impl Default for WitherSkeletonMetadataBundle {
9621 fn default() -> Self {
9622 Self {
9623 _marker: WitherSkeleton,
9624 parent: Default::default(),
9625 }
9626 }
9627}
9628
9629#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9631pub struct ZoglinBaby(pub bool);
9632#[derive(Component)]
9656pub struct Zoglin;
9657impl Zoglin {
9658 fn apply_metadata(
9659 entity: &mut bevy_ecs::system::EntityCommands,
9660 d: EntityDataItem,
9661 ) -> Result<(), UpdateMetadataError> {
9662 match d.index {
9663 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9664 16 => {
9665 entity.insert(ZoglinBaby(d.value.into_boolean()?));
9666 }
9667 _ => {}
9668 }
9669 Ok(())
9670 }
9671}
9672
9673#[derive(Bundle)]
9677pub struct ZoglinMetadataBundle {
9678 _marker: Zoglin,
9679 parent: AbstractMonsterMetadataBundle,
9680 zoglin_baby: ZoglinBaby,
9681}
9682impl Default for ZoglinMetadataBundle {
9683 fn default() -> Self {
9684 Self {
9685 _marker: Zoglin,
9686 parent: Default::default(),
9687 zoglin_baby: ZoglinBaby(false),
9688 }
9689 }
9690}
9691
9692#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9694pub struct ZombieBaby(pub bool);
9695#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9697pub struct SpecialType(pub i32);
9698#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9700pub struct DrownedConversion(pub bool);
9701#[derive(Component)]
9730pub struct Zombie;
9731impl Zombie {
9732 fn apply_metadata(
9733 entity: &mut bevy_ecs::system::EntityCommands,
9734 d: EntityDataItem,
9735 ) -> Result<(), UpdateMetadataError> {
9736 match d.index {
9737 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9738 16 => {
9739 entity.insert(ZombieBaby(d.value.into_boolean()?));
9740 }
9741 17 => {
9742 entity.insert(SpecialType(d.value.into_int()?));
9743 }
9744 18 => {
9745 entity.insert(DrownedConversion(d.value.into_boolean()?));
9746 }
9747 _ => {}
9748 }
9749 Ok(())
9750 }
9751}
9752
9753#[derive(Bundle)]
9757pub struct ZombieMetadataBundle {
9758 _marker: Zombie,
9759 parent: AbstractMonsterMetadataBundle,
9760 zombie_baby: ZombieBaby,
9761 special_type: SpecialType,
9762 drowned_conversion: DrownedConversion,
9763}
9764impl Default for ZombieMetadataBundle {
9765 fn default() -> Self {
9766 Self {
9767 _marker: Zombie,
9768 parent: Default::default(),
9769 zombie_baby: ZombieBaby(false),
9770 special_type: SpecialType(0),
9771 drowned_conversion: DrownedConversion(false),
9772 }
9773 }
9774}
9775
9776#[derive(Component)]
9799pub struct Drowned;
9800impl Drowned {
9801 fn apply_metadata(
9802 entity: &mut bevy_ecs::system::EntityCommands,
9803 d: EntityDataItem,
9804 ) -> Result<(), UpdateMetadataError> {
9805 match d.index {
9806 0..=18 => Zombie::apply_metadata(entity, d)?,
9807 _ => {}
9808 }
9809 Ok(())
9810 }
9811}
9812
9813#[derive(Bundle)]
9817pub struct DrownedMetadataBundle {
9818 _marker: Drowned,
9819 parent: ZombieMetadataBundle,
9820}
9821impl Default for DrownedMetadataBundle {
9822 fn default() -> Self {
9823 Self {
9824 _marker: Drowned,
9825 parent: Default::default(),
9826 }
9827 }
9828}
9829
9830#[derive(Component)]
9853pub struct Husk;
9854impl Husk {
9855 fn apply_metadata(
9856 entity: &mut bevy_ecs::system::EntityCommands,
9857 d: EntityDataItem,
9858 ) -> Result<(), UpdateMetadataError> {
9859 match d.index {
9860 0..=18 => Zombie::apply_metadata(entity, d)?,
9861 _ => {}
9862 }
9863 Ok(())
9864 }
9865}
9866
9867#[derive(Bundle)]
9871pub struct HuskMetadataBundle {
9872 _marker: Husk,
9873 parent: ZombieMetadataBundle,
9874}
9875impl Default for HuskMetadataBundle {
9876 fn default() -> Self {
9877 Self {
9878 _marker: Husk,
9879 parent: Default::default(),
9880 }
9881 }
9882}
9883
9884#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9886pub struct Converting(pub bool);
9887#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9889pub struct ZombieVillagerVillagerData(pub VillagerData);
9890#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9892pub struct ZombieVillagerVillagerDataFinalized(pub bool);
9893#[derive(Component)]
9921pub struct ZombieVillager;
9922impl ZombieVillager {
9923 fn apply_metadata(
9924 entity: &mut bevy_ecs::system::EntityCommands,
9925 d: EntityDataItem,
9926 ) -> Result<(), UpdateMetadataError> {
9927 match d.index {
9928 0..=18 => Zombie::apply_metadata(entity, d)?,
9929 19 => {
9930 entity.insert(Converting(d.value.into_boolean()?));
9931 }
9932 20 => {
9933 entity.insert(ZombieVillagerVillagerData(d.value.into_villager_data()?));
9934 }
9935 21 => {
9936 entity.insert(ZombieVillagerVillagerDataFinalized(d.value.into_boolean()?));
9937 }
9938 _ => {}
9939 }
9940 Ok(())
9941 }
9942}
9943
9944#[derive(Bundle)]
9948pub struct ZombieVillagerMetadataBundle {
9949 _marker: ZombieVillager,
9950 parent: ZombieMetadataBundle,
9951 converting: Converting,
9952 zombie_villager_villager_data: ZombieVillagerVillagerData,
9953 zombie_villager_villager_data_finalized: ZombieVillagerVillagerDataFinalized,
9954}
9955impl Default for ZombieVillagerMetadataBundle {
9956 fn default() -> Self {
9957 Self {
9958 _marker: ZombieVillager,
9959 parent: Default::default(),
9960 converting: Converting(false),
9961 zombie_villager_villager_data: ZombieVillagerVillagerData(VillagerData {
9962 kind: azalea_registry::builtin::VillagerKind::Plains,
9963 profession: azalea_registry::builtin::VillagerProfession::None,
9964 level: 0,
9965 }),
9966 zombie_villager_villager_data_finalized: ZombieVillagerVillagerDataFinalized(false),
9967 }
9968 }
9969}
9970
9971#[derive(Component)]
9994pub struct ZombifiedPiglin;
9995impl ZombifiedPiglin {
9996 fn apply_metadata(
9997 entity: &mut bevy_ecs::system::EntityCommands,
9998 d: EntityDataItem,
9999 ) -> Result<(), UpdateMetadataError> {
10000 match d.index {
10001 0..=18 => Zombie::apply_metadata(entity, d)?,
10002 _ => {}
10003 }
10004 Ok(())
10005 }
10006}
10007
10008#[derive(Bundle)]
10012pub struct ZombifiedPiglinMetadataBundle {
10013 _marker: ZombifiedPiglin,
10014 parent: ZombieMetadataBundle,
10015}
10016impl Default for ZombifiedPiglinMetadataBundle {
10017 fn default() -> Self {
10018 Self {
10019 _marker: ZombifiedPiglin,
10020 parent: Default::default(),
10021 }
10022 }
10023}
10024
10025#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10027pub struct AbstractPiglinImmuneToZombification(pub bool);
10028#[derive(Component)]
10054pub struct AbstractPiglin;
10055impl AbstractPiglin {
10056 fn apply_metadata(
10057 entity: &mut bevy_ecs::system::EntityCommands,
10058 d: EntityDataItem,
10059 ) -> Result<(), UpdateMetadataError> {
10060 match d.index {
10061 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
10062 16 => {
10063 entity.insert(AbstractPiglinImmuneToZombification(d.value.into_boolean()?));
10064 }
10065 _ => {}
10066 }
10067 Ok(())
10068 }
10069}
10070
10071#[derive(Bundle)]
10075pub struct AbstractPiglinMetadataBundle {
10076 _marker: AbstractPiglin,
10077 parent: AbstractMonsterMetadataBundle,
10078 abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification,
10079}
10080impl Default for AbstractPiglinMetadataBundle {
10081 fn default() -> Self {
10082 Self {
10083 _marker: AbstractPiglin,
10084 parent: Default::default(),
10085 abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification(false),
10086 }
10087 }
10088}
10089
10090#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10092pub struct PiglinBaby(pub bool);
10093#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10095pub struct PiglinIsChargingCrossbow(pub bool);
10096#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10098pub struct IsDancing(pub bool);
10099#[derive(Component)]
10126pub struct Piglin;
10127impl Piglin {
10128 fn apply_metadata(
10129 entity: &mut bevy_ecs::system::EntityCommands,
10130 d: EntityDataItem,
10131 ) -> Result<(), UpdateMetadataError> {
10132 match d.index {
10133 0..=16 => AbstractPiglin::apply_metadata(entity, d)?,
10134 17 => {
10135 entity.insert(PiglinBaby(d.value.into_boolean()?));
10136 }
10137 18 => {
10138 entity.insert(PiglinIsChargingCrossbow(d.value.into_boolean()?));
10139 }
10140 19 => {
10141 entity.insert(IsDancing(d.value.into_boolean()?));
10142 }
10143 _ => {}
10144 }
10145 Ok(())
10146 }
10147}
10148
10149#[derive(Bundle)]
10153pub struct PiglinMetadataBundle {
10154 _marker: Piglin,
10155 parent: AbstractPiglinMetadataBundle,
10156 piglin_baby: PiglinBaby,
10157 piglin_is_charging_crossbow: PiglinIsChargingCrossbow,
10158 is_dancing: IsDancing,
10159}
10160impl Default for PiglinMetadataBundle {
10161 fn default() -> Self {
10162 Self {
10163 _marker: Piglin,
10164 parent: Default::default(),
10165 piglin_baby: PiglinBaby(false),
10166 piglin_is_charging_crossbow: PiglinIsChargingCrossbow(false),
10167 is_dancing: IsDancing(false),
10168 }
10169 }
10170}
10171
10172#[derive(Component)]
10195pub struct PiglinBrute;
10196impl PiglinBrute {
10197 fn apply_metadata(
10198 entity: &mut bevy_ecs::system::EntityCommands,
10199 d: EntityDataItem,
10200 ) -> Result<(), UpdateMetadataError> {
10201 match d.index {
10202 0..=16 => AbstractPiglin::apply_metadata(entity, d)?,
10203 _ => {}
10204 }
10205 Ok(())
10206 }
10207}
10208
10209#[derive(Bundle)]
10213pub struct PiglinBruteMetadataBundle {
10214 _marker: PiglinBrute,
10215 parent: AbstractPiglinMetadataBundle,
10216}
10217impl Default for PiglinBruteMetadataBundle {
10218 fn default() -> Self {
10219 Self {
10220 _marker: PiglinBrute,
10221 parent: Default::default(),
10222 }
10223 }
10224}
10225
10226#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10228pub struct IsCelebrating(pub bool);
10229#[derive(Component)]
10260pub struct AbstractRaider;
10261impl AbstractRaider {
10262 fn apply_metadata(
10263 entity: &mut bevy_ecs::system::EntityCommands,
10264 d: EntityDataItem,
10265 ) -> Result<(), UpdateMetadataError> {
10266 match d.index {
10267 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
10268 16 => {
10269 entity.insert(IsCelebrating(d.value.into_boolean()?));
10270 }
10271 _ => {}
10272 }
10273 Ok(())
10274 }
10275}
10276
10277#[derive(Bundle)]
10281pub struct AbstractRaiderMetadataBundle {
10282 _marker: AbstractRaider,
10283 parent: AbstractMonsterMetadataBundle,
10284 is_celebrating: IsCelebrating,
10285}
10286impl Default for AbstractRaiderMetadataBundle {
10287 fn default() -> Self {
10288 Self {
10289 _marker: AbstractRaider,
10290 parent: Default::default(),
10291 is_celebrating: IsCelebrating(false),
10292 }
10293 }
10294}
10295
10296#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10298pub struct PillagerIsChargingCrossbow(pub bool);
10299#[derive(Component)]
10325pub struct Pillager;
10326impl Pillager {
10327 fn apply_metadata(
10328 entity: &mut bevy_ecs::system::EntityCommands,
10329 d: EntityDataItem,
10330 ) -> Result<(), UpdateMetadataError> {
10331 match d.index {
10332 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
10333 17 => {
10334 entity.insert(PillagerIsChargingCrossbow(d.value.into_boolean()?));
10335 }
10336 _ => {}
10337 }
10338 Ok(())
10339 }
10340}
10341
10342#[derive(Bundle)]
10346pub struct PillagerMetadataBundle {
10347 _marker: Pillager,
10348 parent: AbstractRaiderMetadataBundle,
10349 pillager_is_charging_crossbow: PillagerIsChargingCrossbow,
10350}
10351impl Default for PillagerMetadataBundle {
10352 fn default() -> Self {
10353 Self {
10354 _marker: Pillager,
10355 parent: Default::default(),
10356 pillager_is_charging_crossbow: PillagerIsChargingCrossbow(false),
10357 }
10358 }
10359}
10360
10361#[derive(Component)]
10384pub struct Ravager;
10385impl Ravager {
10386 fn apply_metadata(
10387 entity: &mut bevy_ecs::system::EntityCommands,
10388 d: EntityDataItem,
10389 ) -> Result<(), UpdateMetadataError> {
10390 match d.index {
10391 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
10392 _ => {}
10393 }
10394 Ok(())
10395 }
10396}
10397
10398#[derive(Bundle)]
10402pub struct RavagerMetadataBundle {
10403 _marker: Ravager,
10404 parent: AbstractRaiderMetadataBundle,
10405}
10406impl Default for RavagerMetadataBundle {
10407 fn default() -> Self {
10408 Self {
10409 _marker: Ravager,
10410 parent: Default::default(),
10411 }
10412 }
10413}
10414
10415#[derive(Component)]
10438pub struct Vindicator;
10439impl Vindicator {
10440 fn apply_metadata(
10441 entity: &mut bevy_ecs::system::EntityCommands,
10442 d: EntityDataItem,
10443 ) -> Result<(), UpdateMetadataError> {
10444 match d.index {
10445 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
10446 _ => {}
10447 }
10448 Ok(())
10449 }
10450}
10451
10452#[derive(Bundle)]
10456pub struct VindicatorMetadataBundle {
10457 _marker: Vindicator,
10458 parent: AbstractRaiderMetadataBundle,
10459}
10460impl Default for VindicatorMetadataBundle {
10461 fn default() -> Self {
10462 Self {
10463 _marker: Vindicator,
10464 parent: Default::default(),
10465 }
10466 }
10467}
10468
10469#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10471pub struct WitchUsingItem(pub bool);
10472#[derive(Component)]
10497pub struct Witch;
10498impl Witch {
10499 fn apply_metadata(
10500 entity: &mut bevy_ecs::system::EntityCommands,
10501 d: EntityDataItem,
10502 ) -> Result<(), UpdateMetadataError> {
10503 match d.index {
10504 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
10505 17 => {
10506 entity.insert(WitchUsingItem(d.value.into_boolean()?));
10507 }
10508 _ => {}
10509 }
10510 Ok(())
10511 }
10512}
10513
10514#[derive(Bundle)]
10518pub struct WitchMetadataBundle {
10519 _marker: Witch,
10520 parent: AbstractRaiderMetadataBundle,
10521 witch_using_item: WitchUsingItem,
10522}
10523impl Default for WitchMetadataBundle {
10524 fn default() -> Self {
10525 Self {
10526 _marker: Witch,
10527 parent: Default::default(),
10528 witch_using_item: WitchUsingItem(false),
10529 }
10530 }
10531}
10532
10533#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10535pub struct SpellCasting(pub u8);
10536#[derive(Component)]
10563pub struct AbstractSpellcasterIllager;
10564impl AbstractSpellcasterIllager {
10565 fn apply_metadata(
10566 entity: &mut bevy_ecs::system::EntityCommands,
10567 d: EntityDataItem,
10568 ) -> Result<(), UpdateMetadataError> {
10569 match d.index {
10570 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
10571 17 => {
10572 entity.insert(SpellCasting(d.value.into_byte()?));
10573 }
10574 _ => {}
10575 }
10576 Ok(())
10577 }
10578}
10579
10580#[derive(Bundle)]
10584pub struct AbstractSpellcasterIllagerMetadataBundle {
10585 _marker: AbstractSpellcasterIllager,
10586 parent: AbstractRaiderMetadataBundle,
10587 spell_casting: SpellCasting,
10588}
10589impl Default for AbstractSpellcasterIllagerMetadataBundle {
10590 fn default() -> Self {
10591 Self {
10592 _marker: AbstractSpellcasterIllager,
10593 parent: Default::default(),
10594 spell_casting: SpellCasting(0),
10595 }
10596 }
10597}
10598
10599#[derive(Component)]
10623pub struct Evoker;
10624impl Evoker {
10625 fn apply_metadata(
10626 entity: &mut bevy_ecs::system::EntityCommands,
10627 d: EntityDataItem,
10628 ) -> Result<(), UpdateMetadataError> {
10629 match d.index {
10630 0..=17 => AbstractSpellcasterIllager::apply_metadata(entity, d)?,
10631 _ => {}
10632 }
10633 Ok(())
10634 }
10635}
10636
10637#[derive(Bundle)]
10641pub struct EvokerMetadataBundle {
10642 _marker: Evoker,
10643 parent: AbstractSpellcasterIllagerMetadataBundle,
10644}
10645impl Default for EvokerMetadataBundle {
10646 fn default() -> Self {
10647 Self {
10648 _marker: Evoker,
10649 parent: Default::default(),
10650 }
10651 }
10652}
10653
10654#[derive(Component)]
10678pub struct Illusioner;
10679impl Illusioner {
10680 fn apply_metadata(
10681 entity: &mut bevy_ecs::system::EntityCommands,
10682 d: EntityDataItem,
10683 ) -> Result<(), UpdateMetadataError> {
10684 match d.index {
10685 0..=17 => AbstractSpellcasterIllager::apply_metadata(entity, d)?,
10686 _ => {}
10687 }
10688 Ok(())
10689 }
10690}
10691
10692#[derive(Bundle)]
10696pub struct IllusionerMetadataBundle {
10697 _marker: Illusioner,
10698 parent: AbstractSpellcasterIllagerMetadataBundle,
10699}
10700impl Default for IllusionerMetadataBundle {
10701 fn default() -> Self {
10702 Self {
10703 _marker: Illusioner,
10704 parent: Default::default(),
10705 }
10706 }
10707}
10708
10709#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10711pub struct AbstractThrownItemProjectileItemStack(pub ItemStack);
10712#[derive(Component)]
10738pub struct AbstractThrownItemProjectile;
10739impl AbstractThrownItemProjectile {
10740 fn apply_metadata(
10741 entity: &mut bevy_ecs::system::EntityCommands,
10742 d: EntityDataItem,
10743 ) -> Result<(), UpdateMetadataError> {
10744 match d.index {
10745 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
10746 8 => {
10747 entity.insert(AbstractThrownItemProjectileItemStack(
10748 d.value.into_item_stack()?,
10749 ));
10750 }
10751 _ => {}
10752 }
10753 Ok(())
10754 }
10755}
10756
10757#[derive(Bundle)]
10761pub struct AbstractThrownItemProjectileMetadataBundle {
10762 _marker: AbstractThrownItemProjectile,
10763 parent: AbstractEntityMetadataBundle,
10764 abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack,
10765}
10766impl Default for AbstractThrownItemProjectileMetadataBundle {
10767 fn default() -> Self {
10768 Self {
10769 _marker: AbstractThrownItemProjectile,
10770 parent: Default::default(),
10771 abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack(
10772 Default::default(),
10773 ),
10774 }
10775 }
10776}
10777
10778#[derive(Component)]
10797pub struct Egg;
10798impl Egg {
10799 fn apply_metadata(
10800 entity: &mut bevy_ecs::system::EntityCommands,
10801 d: EntityDataItem,
10802 ) -> Result<(), UpdateMetadataError> {
10803 match d.index {
10804 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
10805 _ => {}
10806 }
10807 Ok(())
10808 }
10809}
10810
10811#[derive(Bundle)]
10815pub struct EggMetadataBundle {
10816 _marker: Egg,
10817 parent: AbstractThrownItemProjectileMetadataBundle,
10818}
10819impl Default for EggMetadataBundle {
10820 fn default() -> Self {
10821 Self {
10822 _marker: Egg,
10823 parent: Default::default(),
10824 }
10825 }
10826}
10827
10828#[derive(Component)]
10847pub struct EnderPearl;
10848impl EnderPearl {
10849 fn apply_metadata(
10850 entity: &mut bevy_ecs::system::EntityCommands,
10851 d: EntityDataItem,
10852 ) -> Result<(), UpdateMetadataError> {
10853 match d.index {
10854 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
10855 _ => {}
10856 }
10857 Ok(())
10858 }
10859}
10860
10861#[derive(Bundle)]
10865pub struct EnderPearlMetadataBundle {
10866 _marker: EnderPearl,
10867 parent: AbstractThrownItemProjectileMetadataBundle,
10868}
10869impl Default for EnderPearlMetadataBundle {
10870 fn default() -> Self {
10871 Self {
10872 _marker: EnderPearl,
10873 parent: Default::default(),
10874 }
10875 }
10876}
10877
10878#[derive(Component)]
10897pub struct ExperienceBottle;
10898impl ExperienceBottle {
10899 fn apply_metadata(
10900 entity: &mut bevy_ecs::system::EntityCommands,
10901 d: EntityDataItem,
10902 ) -> Result<(), UpdateMetadataError> {
10903 match d.index {
10904 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
10905 _ => {}
10906 }
10907 Ok(())
10908 }
10909}
10910
10911#[derive(Bundle)]
10915pub struct ExperienceBottleMetadataBundle {
10916 _marker: ExperienceBottle,
10917 parent: AbstractThrownItemProjectileMetadataBundle,
10918}
10919impl Default for ExperienceBottleMetadataBundle {
10920 fn default() -> Self {
10921 Self {
10922 _marker: ExperienceBottle,
10923 parent: Default::default(),
10924 }
10925 }
10926}
10927
10928#[derive(Component)]
10947pub struct LingeringPotion;
10948impl LingeringPotion {
10949 fn apply_metadata(
10950 entity: &mut bevy_ecs::system::EntityCommands,
10951 d: EntityDataItem,
10952 ) -> Result<(), UpdateMetadataError> {
10953 match d.index {
10954 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
10955 _ => {}
10956 }
10957 Ok(())
10958 }
10959}
10960
10961#[derive(Bundle)]
10965pub struct LingeringPotionMetadataBundle {
10966 _marker: LingeringPotion,
10967 parent: AbstractThrownItemProjectileMetadataBundle,
10968}
10969impl Default for LingeringPotionMetadataBundle {
10970 fn default() -> Self {
10971 Self {
10972 _marker: LingeringPotion,
10973 parent: Default::default(),
10974 }
10975 }
10976}
10977
10978#[derive(Component)]
10997pub struct Snowball;
10998impl Snowball {
10999 fn apply_metadata(
11000 entity: &mut bevy_ecs::system::EntityCommands,
11001 d: EntityDataItem,
11002 ) -> Result<(), UpdateMetadataError> {
11003 match d.index {
11004 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
11005 _ => {}
11006 }
11007 Ok(())
11008 }
11009}
11010
11011#[derive(Bundle)]
11015pub struct SnowballMetadataBundle {
11016 _marker: Snowball,
11017 parent: AbstractThrownItemProjectileMetadataBundle,
11018}
11019impl Default for SnowballMetadataBundle {
11020 fn default() -> Self {
11021 Self {
11022 _marker: Snowball,
11023 parent: Default::default(),
11024 }
11025 }
11026}
11027
11028#[derive(Component)]
11047pub struct SplashPotion;
11048impl SplashPotion {
11049 fn apply_metadata(
11050 entity: &mut bevy_ecs::system::EntityCommands,
11051 d: EntityDataItem,
11052 ) -> Result<(), UpdateMetadataError> {
11053 match d.index {
11054 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
11055 _ => {}
11056 }
11057 Ok(())
11058 }
11059}
11060
11061#[derive(Bundle)]
11065pub struct SplashPotionMetadataBundle {
11066 _marker: SplashPotion,
11067 parent: AbstractThrownItemProjectileMetadataBundle,
11068}
11069impl Default for SplashPotionMetadataBundle {
11070 fn default() -> Self {
11071 Self {
11072 _marker: SplashPotion,
11073 parent: Default::default(),
11074 }
11075 }
11076}
11077
11078#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11080pub struct Hurt(pub i32);
11081#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11083pub struct Hurtdir(pub i32);
11084#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11086pub struct Damage(pub f32);
11087#[derive(Component)]
11138pub struct AbstractVehicle;
11139impl AbstractVehicle {
11140 fn apply_metadata(
11141 entity: &mut bevy_ecs::system::EntityCommands,
11142 d: EntityDataItem,
11143 ) -> Result<(), UpdateMetadataError> {
11144 match d.index {
11145 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
11146 8 => {
11147 entity.insert(Hurt(d.value.into_int()?));
11148 }
11149 9 => {
11150 entity.insert(Hurtdir(d.value.into_int()?));
11151 }
11152 10 => {
11153 entity.insert(Damage(d.value.into_float()?));
11154 }
11155 _ => {}
11156 }
11157 Ok(())
11158 }
11159}
11160
11161#[derive(Bundle)]
11165pub struct AbstractVehicleMetadataBundle {
11166 _marker: AbstractVehicle,
11167 parent: AbstractEntityMetadataBundle,
11168 hurt: Hurt,
11169 hurtdir: Hurtdir,
11170 damage: Damage,
11171}
11172impl Default for AbstractVehicleMetadataBundle {
11173 fn default() -> Self {
11174 Self {
11175 _marker: AbstractVehicle,
11176 parent: Default::default(),
11177 hurt: Hurt(0),
11178 hurtdir: Hurtdir(1),
11179 damage: Damage(0.0),
11180 }
11181 }
11182}
11183
11184#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11186pub struct PaddleLeft(pub bool);
11187#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11189pub struct PaddleRight(pub bool);
11190#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11192pub struct BubbleTime(pub i32);
11193#[derive(Component)]
11236pub struct AbstractBoat;
11237impl AbstractBoat {
11238 fn apply_metadata(
11239 entity: &mut bevy_ecs::system::EntityCommands,
11240 d: EntityDataItem,
11241 ) -> Result<(), UpdateMetadataError> {
11242 match d.index {
11243 0..=10 => AbstractVehicle::apply_metadata(entity, d)?,
11244 11 => {
11245 entity.insert(PaddleLeft(d.value.into_boolean()?));
11246 }
11247 12 => {
11248 entity.insert(PaddleRight(d.value.into_boolean()?));
11249 }
11250 13 => {
11251 entity.insert(BubbleTime(d.value.into_int()?));
11252 }
11253 _ => {}
11254 }
11255 Ok(())
11256 }
11257}
11258
11259#[derive(Bundle)]
11263pub struct AbstractBoatMetadataBundle {
11264 _marker: AbstractBoat,
11265 parent: AbstractVehicleMetadataBundle,
11266 paddle_left: PaddleLeft,
11267 paddle_right: PaddleRight,
11268 bubble_time: BubbleTime,
11269}
11270impl Default for AbstractBoatMetadataBundle {
11271 fn default() -> Self {
11272 Self {
11273 _marker: AbstractBoat,
11274 parent: Default::default(),
11275 paddle_left: PaddleLeft(false),
11276 paddle_right: PaddleRight(false),
11277 bubble_time: BubbleTime(0),
11278 }
11279 }
11280}
11281
11282#[derive(Component)]
11302pub struct AcaciaBoat;
11303impl AcaciaBoat {
11304 fn apply_metadata(
11305 entity: &mut bevy_ecs::system::EntityCommands,
11306 d: EntityDataItem,
11307 ) -> Result<(), UpdateMetadataError> {
11308 match d.index {
11309 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11310 _ => {}
11311 }
11312 Ok(())
11313 }
11314}
11315
11316#[derive(Bundle)]
11320pub struct AcaciaBoatMetadataBundle {
11321 _marker: AcaciaBoat,
11322 parent: AbstractBoatMetadataBundle,
11323}
11324impl Default for AcaciaBoatMetadataBundle {
11325 fn default() -> Self {
11326 Self {
11327 _marker: AcaciaBoat,
11328 parent: Default::default(),
11329 }
11330 }
11331}
11332
11333#[derive(Component)]
11353pub struct AcaciaChestBoat;
11354impl AcaciaChestBoat {
11355 fn apply_metadata(
11356 entity: &mut bevy_ecs::system::EntityCommands,
11357 d: EntityDataItem,
11358 ) -> Result<(), UpdateMetadataError> {
11359 match d.index {
11360 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11361 _ => {}
11362 }
11363 Ok(())
11364 }
11365}
11366
11367#[derive(Bundle)]
11371pub struct AcaciaChestBoatMetadataBundle {
11372 _marker: AcaciaChestBoat,
11373 parent: AbstractBoatMetadataBundle,
11374}
11375impl Default for AcaciaChestBoatMetadataBundle {
11376 fn default() -> Self {
11377 Self {
11378 _marker: AcaciaChestBoat,
11379 parent: Default::default(),
11380 }
11381 }
11382}
11383
11384#[derive(Component)]
11404pub struct BambooChestRaft;
11405impl BambooChestRaft {
11406 fn apply_metadata(
11407 entity: &mut bevy_ecs::system::EntityCommands,
11408 d: EntityDataItem,
11409 ) -> Result<(), UpdateMetadataError> {
11410 match d.index {
11411 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11412 _ => {}
11413 }
11414 Ok(())
11415 }
11416}
11417
11418#[derive(Bundle)]
11422pub struct BambooChestRaftMetadataBundle {
11423 _marker: BambooChestRaft,
11424 parent: AbstractBoatMetadataBundle,
11425}
11426impl Default for BambooChestRaftMetadataBundle {
11427 fn default() -> Self {
11428 Self {
11429 _marker: BambooChestRaft,
11430 parent: Default::default(),
11431 }
11432 }
11433}
11434
11435#[derive(Component)]
11455pub struct BambooRaft;
11456impl BambooRaft {
11457 fn apply_metadata(
11458 entity: &mut bevy_ecs::system::EntityCommands,
11459 d: EntityDataItem,
11460 ) -> Result<(), UpdateMetadataError> {
11461 match d.index {
11462 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11463 _ => {}
11464 }
11465 Ok(())
11466 }
11467}
11468
11469#[derive(Bundle)]
11473pub struct BambooRaftMetadataBundle {
11474 _marker: BambooRaft,
11475 parent: AbstractBoatMetadataBundle,
11476}
11477impl Default for BambooRaftMetadataBundle {
11478 fn default() -> Self {
11479 Self {
11480 _marker: BambooRaft,
11481 parent: Default::default(),
11482 }
11483 }
11484}
11485
11486#[derive(Component)]
11506pub struct BirchBoat;
11507impl BirchBoat {
11508 fn apply_metadata(
11509 entity: &mut bevy_ecs::system::EntityCommands,
11510 d: EntityDataItem,
11511 ) -> Result<(), UpdateMetadataError> {
11512 match d.index {
11513 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11514 _ => {}
11515 }
11516 Ok(())
11517 }
11518}
11519
11520#[derive(Bundle)]
11524pub struct BirchBoatMetadataBundle {
11525 _marker: BirchBoat,
11526 parent: AbstractBoatMetadataBundle,
11527}
11528impl Default for BirchBoatMetadataBundle {
11529 fn default() -> Self {
11530 Self {
11531 _marker: BirchBoat,
11532 parent: Default::default(),
11533 }
11534 }
11535}
11536
11537#[derive(Component)]
11557pub struct BirchChestBoat;
11558impl BirchChestBoat {
11559 fn apply_metadata(
11560 entity: &mut bevy_ecs::system::EntityCommands,
11561 d: EntityDataItem,
11562 ) -> Result<(), UpdateMetadataError> {
11563 match d.index {
11564 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11565 _ => {}
11566 }
11567 Ok(())
11568 }
11569}
11570
11571#[derive(Bundle)]
11575pub struct BirchChestBoatMetadataBundle {
11576 _marker: BirchChestBoat,
11577 parent: AbstractBoatMetadataBundle,
11578}
11579impl Default for BirchChestBoatMetadataBundle {
11580 fn default() -> Self {
11581 Self {
11582 _marker: BirchChestBoat,
11583 parent: Default::default(),
11584 }
11585 }
11586}
11587
11588#[derive(Component)]
11608pub struct CherryBoat;
11609impl CherryBoat {
11610 fn apply_metadata(
11611 entity: &mut bevy_ecs::system::EntityCommands,
11612 d: EntityDataItem,
11613 ) -> Result<(), UpdateMetadataError> {
11614 match d.index {
11615 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11616 _ => {}
11617 }
11618 Ok(())
11619 }
11620}
11621
11622#[derive(Bundle)]
11626pub struct CherryBoatMetadataBundle {
11627 _marker: CherryBoat,
11628 parent: AbstractBoatMetadataBundle,
11629}
11630impl Default for CherryBoatMetadataBundle {
11631 fn default() -> Self {
11632 Self {
11633 _marker: CherryBoat,
11634 parent: Default::default(),
11635 }
11636 }
11637}
11638
11639#[derive(Component)]
11659pub struct CherryChestBoat;
11660impl CherryChestBoat {
11661 fn apply_metadata(
11662 entity: &mut bevy_ecs::system::EntityCommands,
11663 d: EntityDataItem,
11664 ) -> Result<(), UpdateMetadataError> {
11665 match d.index {
11666 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11667 _ => {}
11668 }
11669 Ok(())
11670 }
11671}
11672
11673#[derive(Bundle)]
11677pub struct CherryChestBoatMetadataBundle {
11678 _marker: CherryChestBoat,
11679 parent: AbstractBoatMetadataBundle,
11680}
11681impl Default for CherryChestBoatMetadataBundle {
11682 fn default() -> Self {
11683 Self {
11684 _marker: CherryChestBoat,
11685 parent: Default::default(),
11686 }
11687 }
11688}
11689
11690#[derive(Component)]
11710pub struct DarkOakBoat;
11711impl DarkOakBoat {
11712 fn apply_metadata(
11713 entity: &mut bevy_ecs::system::EntityCommands,
11714 d: EntityDataItem,
11715 ) -> Result<(), UpdateMetadataError> {
11716 match d.index {
11717 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11718 _ => {}
11719 }
11720 Ok(())
11721 }
11722}
11723
11724#[derive(Bundle)]
11728pub struct DarkOakBoatMetadataBundle {
11729 _marker: DarkOakBoat,
11730 parent: AbstractBoatMetadataBundle,
11731}
11732impl Default for DarkOakBoatMetadataBundle {
11733 fn default() -> Self {
11734 Self {
11735 _marker: DarkOakBoat,
11736 parent: Default::default(),
11737 }
11738 }
11739}
11740
11741#[derive(Component)]
11761pub struct DarkOakChestBoat;
11762impl DarkOakChestBoat {
11763 fn apply_metadata(
11764 entity: &mut bevy_ecs::system::EntityCommands,
11765 d: EntityDataItem,
11766 ) -> Result<(), UpdateMetadataError> {
11767 match d.index {
11768 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11769 _ => {}
11770 }
11771 Ok(())
11772 }
11773}
11774
11775#[derive(Bundle)]
11779pub struct DarkOakChestBoatMetadataBundle {
11780 _marker: DarkOakChestBoat,
11781 parent: AbstractBoatMetadataBundle,
11782}
11783impl Default for DarkOakChestBoatMetadataBundle {
11784 fn default() -> Self {
11785 Self {
11786 _marker: DarkOakChestBoat,
11787 parent: Default::default(),
11788 }
11789 }
11790}
11791
11792#[derive(Component)]
11812pub struct JungleBoat;
11813impl JungleBoat {
11814 fn apply_metadata(
11815 entity: &mut bevy_ecs::system::EntityCommands,
11816 d: EntityDataItem,
11817 ) -> Result<(), UpdateMetadataError> {
11818 match d.index {
11819 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11820 _ => {}
11821 }
11822 Ok(())
11823 }
11824}
11825
11826#[derive(Bundle)]
11830pub struct JungleBoatMetadataBundle {
11831 _marker: JungleBoat,
11832 parent: AbstractBoatMetadataBundle,
11833}
11834impl Default for JungleBoatMetadataBundle {
11835 fn default() -> Self {
11836 Self {
11837 _marker: JungleBoat,
11838 parent: Default::default(),
11839 }
11840 }
11841}
11842
11843#[derive(Component)]
11863pub struct JungleChestBoat;
11864impl JungleChestBoat {
11865 fn apply_metadata(
11866 entity: &mut bevy_ecs::system::EntityCommands,
11867 d: EntityDataItem,
11868 ) -> Result<(), UpdateMetadataError> {
11869 match d.index {
11870 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11871 _ => {}
11872 }
11873 Ok(())
11874 }
11875}
11876
11877#[derive(Bundle)]
11881pub struct JungleChestBoatMetadataBundle {
11882 _marker: JungleChestBoat,
11883 parent: AbstractBoatMetadataBundle,
11884}
11885impl Default for JungleChestBoatMetadataBundle {
11886 fn default() -> Self {
11887 Self {
11888 _marker: JungleChestBoat,
11889 parent: Default::default(),
11890 }
11891 }
11892}
11893
11894#[derive(Component)]
11914pub struct MangroveBoat;
11915impl MangroveBoat {
11916 fn apply_metadata(
11917 entity: &mut bevy_ecs::system::EntityCommands,
11918 d: EntityDataItem,
11919 ) -> Result<(), UpdateMetadataError> {
11920 match d.index {
11921 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11922 _ => {}
11923 }
11924 Ok(())
11925 }
11926}
11927
11928#[derive(Bundle)]
11932pub struct MangroveBoatMetadataBundle {
11933 _marker: MangroveBoat,
11934 parent: AbstractBoatMetadataBundle,
11935}
11936impl Default for MangroveBoatMetadataBundle {
11937 fn default() -> Self {
11938 Self {
11939 _marker: MangroveBoat,
11940 parent: Default::default(),
11941 }
11942 }
11943}
11944
11945#[derive(Component)]
11965pub struct MangroveChestBoat;
11966impl MangroveChestBoat {
11967 fn apply_metadata(
11968 entity: &mut bevy_ecs::system::EntityCommands,
11969 d: EntityDataItem,
11970 ) -> Result<(), UpdateMetadataError> {
11971 match d.index {
11972 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11973 _ => {}
11974 }
11975 Ok(())
11976 }
11977}
11978
11979#[derive(Bundle)]
11983pub struct MangroveChestBoatMetadataBundle {
11984 _marker: MangroveChestBoat,
11985 parent: AbstractBoatMetadataBundle,
11986}
11987impl Default for MangroveChestBoatMetadataBundle {
11988 fn default() -> Self {
11989 Self {
11990 _marker: MangroveChestBoat,
11991 parent: Default::default(),
11992 }
11993 }
11994}
11995
11996#[derive(Component)]
12016pub struct OakBoat;
12017impl OakBoat {
12018 fn apply_metadata(
12019 entity: &mut bevy_ecs::system::EntityCommands,
12020 d: EntityDataItem,
12021 ) -> Result<(), UpdateMetadataError> {
12022 match d.index {
12023 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12024 _ => {}
12025 }
12026 Ok(())
12027 }
12028}
12029
12030#[derive(Bundle)]
12034pub struct OakBoatMetadataBundle {
12035 _marker: OakBoat,
12036 parent: AbstractBoatMetadataBundle,
12037}
12038impl Default for OakBoatMetadataBundle {
12039 fn default() -> Self {
12040 Self {
12041 _marker: OakBoat,
12042 parent: Default::default(),
12043 }
12044 }
12045}
12046
12047#[derive(Component)]
12067pub struct OakChestBoat;
12068impl OakChestBoat {
12069 fn apply_metadata(
12070 entity: &mut bevy_ecs::system::EntityCommands,
12071 d: EntityDataItem,
12072 ) -> Result<(), UpdateMetadataError> {
12073 match d.index {
12074 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12075 _ => {}
12076 }
12077 Ok(())
12078 }
12079}
12080
12081#[derive(Bundle)]
12085pub struct OakChestBoatMetadataBundle {
12086 _marker: OakChestBoat,
12087 parent: AbstractBoatMetadataBundle,
12088}
12089impl Default for OakChestBoatMetadataBundle {
12090 fn default() -> Self {
12091 Self {
12092 _marker: OakChestBoat,
12093 parent: Default::default(),
12094 }
12095 }
12096}
12097
12098#[derive(Component)]
12118pub struct PaleOakBoat;
12119impl PaleOakBoat {
12120 fn apply_metadata(
12121 entity: &mut bevy_ecs::system::EntityCommands,
12122 d: EntityDataItem,
12123 ) -> Result<(), UpdateMetadataError> {
12124 match d.index {
12125 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12126 _ => {}
12127 }
12128 Ok(())
12129 }
12130}
12131
12132#[derive(Bundle)]
12136pub struct PaleOakBoatMetadataBundle {
12137 _marker: PaleOakBoat,
12138 parent: AbstractBoatMetadataBundle,
12139}
12140impl Default for PaleOakBoatMetadataBundle {
12141 fn default() -> Self {
12142 Self {
12143 _marker: PaleOakBoat,
12144 parent: Default::default(),
12145 }
12146 }
12147}
12148
12149#[derive(Component)]
12169pub struct PaleOakChestBoat;
12170impl PaleOakChestBoat {
12171 fn apply_metadata(
12172 entity: &mut bevy_ecs::system::EntityCommands,
12173 d: EntityDataItem,
12174 ) -> Result<(), UpdateMetadataError> {
12175 match d.index {
12176 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12177 _ => {}
12178 }
12179 Ok(())
12180 }
12181}
12182
12183#[derive(Bundle)]
12187pub struct PaleOakChestBoatMetadataBundle {
12188 _marker: PaleOakChestBoat,
12189 parent: AbstractBoatMetadataBundle,
12190}
12191impl Default for PaleOakChestBoatMetadataBundle {
12192 fn default() -> Self {
12193 Self {
12194 _marker: PaleOakChestBoat,
12195 parent: Default::default(),
12196 }
12197 }
12198}
12199
12200#[derive(Component)]
12220pub struct SpruceBoat;
12221impl SpruceBoat {
12222 fn apply_metadata(
12223 entity: &mut bevy_ecs::system::EntityCommands,
12224 d: EntityDataItem,
12225 ) -> Result<(), UpdateMetadataError> {
12226 match d.index {
12227 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12228 _ => {}
12229 }
12230 Ok(())
12231 }
12232}
12233
12234#[derive(Bundle)]
12238pub struct SpruceBoatMetadataBundle {
12239 _marker: SpruceBoat,
12240 parent: AbstractBoatMetadataBundle,
12241}
12242impl Default for SpruceBoatMetadataBundle {
12243 fn default() -> Self {
12244 Self {
12245 _marker: SpruceBoat,
12246 parent: Default::default(),
12247 }
12248 }
12249}
12250
12251#[derive(Component)]
12271pub struct SpruceChestBoat;
12272impl SpruceChestBoat {
12273 fn apply_metadata(
12274 entity: &mut bevy_ecs::system::EntityCommands,
12275 d: EntityDataItem,
12276 ) -> Result<(), UpdateMetadataError> {
12277 match d.index {
12278 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12279 _ => {}
12280 }
12281 Ok(())
12282 }
12283}
12284
12285#[derive(Bundle)]
12289pub struct SpruceChestBoatMetadataBundle {
12290 _marker: SpruceChestBoat,
12291 parent: AbstractBoatMetadataBundle,
12292}
12293impl Default for SpruceChestBoatMetadataBundle {
12294 fn default() -> Self {
12295 Self {
12296 _marker: SpruceChestBoat,
12297 parent: Default::default(),
12298 }
12299 }
12300}
12301
12302#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12304pub struct CustomDisplayBlock(pub azalea_block::BlockState);
12305#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12307pub struct DisplayOffset(pub i32);
12308#[derive(Component)]
12337pub struct AbstractMinecart;
12338impl AbstractMinecart {
12339 fn apply_metadata(
12340 entity: &mut bevy_ecs::system::EntityCommands,
12341 d: EntityDataItem,
12342 ) -> Result<(), UpdateMetadataError> {
12343 match d.index {
12344 0..=10 => AbstractVehicle::apply_metadata(entity, d)?,
12345 11 => {
12346 entity.insert(CustomDisplayBlock(d.value.into_optional_block_state()?));
12347 }
12348 12 => {
12349 entity.insert(DisplayOffset(d.value.into_int()?));
12350 }
12351 _ => {}
12352 }
12353 Ok(())
12354 }
12355}
12356
12357#[derive(Bundle)]
12361pub struct AbstractMinecartMetadataBundle {
12362 _marker: AbstractMinecart,
12363 parent: AbstractVehicleMetadataBundle,
12364 custom_display_block: CustomDisplayBlock,
12365 display_offset: DisplayOffset,
12366}
12367impl Default for AbstractMinecartMetadataBundle {
12368 fn default() -> Self {
12369 Self {
12370 _marker: AbstractMinecart,
12371 parent: Default::default(),
12372 custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR),
12373 display_offset: DisplayOffset(Default::default()),
12374 }
12375 }
12376}
12377
12378#[derive(Component)]
12398pub struct ChestMinecart;
12399impl ChestMinecart {
12400 fn apply_metadata(
12401 entity: &mut bevy_ecs::system::EntityCommands,
12402 d: EntityDataItem,
12403 ) -> Result<(), UpdateMetadataError> {
12404 match d.index {
12405 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12406 _ => {}
12407 }
12408 Ok(())
12409 }
12410}
12411
12412#[derive(Bundle)]
12416pub struct ChestMinecartMetadataBundle {
12417 _marker: ChestMinecart,
12418 parent: AbstractMinecartMetadataBundle,
12419}
12420impl Default for ChestMinecartMetadataBundle {
12421 fn default() -> Self {
12422 Self {
12423 _marker: ChestMinecart,
12424 parent: Default::default(),
12425 }
12426 }
12427}
12428
12429#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12431pub struct CommandName(pub Box<str>);
12432#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12434pub struct LastOutput(pub Box<FormattedText>);
12435#[derive(Component)]
12460pub struct CommandBlockMinecart;
12461impl CommandBlockMinecart {
12462 fn apply_metadata(
12463 entity: &mut bevy_ecs::system::EntityCommands,
12464 d: EntityDataItem,
12465 ) -> Result<(), UpdateMetadataError> {
12466 match d.index {
12467 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12468 13 => {
12469 entity.insert(CommandName(d.value.into_string()?));
12470 }
12471 14 => {
12472 entity.insert(LastOutput(d.value.into_formatted_text()?));
12473 }
12474 _ => {}
12475 }
12476 Ok(())
12477 }
12478}
12479
12480#[derive(Bundle)]
12484pub struct CommandBlockMinecartMetadataBundle {
12485 _marker: CommandBlockMinecart,
12486 parent: AbstractMinecartMetadataBundle,
12487 command_name: CommandName,
12488 last_output: LastOutput,
12489}
12490impl Default for CommandBlockMinecartMetadataBundle {
12491 fn default() -> Self {
12492 Self {
12493 _marker: CommandBlockMinecart,
12494 parent: Default::default(),
12495 command_name: CommandName("".into()),
12496 last_output: LastOutput(Default::default()),
12497 }
12498 }
12499}
12500
12501#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12503pub struct Fuel(pub bool);
12504#[derive(Component)]
12527pub struct FurnaceMinecart;
12528impl FurnaceMinecart {
12529 fn apply_metadata(
12530 entity: &mut bevy_ecs::system::EntityCommands,
12531 d: EntityDataItem,
12532 ) -> Result<(), UpdateMetadataError> {
12533 match d.index {
12534 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12535 13 => {
12536 entity.insert(Fuel(d.value.into_boolean()?));
12537 }
12538 _ => {}
12539 }
12540 Ok(())
12541 }
12542}
12543
12544#[derive(Bundle)]
12548pub struct FurnaceMinecartMetadataBundle {
12549 _marker: FurnaceMinecart,
12550 parent: AbstractMinecartMetadataBundle,
12551 fuel: Fuel,
12552}
12553impl Default for FurnaceMinecartMetadataBundle {
12554 fn default() -> Self {
12555 Self {
12556 _marker: FurnaceMinecart,
12557 parent: Default::default(),
12558 fuel: Fuel(false),
12559 }
12560 }
12561}
12562
12563#[derive(Component)]
12583pub struct HopperMinecart;
12584impl HopperMinecart {
12585 fn apply_metadata(
12586 entity: &mut bevy_ecs::system::EntityCommands,
12587 d: EntityDataItem,
12588 ) -> Result<(), UpdateMetadataError> {
12589 match d.index {
12590 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12591 _ => {}
12592 }
12593 Ok(())
12594 }
12595}
12596
12597#[derive(Bundle)]
12601pub struct HopperMinecartMetadataBundle {
12602 _marker: HopperMinecart,
12603 parent: AbstractMinecartMetadataBundle,
12604}
12605impl Default for HopperMinecartMetadataBundle {
12606 fn default() -> Self {
12607 Self {
12608 _marker: HopperMinecart,
12609 parent: Default::default(),
12610 }
12611 }
12612}
12613
12614#[derive(Component)]
12634pub struct Minecart;
12635impl Minecart {
12636 fn apply_metadata(
12637 entity: &mut bevy_ecs::system::EntityCommands,
12638 d: EntityDataItem,
12639 ) -> Result<(), UpdateMetadataError> {
12640 match d.index {
12641 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12642 _ => {}
12643 }
12644 Ok(())
12645 }
12646}
12647
12648#[derive(Bundle)]
12652pub struct MinecartMetadataBundle {
12653 _marker: Minecart,
12654 parent: AbstractMinecartMetadataBundle,
12655}
12656impl Default for MinecartMetadataBundle {
12657 fn default() -> Self {
12658 Self {
12659 _marker: Minecart,
12660 parent: Default::default(),
12661 }
12662 }
12663}
12664
12665#[derive(Component)]
12685pub struct SpawnerMinecart;
12686impl SpawnerMinecart {
12687 fn apply_metadata(
12688 entity: &mut bevy_ecs::system::EntityCommands,
12689 d: EntityDataItem,
12690 ) -> Result<(), UpdateMetadataError> {
12691 match d.index {
12692 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12693 _ => {}
12694 }
12695 Ok(())
12696 }
12697}
12698
12699#[derive(Bundle)]
12703pub struct SpawnerMinecartMetadataBundle {
12704 _marker: SpawnerMinecart,
12705 parent: AbstractMinecartMetadataBundle,
12706}
12707impl Default for SpawnerMinecartMetadataBundle {
12708 fn default() -> Self {
12709 Self {
12710 _marker: SpawnerMinecart,
12711 parent: Default::default(),
12712 }
12713 }
12714}
12715
12716#[derive(Component)]
12736pub struct TntMinecart;
12737impl TntMinecart {
12738 fn apply_metadata(
12739 entity: &mut bevy_ecs::system::EntityCommands,
12740 d: EntityDataItem,
12741 ) -> Result<(), UpdateMetadataError> {
12742 match d.index {
12743 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12744 _ => {}
12745 }
12746 Ok(())
12747 }
12748}
12749
12750#[derive(Bundle)]
12754pub struct TntMinecartMetadataBundle {
12755 _marker: TntMinecart,
12756 parent: AbstractMinecartMetadataBundle,
12757}
12758impl Default for TntMinecartMetadataBundle {
12759 fn default() -> Self {
12760 Self {
12761 _marker: TntMinecart,
12762 parent: Default::default(),
12763 }
12764 }
12765}
12766
12767pub fn apply_metadata(
12768 entity: &mut bevy_ecs::system::EntityCommands,
12769 entity_kind: EntityKind,
12770 items: Vec<EntityDataItem>,
12771) -> Result<(), UpdateMetadataError> {
12772 match entity_kind {
12773 EntityKind::AcaciaBoat => {
12774 for d in items {
12775 AcaciaBoat::apply_metadata(entity, d)?;
12776 }
12777 }
12778 EntityKind::AcaciaChestBoat => {
12779 for d in items {
12780 AcaciaChestBoat::apply_metadata(entity, d)?;
12781 }
12782 }
12783 EntityKind::Allay => {
12784 for d in items {
12785 Allay::apply_metadata(entity, d)?;
12786 }
12787 }
12788 EntityKind::AreaEffectCloud => {
12789 for d in items {
12790 AreaEffectCloud::apply_metadata(entity, d)?;
12791 }
12792 }
12793 EntityKind::Armadillo => {
12794 for d in items {
12795 Armadillo::apply_metadata(entity, d)?;
12796 }
12797 }
12798 EntityKind::ArmorStand => {
12799 for d in items {
12800 ArmorStand::apply_metadata(entity, d)?;
12801 }
12802 }
12803 EntityKind::Arrow => {
12804 for d in items {
12805 Arrow::apply_metadata(entity, d)?;
12806 }
12807 }
12808 EntityKind::Axolotl => {
12809 for d in items {
12810 Axolotl::apply_metadata(entity, d)?;
12811 }
12812 }
12813 EntityKind::BambooChestRaft => {
12814 for d in items {
12815 BambooChestRaft::apply_metadata(entity, d)?;
12816 }
12817 }
12818 EntityKind::BambooRaft => {
12819 for d in items {
12820 BambooRaft::apply_metadata(entity, d)?;
12821 }
12822 }
12823 EntityKind::Bat => {
12824 for d in items {
12825 Bat::apply_metadata(entity, d)?;
12826 }
12827 }
12828 EntityKind::Bee => {
12829 for d in items {
12830 Bee::apply_metadata(entity, d)?;
12831 }
12832 }
12833 EntityKind::BirchBoat => {
12834 for d in items {
12835 BirchBoat::apply_metadata(entity, d)?;
12836 }
12837 }
12838 EntityKind::BirchChestBoat => {
12839 for d in items {
12840 BirchChestBoat::apply_metadata(entity, d)?;
12841 }
12842 }
12843 EntityKind::Blaze => {
12844 for d in items {
12845 Blaze::apply_metadata(entity, d)?;
12846 }
12847 }
12848 EntityKind::BlockDisplay => {
12849 for d in items {
12850 BlockDisplay::apply_metadata(entity, d)?;
12851 }
12852 }
12853 EntityKind::Bogged => {
12854 for d in items {
12855 Bogged::apply_metadata(entity, d)?;
12856 }
12857 }
12858 EntityKind::Breeze => {
12859 for d in items {
12860 Breeze::apply_metadata(entity, d)?;
12861 }
12862 }
12863 EntityKind::BreezeWindCharge => {
12864 for d in items {
12865 BreezeWindCharge::apply_metadata(entity, d)?;
12866 }
12867 }
12868 EntityKind::Camel => {
12869 for d in items {
12870 Camel::apply_metadata(entity, d)?;
12871 }
12872 }
12873 EntityKind::CamelHusk => {
12874 for d in items {
12875 CamelHusk::apply_metadata(entity, d)?;
12876 }
12877 }
12878 EntityKind::Cat => {
12879 for d in items {
12880 Cat::apply_metadata(entity, d)?;
12881 }
12882 }
12883 EntityKind::CaveSpider => {
12884 for d in items {
12885 CaveSpider::apply_metadata(entity, d)?;
12886 }
12887 }
12888 EntityKind::CherryBoat => {
12889 for d in items {
12890 CherryBoat::apply_metadata(entity, d)?;
12891 }
12892 }
12893 EntityKind::CherryChestBoat => {
12894 for d in items {
12895 CherryChestBoat::apply_metadata(entity, d)?;
12896 }
12897 }
12898 EntityKind::ChestMinecart => {
12899 for d in items {
12900 ChestMinecart::apply_metadata(entity, d)?;
12901 }
12902 }
12903 EntityKind::Chicken => {
12904 for d in items {
12905 Chicken::apply_metadata(entity, d)?;
12906 }
12907 }
12908 EntityKind::Cod => {
12909 for d in items {
12910 Cod::apply_metadata(entity, d)?;
12911 }
12912 }
12913 EntityKind::CommandBlockMinecart => {
12914 for d in items {
12915 CommandBlockMinecart::apply_metadata(entity, d)?;
12916 }
12917 }
12918 EntityKind::CopperGolem => {
12919 for d in items {
12920 CopperGolem::apply_metadata(entity, d)?;
12921 }
12922 }
12923 EntityKind::Cow => {
12924 for d in items {
12925 Cow::apply_metadata(entity, d)?;
12926 }
12927 }
12928 EntityKind::Creaking => {
12929 for d in items {
12930 Creaking::apply_metadata(entity, d)?;
12931 }
12932 }
12933 EntityKind::Creeper => {
12934 for d in items {
12935 Creeper::apply_metadata(entity, d)?;
12936 }
12937 }
12938 EntityKind::DarkOakBoat => {
12939 for d in items {
12940 DarkOakBoat::apply_metadata(entity, d)?;
12941 }
12942 }
12943 EntityKind::DarkOakChestBoat => {
12944 for d in items {
12945 DarkOakChestBoat::apply_metadata(entity, d)?;
12946 }
12947 }
12948 EntityKind::Dolphin => {
12949 for d in items {
12950 Dolphin::apply_metadata(entity, d)?;
12951 }
12952 }
12953 EntityKind::Donkey => {
12954 for d in items {
12955 Donkey::apply_metadata(entity, d)?;
12956 }
12957 }
12958 EntityKind::DragonFireball => {
12959 for d in items {
12960 DragonFireball::apply_metadata(entity, d)?;
12961 }
12962 }
12963 EntityKind::Drowned => {
12964 for d in items {
12965 Drowned::apply_metadata(entity, d)?;
12966 }
12967 }
12968 EntityKind::Egg => {
12969 for d in items {
12970 Egg::apply_metadata(entity, d)?;
12971 }
12972 }
12973 EntityKind::ElderGuardian => {
12974 for d in items {
12975 ElderGuardian::apply_metadata(entity, d)?;
12976 }
12977 }
12978 EntityKind::EndCrystal => {
12979 for d in items {
12980 EndCrystal::apply_metadata(entity, d)?;
12981 }
12982 }
12983 EntityKind::EnderDragon => {
12984 for d in items {
12985 EnderDragon::apply_metadata(entity, d)?;
12986 }
12987 }
12988 EntityKind::EnderPearl => {
12989 for d in items {
12990 EnderPearl::apply_metadata(entity, d)?;
12991 }
12992 }
12993 EntityKind::Enderman => {
12994 for d in items {
12995 Enderman::apply_metadata(entity, d)?;
12996 }
12997 }
12998 EntityKind::Endermite => {
12999 for d in items {
13000 Endermite::apply_metadata(entity, d)?;
13001 }
13002 }
13003 EntityKind::Evoker => {
13004 for d in items {
13005 Evoker::apply_metadata(entity, d)?;
13006 }
13007 }
13008 EntityKind::EvokerFangs => {
13009 for d in items {
13010 EvokerFangs::apply_metadata(entity, d)?;
13011 }
13012 }
13013 EntityKind::ExperienceBottle => {
13014 for d in items {
13015 ExperienceBottle::apply_metadata(entity, d)?;
13016 }
13017 }
13018 EntityKind::ExperienceOrb => {
13019 for d in items {
13020 ExperienceOrb::apply_metadata(entity, d)?;
13021 }
13022 }
13023 EntityKind::EyeOfEnder => {
13024 for d in items {
13025 EyeOfEnder::apply_metadata(entity, d)?;
13026 }
13027 }
13028 EntityKind::FallingBlock => {
13029 for d in items {
13030 FallingBlock::apply_metadata(entity, d)?;
13031 }
13032 }
13033 EntityKind::Fireball => {
13034 for d in items {
13035 Fireball::apply_metadata(entity, d)?;
13036 }
13037 }
13038 EntityKind::FireworkRocket => {
13039 for d in items {
13040 FireworkRocket::apply_metadata(entity, d)?;
13041 }
13042 }
13043 EntityKind::FishingBobber => {
13044 for d in items {
13045 FishingBobber::apply_metadata(entity, d)?;
13046 }
13047 }
13048 EntityKind::Fox => {
13049 for d in items {
13050 Fox::apply_metadata(entity, d)?;
13051 }
13052 }
13053 EntityKind::Frog => {
13054 for d in items {
13055 Frog::apply_metadata(entity, d)?;
13056 }
13057 }
13058 EntityKind::FurnaceMinecart => {
13059 for d in items {
13060 FurnaceMinecart::apply_metadata(entity, d)?;
13061 }
13062 }
13063 EntityKind::Ghast => {
13064 for d in items {
13065 Ghast::apply_metadata(entity, d)?;
13066 }
13067 }
13068 EntityKind::Giant => {
13069 for d in items {
13070 Giant::apply_metadata(entity, d)?;
13071 }
13072 }
13073 EntityKind::GlowItemFrame => {
13074 for d in items {
13075 GlowItemFrame::apply_metadata(entity, d)?;
13076 }
13077 }
13078 EntityKind::GlowSquid => {
13079 for d in items {
13080 GlowSquid::apply_metadata(entity, d)?;
13081 }
13082 }
13083 EntityKind::Goat => {
13084 for d in items {
13085 Goat::apply_metadata(entity, d)?;
13086 }
13087 }
13088 EntityKind::Guardian => {
13089 for d in items {
13090 Guardian::apply_metadata(entity, d)?;
13091 }
13092 }
13093 EntityKind::HappyGhast => {
13094 for d in items {
13095 HappyGhast::apply_metadata(entity, d)?;
13096 }
13097 }
13098 EntityKind::Hoglin => {
13099 for d in items {
13100 Hoglin::apply_metadata(entity, d)?;
13101 }
13102 }
13103 EntityKind::HopperMinecart => {
13104 for d in items {
13105 HopperMinecart::apply_metadata(entity, d)?;
13106 }
13107 }
13108 EntityKind::Horse => {
13109 for d in items {
13110 Horse::apply_metadata(entity, d)?;
13111 }
13112 }
13113 EntityKind::Husk => {
13114 for d in items {
13115 Husk::apply_metadata(entity, d)?;
13116 }
13117 }
13118 EntityKind::Illusioner => {
13119 for d in items {
13120 Illusioner::apply_metadata(entity, d)?;
13121 }
13122 }
13123 EntityKind::Interaction => {
13124 for d in items {
13125 Interaction::apply_metadata(entity, d)?;
13126 }
13127 }
13128 EntityKind::IronGolem => {
13129 for d in items {
13130 IronGolem::apply_metadata(entity, d)?;
13131 }
13132 }
13133 EntityKind::Item => {
13134 for d in items {
13135 Item::apply_metadata(entity, d)?;
13136 }
13137 }
13138 EntityKind::ItemDisplay => {
13139 for d in items {
13140 ItemDisplay::apply_metadata(entity, d)?;
13141 }
13142 }
13143 EntityKind::ItemFrame => {
13144 for d in items {
13145 ItemFrame::apply_metadata(entity, d)?;
13146 }
13147 }
13148 EntityKind::JungleBoat => {
13149 for d in items {
13150 JungleBoat::apply_metadata(entity, d)?;
13151 }
13152 }
13153 EntityKind::JungleChestBoat => {
13154 for d in items {
13155 JungleChestBoat::apply_metadata(entity, d)?;
13156 }
13157 }
13158 EntityKind::LeashKnot => {
13159 for d in items {
13160 LeashKnot::apply_metadata(entity, d)?;
13161 }
13162 }
13163 EntityKind::LightningBolt => {
13164 for d in items {
13165 LightningBolt::apply_metadata(entity, d)?;
13166 }
13167 }
13168 EntityKind::LingeringPotion => {
13169 for d in items {
13170 LingeringPotion::apply_metadata(entity, d)?;
13171 }
13172 }
13173 EntityKind::Llama => {
13174 for d in items {
13175 Llama::apply_metadata(entity, d)?;
13176 }
13177 }
13178 EntityKind::LlamaSpit => {
13179 for d in items {
13180 LlamaSpit::apply_metadata(entity, d)?;
13181 }
13182 }
13183 EntityKind::MagmaCube => {
13184 for d in items {
13185 MagmaCube::apply_metadata(entity, d)?;
13186 }
13187 }
13188 EntityKind::MangroveBoat => {
13189 for d in items {
13190 MangroveBoat::apply_metadata(entity, d)?;
13191 }
13192 }
13193 EntityKind::MangroveChestBoat => {
13194 for d in items {
13195 MangroveChestBoat::apply_metadata(entity, d)?;
13196 }
13197 }
13198 EntityKind::Mannequin => {
13199 for d in items {
13200 Mannequin::apply_metadata(entity, d)?;
13201 }
13202 }
13203 EntityKind::Marker => {
13204 for d in items {
13205 Marker::apply_metadata(entity, d)?;
13206 }
13207 }
13208 EntityKind::Minecart => {
13209 for d in items {
13210 Minecart::apply_metadata(entity, d)?;
13211 }
13212 }
13213 EntityKind::Mooshroom => {
13214 for d in items {
13215 Mooshroom::apply_metadata(entity, d)?;
13216 }
13217 }
13218 EntityKind::Mule => {
13219 for d in items {
13220 Mule::apply_metadata(entity, d)?;
13221 }
13222 }
13223 EntityKind::Nautilus => {
13224 for d in items {
13225 Nautilus::apply_metadata(entity, d)?;
13226 }
13227 }
13228 EntityKind::OakBoat => {
13229 for d in items {
13230 OakBoat::apply_metadata(entity, d)?;
13231 }
13232 }
13233 EntityKind::OakChestBoat => {
13234 for d in items {
13235 OakChestBoat::apply_metadata(entity, d)?;
13236 }
13237 }
13238 EntityKind::Ocelot => {
13239 for d in items {
13240 Ocelot::apply_metadata(entity, d)?;
13241 }
13242 }
13243 EntityKind::OminousItemSpawner => {
13244 for d in items {
13245 OminousItemSpawner::apply_metadata(entity, d)?;
13246 }
13247 }
13248 EntityKind::Painting => {
13249 for d in items {
13250 Painting::apply_metadata(entity, d)?;
13251 }
13252 }
13253 EntityKind::PaleOakBoat => {
13254 for d in items {
13255 PaleOakBoat::apply_metadata(entity, d)?;
13256 }
13257 }
13258 EntityKind::PaleOakChestBoat => {
13259 for d in items {
13260 PaleOakChestBoat::apply_metadata(entity, d)?;
13261 }
13262 }
13263 EntityKind::Panda => {
13264 for d in items {
13265 Panda::apply_metadata(entity, d)?;
13266 }
13267 }
13268 EntityKind::Parched => {
13269 for d in items {
13270 Parched::apply_metadata(entity, d)?;
13271 }
13272 }
13273 EntityKind::Parrot => {
13274 for d in items {
13275 Parrot::apply_metadata(entity, d)?;
13276 }
13277 }
13278 EntityKind::Phantom => {
13279 for d in items {
13280 Phantom::apply_metadata(entity, d)?;
13281 }
13282 }
13283 EntityKind::Pig => {
13284 for d in items {
13285 Pig::apply_metadata(entity, d)?;
13286 }
13287 }
13288 EntityKind::Piglin => {
13289 for d in items {
13290 Piglin::apply_metadata(entity, d)?;
13291 }
13292 }
13293 EntityKind::PiglinBrute => {
13294 for d in items {
13295 PiglinBrute::apply_metadata(entity, d)?;
13296 }
13297 }
13298 EntityKind::Pillager => {
13299 for d in items {
13300 Pillager::apply_metadata(entity, d)?;
13301 }
13302 }
13303 EntityKind::Player => {
13304 for d in items {
13305 Player::apply_metadata(entity, d)?;
13306 }
13307 }
13308 EntityKind::PolarBear => {
13309 for d in items {
13310 PolarBear::apply_metadata(entity, d)?;
13311 }
13312 }
13313 EntityKind::Pufferfish => {
13314 for d in items {
13315 Pufferfish::apply_metadata(entity, d)?;
13316 }
13317 }
13318 EntityKind::Rabbit => {
13319 for d in items {
13320 Rabbit::apply_metadata(entity, d)?;
13321 }
13322 }
13323 EntityKind::Ravager => {
13324 for d in items {
13325 Ravager::apply_metadata(entity, d)?;
13326 }
13327 }
13328 EntityKind::Salmon => {
13329 for d in items {
13330 Salmon::apply_metadata(entity, d)?;
13331 }
13332 }
13333 EntityKind::Sheep => {
13334 for d in items {
13335 Sheep::apply_metadata(entity, d)?;
13336 }
13337 }
13338 EntityKind::Shulker => {
13339 for d in items {
13340 Shulker::apply_metadata(entity, d)?;
13341 }
13342 }
13343 EntityKind::ShulkerBullet => {
13344 for d in items {
13345 ShulkerBullet::apply_metadata(entity, d)?;
13346 }
13347 }
13348 EntityKind::Silverfish => {
13349 for d in items {
13350 Silverfish::apply_metadata(entity, d)?;
13351 }
13352 }
13353 EntityKind::Skeleton => {
13354 for d in items {
13355 Skeleton::apply_metadata(entity, d)?;
13356 }
13357 }
13358 EntityKind::SkeletonHorse => {
13359 for d in items {
13360 SkeletonHorse::apply_metadata(entity, d)?;
13361 }
13362 }
13363 EntityKind::Slime => {
13364 for d in items {
13365 Slime::apply_metadata(entity, d)?;
13366 }
13367 }
13368 EntityKind::SmallFireball => {
13369 for d in items {
13370 SmallFireball::apply_metadata(entity, d)?;
13371 }
13372 }
13373 EntityKind::Sniffer => {
13374 for d in items {
13375 Sniffer::apply_metadata(entity, d)?;
13376 }
13377 }
13378 EntityKind::SnowGolem => {
13379 for d in items {
13380 SnowGolem::apply_metadata(entity, d)?;
13381 }
13382 }
13383 EntityKind::Snowball => {
13384 for d in items {
13385 Snowball::apply_metadata(entity, d)?;
13386 }
13387 }
13388 EntityKind::SpawnerMinecart => {
13389 for d in items {
13390 SpawnerMinecart::apply_metadata(entity, d)?;
13391 }
13392 }
13393 EntityKind::SpectralArrow => {
13394 for d in items {
13395 SpectralArrow::apply_metadata(entity, d)?;
13396 }
13397 }
13398 EntityKind::Spider => {
13399 for d in items {
13400 Spider::apply_metadata(entity, d)?;
13401 }
13402 }
13403 EntityKind::SplashPotion => {
13404 for d in items {
13405 SplashPotion::apply_metadata(entity, d)?;
13406 }
13407 }
13408 EntityKind::SpruceBoat => {
13409 for d in items {
13410 SpruceBoat::apply_metadata(entity, d)?;
13411 }
13412 }
13413 EntityKind::SpruceChestBoat => {
13414 for d in items {
13415 SpruceChestBoat::apply_metadata(entity, d)?;
13416 }
13417 }
13418 EntityKind::Squid => {
13419 for d in items {
13420 Squid::apply_metadata(entity, d)?;
13421 }
13422 }
13423 EntityKind::Stray => {
13424 for d in items {
13425 Stray::apply_metadata(entity, d)?;
13426 }
13427 }
13428 EntityKind::Strider => {
13429 for d in items {
13430 Strider::apply_metadata(entity, d)?;
13431 }
13432 }
13433 EntityKind::Tadpole => {
13434 for d in items {
13435 Tadpole::apply_metadata(entity, d)?;
13436 }
13437 }
13438 EntityKind::TextDisplay => {
13439 for d in items {
13440 TextDisplay::apply_metadata(entity, d)?;
13441 }
13442 }
13443 EntityKind::Tnt => {
13444 for d in items {
13445 Tnt::apply_metadata(entity, d)?;
13446 }
13447 }
13448 EntityKind::TntMinecart => {
13449 for d in items {
13450 TntMinecart::apply_metadata(entity, d)?;
13451 }
13452 }
13453 EntityKind::TraderLlama => {
13454 for d in items {
13455 TraderLlama::apply_metadata(entity, d)?;
13456 }
13457 }
13458 EntityKind::Trident => {
13459 for d in items {
13460 Trident::apply_metadata(entity, d)?;
13461 }
13462 }
13463 EntityKind::TropicalFish => {
13464 for d in items {
13465 TropicalFish::apply_metadata(entity, d)?;
13466 }
13467 }
13468 EntityKind::Turtle => {
13469 for d in items {
13470 Turtle::apply_metadata(entity, d)?;
13471 }
13472 }
13473 EntityKind::Vex => {
13474 for d in items {
13475 Vex::apply_metadata(entity, d)?;
13476 }
13477 }
13478 EntityKind::Villager => {
13479 for d in items {
13480 Villager::apply_metadata(entity, d)?;
13481 }
13482 }
13483 EntityKind::Vindicator => {
13484 for d in items {
13485 Vindicator::apply_metadata(entity, d)?;
13486 }
13487 }
13488 EntityKind::WanderingTrader => {
13489 for d in items {
13490 WanderingTrader::apply_metadata(entity, d)?;
13491 }
13492 }
13493 EntityKind::Warden => {
13494 for d in items {
13495 Warden::apply_metadata(entity, d)?;
13496 }
13497 }
13498 EntityKind::WindCharge => {
13499 for d in items {
13500 WindCharge::apply_metadata(entity, d)?;
13501 }
13502 }
13503 EntityKind::Witch => {
13504 for d in items {
13505 Witch::apply_metadata(entity, d)?;
13506 }
13507 }
13508 EntityKind::Wither => {
13509 for d in items {
13510 Wither::apply_metadata(entity, d)?;
13511 }
13512 }
13513 EntityKind::WitherSkeleton => {
13514 for d in items {
13515 WitherSkeleton::apply_metadata(entity, d)?;
13516 }
13517 }
13518 EntityKind::WitherSkull => {
13519 for d in items {
13520 WitherSkull::apply_metadata(entity, d)?;
13521 }
13522 }
13523 EntityKind::Wolf => {
13524 for d in items {
13525 Wolf::apply_metadata(entity, d)?;
13526 }
13527 }
13528 EntityKind::Zoglin => {
13529 for d in items {
13530 Zoglin::apply_metadata(entity, d)?;
13531 }
13532 }
13533 EntityKind::Zombie => {
13534 for d in items {
13535 Zombie::apply_metadata(entity, d)?;
13536 }
13537 }
13538 EntityKind::ZombieHorse => {
13539 for d in items {
13540 ZombieHorse::apply_metadata(entity, d)?;
13541 }
13542 }
13543 EntityKind::ZombieNautilus => {
13544 for d in items {
13545 ZombieNautilus::apply_metadata(entity, d)?;
13546 }
13547 }
13548 EntityKind::ZombieVillager => {
13549 for d in items {
13550 ZombieVillager::apply_metadata(entity, d)?;
13551 }
13552 }
13553 EntityKind::ZombifiedPiglin => {
13554 for d in items {
13555 ZombifiedPiglin::apply_metadata(entity, d)?;
13556 }
13557 }
13558 }
13559 Ok(())
13560}
13561
13562pub fn apply_default_metadata(entity: &mut bevy_ecs::system::EntityCommands, kind: EntityKind) {
13563 match kind {
13564 EntityKind::AcaciaBoat => {
13565 entity.insert(AcaciaBoatMetadataBundle::default());
13566 }
13567 EntityKind::AcaciaChestBoat => {
13568 entity.insert(AcaciaChestBoatMetadataBundle::default());
13569 }
13570 EntityKind::Allay => {
13571 entity.insert(AllayMetadataBundle::default());
13572 }
13573 EntityKind::AreaEffectCloud => {
13574 entity.insert(AreaEffectCloudMetadataBundle::default());
13575 }
13576 EntityKind::Armadillo => {
13577 entity.insert(ArmadilloMetadataBundle::default());
13578 }
13579 EntityKind::ArmorStand => {
13580 entity.insert(ArmorStandMetadataBundle::default());
13581 }
13582 EntityKind::Arrow => {
13583 entity.insert(ArrowMetadataBundle::default());
13584 }
13585 EntityKind::Axolotl => {
13586 entity.insert(AxolotlMetadataBundle::default());
13587 }
13588 EntityKind::BambooChestRaft => {
13589 entity.insert(BambooChestRaftMetadataBundle::default());
13590 }
13591 EntityKind::BambooRaft => {
13592 entity.insert(BambooRaftMetadataBundle::default());
13593 }
13594 EntityKind::Bat => {
13595 entity.insert(BatMetadataBundle::default());
13596 }
13597 EntityKind::Bee => {
13598 entity.insert(BeeMetadataBundle::default());
13599 }
13600 EntityKind::BirchBoat => {
13601 entity.insert(BirchBoatMetadataBundle::default());
13602 }
13603 EntityKind::BirchChestBoat => {
13604 entity.insert(BirchChestBoatMetadataBundle::default());
13605 }
13606 EntityKind::Blaze => {
13607 entity.insert(BlazeMetadataBundle::default());
13608 }
13609 EntityKind::BlockDisplay => {
13610 entity.insert(BlockDisplayMetadataBundle::default());
13611 }
13612 EntityKind::Bogged => {
13613 entity.insert(BoggedMetadataBundle::default());
13614 }
13615 EntityKind::Breeze => {
13616 entity.insert(BreezeMetadataBundle::default());
13617 }
13618 EntityKind::BreezeWindCharge => {
13619 entity.insert(BreezeWindChargeMetadataBundle::default());
13620 }
13621 EntityKind::Camel => {
13622 entity.insert(CamelMetadataBundle::default());
13623 }
13624 EntityKind::CamelHusk => {
13625 entity.insert(CamelHuskMetadataBundle::default());
13626 }
13627 EntityKind::Cat => {
13628 entity.insert(CatMetadataBundle::default());
13629 }
13630 EntityKind::CaveSpider => {
13631 entity.insert(CaveSpiderMetadataBundle::default());
13632 }
13633 EntityKind::CherryBoat => {
13634 entity.insert(CherryBoatMetadataBundle::default());
13635 }
13636 EntityKind::CherryChestBoat => {
13637 entity.insert(CherryChestBoatMetadataBundle::default());
13638 }
13639 EntityKind::ChestMinecart => {
13640 entity.insert(ChestMinecartMetadataBundle::default());
13641 }
13642 EntityKind::Chicken => {
13643 entity.insert(ChickenMetadataBundle::default());
13644 }
13645 EntityKind::Cod => {
13646 entity.insert(CodMetadataBundle::default());
13647 }
13648 EntityKind::CommandBlockMinecart => {
13649 entity.insert(CommandBlockMinecartMetadataBundle::default());
13650 }
13651 EntityKind::CopperGolem => {
13652 entity.insert(CopperGolemMetadataBundle::default());
13653 }
13654 EntityKind::Cow => {
13655 entity.insert(CowMetadataBundle::default());
13656 }
13657 EntityKind::Creaking => {
13658 entity.insert(CreakingMetadataBundle::default());
13659 }
13660 EntityKind::Creeper => {
13661 entity.insert(CreeperMetadataBundle::default());
13662 }
13663 EntityKind::DarkOakBoat => {
13664 entity.insert(DarkOakBoatMetadataBundle::default());
13665 }
13666 EntityKind::DarkOakChestBoat => {
13667 entity.insert(DarkOakChestBoatMetadataBundle::default());
13668 }
13669 EntityKind::Dolphin => {
13670 entity.insert(DolphinMetadataBundle::default());
13671 }
13672 EntityKind::Donkey => {
13673 entity.insert(DonkeyMetadataBundle::default());
13674 }
13675 EntityKind::DragonFireball => {
13676 entity.insert(DragonFireballMetadataBundle::default());
13677 }
13678 EntityKind::Drowned => {
13679 entity.insert(DrownedMetadataBundle::default());
13680 }
13681 EntityKind::Egg => {
13682 entity.insert(EggMetadataBundle::default());
13683 }
13684 EntityKind::ElderGuardian => {
13685 entity.insert(ElderGuardianMetadataBundle::default());
13686 }
13687 EntityKind::EndCrystal => {
13688 entity.insert(EndCrystalMetadataBundle::default());
13689 }
13690 EntityKind::EnderDragon => {
13691 entity.insert(EnderDragonMetadataBundle::default());
13692 }
13693 EntityKind::EnderPearl => {
13694 entity.insert(EnderPearlMetadataBundle::default());
13695 }
13696 EntityKind::Enderman => {
13697 entity.insert(EndermanMetadataBundle::default());
13698 }
13699 EntityKind::Endermite => {
13700 entity.insert(EndermiteMetadataBundle::default());
13701 }
13702 EntityKind::Evoker => {
13703 entity.insert(EvokerMetadataBundle::default());
13704 }
13705 EntityKind::EvokerFangs => {
13706 entity.insert(EvokerFangsMetadataBundle::default());
13707 }
13708 EntityKind::ExperienceBottle => {
13709 entity.insert(ExperienceBottleMetadataBundle::default());
13710 }
13711 EntityKind::ExperienceOrb => {
13712 entity.insert(ExperienceOrbMetadataBundle::default());
13713 }
13714 EntityKind::EyeOfEnder => {
13715 entity.insert(EyeOfEnderMetadataBundle::default());
13716 }
13717 EntityKind::FallingBlock => {
13718 entity.insert(FallingBlockMetadataBundle::default());
13719 }
13720 EntityKind::Fireball => {
13721 entity.insert(FireballMetadataBundle::default());
13722 }
13723 EntityKind::FireworkRocket => {
13724 entity.insert(FireworkRocketMetadataBundle::default());
13725 }
13726 EntityKind::FishingBobber => {
13727 entity.insert(FishingBobberMetadataBundle::default());
13728 }
13729 EntityKind::Fox => {
13730 entity.insert(FoxMetadataBundle::default());
13731 }
13732 EntityKind::Frog => {
13733 entity.insert(FrogMetadataBundle::default());
13734 }
13735 EntityKind::FurnaceMinecart => {
13736 entity.insert(FurnaceMinecartMetadataBundle::default());
13737 }
13738 EntityKind::Ghast => {
13739 entity.insert(GhastMetadataBundle::default());
13740 }
13741 EntityKind::Giant => {
13742 entity.insert(GiantMetadataBundle::default());
13743 }
13744 EntityKind::GlowItemFrame => {
13745 entity.insert(GlowItemFrameMetadataBundle::default());
13746 }
13747 EntityKind::GlowSquid => {
13748 entity.insert(GlowSquidMetadataBundle::default());
13749 }
13750 EntityKind::Goat => {
13751 entity.insert(GoatMetadataBundle::default());
13752 }
13753 EntityKind::Guardian => {
13754 entity.insert(GuardianMetadataBundle::default());
13755 }
13756 EntityKind::HappyGhast => {
13757 entity.insert(HappyGhastMetadataBundle::default());
13758 }
13759 EntityKind::Hoglin => {
13760 entity.insert(HoglinMetadataBundle::default());
13761 }
13762 EntityKind::HopperMinecart => {
13763 entity.insert(HopperMinecartMetadataBundle::default());
13764 }
13765 EntityKind::Horse => {
13766 entity.insert(HorseMetadataBundle::default());
13767 }
13768 EntityKind::Husk => {
13769 entity.insert(HuskMetadataBundle::default());
13770 }
13771 EntityKind::Illusioner => {
13772 entity.insert(IllusionerMetadataBundle::default());
13773 }
13774 EntityKind::Interaction => {
13775 entity.insert(InteractionMetadataBundle::default());
13776 }
13777 EntityKind::IronGolem => {
13778 entity.insert(IronGolemMetadataBundle::default());
13779 }
13780 EntityKind::Item => {
13781 entity.insert(ItemMetadataBundle::default());
13782 }
13783 EntityKind::ItemDisplay => {
13784 entity.insert(ItemDisplayMetadataBundle::default());
13785 }
13786 EntityKind::ItemFrame => {
13787 entity.insert(ItemFrameMetadataBundle::default());
13788 }
13789 EntityKind::JungleBoat => {
13790 entity.insert(JungleBoatMetadataBundle::default());
13791 }
13792 EntityKind::JungleChestBoat => {
13793 entity.insert(JungleChestBoatMetadataBundle::default());
13794 }
13795 EntityKind::LeashKnot => {
13796 entity.insert(LeashKnotMetadataBundle::default());
13797 }
13798 EntityKind::LightningBolt => {
13799 entity.insert(LightningBoltMetadataBundle::default());
13800 }
13801 EntityKind::LingeringPotion => {
13802 entity.insert(LingeringPotionMetadataBundle::default());
13803 }
13804 EntityKind::Llama => {
13805 entity.insert(LlamaMetadataBundle::default());
13806 }
13807 EntityKind::LlamaSpit => {
13808 entity.insert(LlamaSpitMetadataBundle::default());
13809 }
13810 EntityKind::MagmaCube => {
13811 entity.insert(MagmaCubeMetadataBundle::default());
13812 }
13813 EntityKind::MangroveBoat => {
13814 entity.insert(MangroveBoatMetadataBundle::default());
13815 }
13816 EntityKind::MangroveChestBoat => {
13817 entity.insert(MangroveChestBoatMetadataBundle::default());
13818 }
13819 EntityKind::Mannequin => {
13820 entity.insert(MannequinMetadataBundle::default());
13821 }
13822 EntityKind::Marker => {
13823 entity.insert(MarkerMetadataBundle::default());
13824 }
13825 EntityKind::Minecart => {
13826 entity.insert(MinecartMetadataBundle::default());
13827 }
13828 EntityKind::Mooshroom => {
13829 entity.insert(MooshroomMetadataBundle::default());
13830 }
13831 EntityKind::Mule => {
13832 entity.insert(MuleMetadataBundle::default());
13833 }
13834 EntityKind::Nautilus => {
13835 entity.insert(NautilusMetadataBundle::default());
13836 }
13837 EntityKind::OakBoat => {
13838 entity.insert(OakBoatMetadataBundle::default());
13839 }
13840 EntityKind::OakChestBoat => {
13841 entity.insert(OakChestBoatMetadataBundle::default());
13842 }
13843 EntityKind::Ocelot => {
13844 entity.insert(OcelotMetadataBundle::default());
13845 }
13846 EntityKind::OminousItemSpawner => {
13847 entity.insert(OminousItemSpawnerMetadataBundle::default());
13848 }
13849 EntityKind::Painting => {
13850 entity.insert(PaintingMetadataBundle::default());
13851 }
13852 EntityKind::PaleOakBoat => {
13853 entity.insert(PaleOakBoatMetadataBundle::default());
13854 }
13855 EntityKind::PaleOakChestBoat => {
13856 entity.insert(PaleOakChestBoatMetadataBundle::default());
13857 }
13858 EntityKind::Panda => {
13859 entity.insert(PandaMetadataBundle::default());
13860 }
13861 EntityKind::Parched => {
13862 entity.insert(ParchedMetadataBundle::default());
13863 }
13864 EntityKind::Parrot => {
13865 entity.insert(ParrotMetadataBundle::default());
13866 }
13867 EntityKind::Phantom => {
13868 entity.insert(PhantomMetadataBundle::default());
13869 }
13870 EntityKind::Pig => {
13871 entity.insert(PigMetadataBundle::default());
13872 }
13873 EntityKind::Piglin => {
13874 entity.insert(PiglinMetadataBundle::default());
13875 }
13876 EntityKind::PiglinBrute => {
13877 entity.insert(PiglinBruteMetadataBundle::default());
13878 }
13879 EntityKind::Pillager => {
13880 entity.insert(PillagerMetadataBundle::default());
13881 }
13882 EntityKind::Player => {
13883 entity.insert(PlayerMetadataBundle::default());
13884 }
13885 EntityKind::PolarBear => {
13886 entity.insert(PolarBearMetadataBundle::default());
13887 }
13888 EntityKind::Pufferfish => {
13889 entity.insert(PufferfishMetadataBundle::default());
13890 }
13891 EntityKind::Rabbit => {
13892 entity.insert(RabbitMetadataBundle::default());
13893 }
13894 EntityKind::Ravager => {
13895 entity.insert(RavagerMetadataBundle::default());
13896 }
13897 EntityKind::Salmon => {
13898 entity.insert(SalmonMetadataBundle::default());
13899 }
13900 EntityKind::Sheep => {
13901 entity.insert(SheepMetadataBundle::default());
13902 }
13903 EntityKind::Shulker => {
13904 entity.insert(ShulkerMetadataBundle::default());
13905 }
13906 EntityKind::ShulkerBullet => {
13907 entity.insert(ShulkerBulletMetadataBundle::default());
13908 }
13909 EntityKind::Silverfish => {
13910 entity.insert(SilverfishMetadataBundle::default());
13911 }
13912 EntityKind::Skeleton => {
13913 entity.insert(SkeletonMetadataBundle::default());
13914 }
13915 EntityKind::SkeletonHorse => {
13916 entity.insert(SkeletonHorseMetadataBundle::default());
13917 }
13918 EntityKind::Slime => {
13919 entity.insert(SlimeMetadataBundle::default());
13920 }
13921 EntityKind::SmallFireball => {
13922 entity.insert(SmallFireballMetadataBundle::default());
13923 }
13924 EntityKind::Sniffer => {
13925 entity.insert(SnifferMetadataBundle::default());
13926 }
13927 EntityKind::SnowGolem => {
13928 entity.insert(SnowGolemMetadataBundle::default());
13929 }
13930 EntityKind::Snowball => {
13931 entity.insert(SnowballMetadataBundle::default());
13932 }
13933 EntityKind::SpawnerMinecart => {
13934 entity.insert(SpawnerMinecartMetadataBundle::default());
13935 }
13936 EntityKind::SpectralArrow => {
13937 entity.insert(SpectralArrowMetadataBundle::default());
13938 }
13939 EntityKind::Spider => {
13940 entity.insert(SpiderMetadataBundle::default());
13941 }
13942 EntityKind::SplashPotion => {
13943 entity.insert(SplashPotionMetadataBundle::default());
13944 }
13945 EntityKind::SpruceBoat => {
13946 entity.insert(SpruceBoatMetadataBundle::default());
13947 }
13948 EntityKind::SpruceChestBoat => {
13949 entity.insert(SpruceChestBoatMetadataBundle::default());
13950 }
13951 EntityKind::Squid => {
13952 entity.insert(SquidMetadataBundle::default());
13953 }
13954 EntityKind::Stray => {
13955 entity.insert(StrayMetadataBundle::default());
13956 }
13957 EntityKind::Strider => {
13958 entity.insert(StriderMetadataBundle::default());
13959 }
13960 EntityKind::Tadpole => {
13961 entity.insert(TadpoleMetadataBundle::default());
13962 }
13963 EntityKind::TextDisplay => {
13964 entity.insert(TextDisplayMetadataBundle::default());
13965 }
13966 EntityKind::Tnt => {
13967 entity.insert(TntMetadataBundle::default());
13968 }
13969 EntityKind::TntMinecart => {
13970 entity.insert(TntMinecartMetadataBundle::default());
13971 }
13972 EntityKind::TraderLlama => {
13973 entity.insert(TraderLlamaMetadataBundle::default());
13974 }
13975 EntityKind::Trident => {
13976 entity.insert(TridentMetadataBundle::default());
13977 }
13978 EntityKind::TropicalFish => {
13979 entity.insert(TropicalFishMetadataBundle::default());
13980 }
13981 EntityKind::Turtle => {
13982 entity.insert(TurtleMetadataBundle::default());
13983 }
13984 EntityKind::Vex => {
13985 entity.insert(VexMetadataBundle::default());
13986 }
13987 EntityKind::Villager => {
13988 entity.insert(VillagerMetadataBundle::default());
13989 }
13990 EntityKind::Vindicator => {
13991 entity.insert(VindicatorMetadataBundle::default());
13992 }
13993 EntityKind::WanderingTrader => {
13994 entity.insert(WanderingTraderMetadataBundle::default());
13995 }
13996 EntityKind::Warden => {
13997 entity.insert(WardenMetadataBundle::default());
13998 }
13999 EntityKind::WindCharge => {
14000 entity.insert(WindChargeMetadataBundle::default());
14001 }
14002 EntityKind::Witch => {
14003 entity.insert(WitchMetadataBundle::default());
14004 }
14005 EntityKind::Wither => {
14006 entity.insert(WitherMetadataBundle::default());
14007 }
14008 EntityKind::WitherSkeleton => {
14009 entity.insert(WitherSkeletonMetadataBundle::default());
14010 }
14011 EntityKind::WitherSkull => {
14012 entity.insert(WitherSkullMetadataBundle::default());
14013 }
14014 EntityKind::Wolf => {
14015 entity.insert(WolfMetadataBundle::default());
14016 }
14017 EntityKind::Zoglin => {
14018 entity.insert(ZoglinMetadataBundle::default());
14019 }
14020 EntityKind::Zombie => {
14021 entity.insert(ZombieMetadataBundle::default());
14022 }
14023 EntityKind::ZombieHorse => {
14024 entity.insert(ZombieHorseMetadataBundle::default());
14025 }
14026 EntityKind::ZombieNautilus => {
14027 entity.insert(ZombieNautilusMetadataBundle::default());
14028 }
14029 EntityKind::ZombieVillager => {
14030 entity.insert(ZombieVillagerMetadataBundle::default());
14031 }
14032 EntityKind::ZombifiedPiglin => {
14033 entity.insert(ZombifiedPiglinMetadataBundle::default());
14034 }
14035 }
14036}