1#![allow(clippy::single_match, non_snake_case)]
199
200use azalea_chat::FormattedText;
201use azalea_core::{
202 direction::Direction,
203 position::{BlockPos, Vec3f32},
204};
205use azalea_inventory::{ItemStack, components};
206use azalea_registry::{DataRegistry, builtin::EntityKind};
207use bevy_ecs::{bundle::Bundle, component::Component};
208use derive_more::{Deref, DerefMut};
209use thiserror::Error;
210use uuid::Uuid;
211
212use super::{
213 ArmadilloStateKind, CopperGolemStateKind, EntityDataItem, EntityDataValue, OptionalUnsignedInt,
214 Pose, Quaternion, Rotations, SnifferStateKind, VillagerData, WeatheringCopperStateKind,
215};
216use crate::{HumanoidArm, particle::Particle};
217
218#[derive(Error, Debug)]
219pub enum UpdateMetadataError {
220 #[error("Wrong type ({0:?})")]
221 WrongType(EntityDataValue),
222}
223impl From<EntityDataValue> for UpdateMetadataError {
224 fn from(value: EntityDataValue) -> Self {
225 Self::WrongType(value)
226 }
227}
228
229#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
230pub struct OnFire(pub bool);
232#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
233pub struct AbstractEntityShiftKeyDown(pub bool);
235#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
236pub struct Sprinting(pub bool);
238#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
239pub struct Swimming(pub bool);
241#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
242pub struct CurrentlyGlowing(pub bool);
244#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
245pub struct Invisible(pub bool);
247#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
248pub struct FallFlying(pub bool);
250#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
252pub struct AirSupply(pub i32);
253#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
255pub struct CustomName(pub Option<Box<FormattedText>>);
256#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
258pub struct CustomNameVisible(pub bool);
259#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
261pub struct Silent(pub bool);
262#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
264pub struct NoGravity(pub bool);
265#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
267pub struct TicksFrozen(pub i32);
268#[derive(Component)]
476pub struct AbstractEntity;
477impl AbstractEntity {
478 fn apply_metadata(
479 entity: &mut bevy_ecs::system::EntityCommands,
480 d: EntityDataItem,
481 ) -> Result<(), UpdateMetadataError> {
482 match d.index {
483 0 => {
484 let bitfield = d.value.into_byte()?;
485 entity.insert(OnFire(bitfield & 0x1 != 0));
486 entity.insert(AbstractEntityShiftKeyDown(bitfield & 0x2 != 0));
487 entity.insert(Sprinting(bitfield & 0x8 != 0));
488 entity.insert(Swimming(bitfield & 0x10 != 0));
489 entity.insert(CurrentlyGlowing(bitfield & 0x40 != 0));
490 entity.insert(Invisible(bitfield & 0x20 != 0));
491 entity.insert(FallFlying(bitfield & 0x80 != 0));
492 }
493 1 => {
494 entity.insert(AirSupply(d.value.into_int()?));
495 }
496 2 => {
497 entity.insert(CustomName(d.value.into_optional_formatted_text()?));
498 }
499 3 => {
500 entity.insert(CustomNameVisible(d.value.into_boolean()?));
501 }
502 4 => {
503 entity.insert(Silent(d.value.into_boolean()?));
504 }
505 5 => {
506 entity.insert(NoGravity(d.value.into_boolean()?));
507 }
508 6 => {
509 entity.insert(d.value.into_pose()?);
510 }
511 7 => {
512 entity.insert(TicksFrozen(d.value.into_int()?));
513 }
514 _ => {}
515 }
516 Ok(())
517 }
518}
519
520#[derive(Bundle)]
524pub struct AbstractEntityMetadataBundle {
525 _marker: AbstractEntity,
526 on_fire: OnFire,
527 abstract_entity_shift_key_down: AbstractEntityShiftKeyDown,
528 sprinting: Sprinting,
529 swimming: Swimming,
530 currently_glowing: CurrentlyGlowing,
531 invisible: Invisible,
532 fall_flying: FallFlying,
533 air_supply: AirSupply,
534 custom_name: CustomName,
535 custom_name_visible: CustomNameVisible,
536 silent: Silent,
537 no_gravity: NoGravity,
538 pose: Pose,
539 ticks_frozen: TicksFrozen,
540}
541impl Default for AbstractEntityMetadataBundle {
542 fn default() -> Self {
543 Self {
544 _marker: AbstractEntity,
545 on_fire: OnFire(false),
546 abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false),
547 sprinting: Sprinting(false),
548 swimming: Swimming(false),
549 currently_glowing: CurrentlyGlowing(false),
550 invisible: Invisible(false),
551 fall_flying: FallFlying(false),
552 air_supply: AirSupply(300),
553 custom_name: CustomName(None),
554 custom_name_visible: CustomNameVisible(false),
555 silent: Silent(false),
556 no_gravity: NoGravity(false),
557 pose: Pose::default(),
558 ticks_frozen: TicksFrozen(0),
559 }
560 }
561}
562
563#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
565pub struct Radius(pub f32);
566#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
568pub struct Waiting(pub bool);
569#[derive(Component)]
591pub struct AreaEffectCloud;
592impl AreaEffectCloud {
593 fn apply_metadata(
594 entity: &mut bevy_ecs::system::EntityCommands,
595 d: EntityDataItem,
596 ) -> Result<(), UpdateMetadataError> {
597 match d.index {
598 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
599 8 => {
600 entity.insert(Radius(d.value.into_float()?));
601 }
602 9 => {
603 entity.insert(Waiting(d.value.into_boolean()?));
604 }
605 10 => {
606 entity.insert(d.value.into_particle()?);
607 }
608 _ => {}
609 }
610 Ok(())
611 }
612}
613
614#[derive(Bundle)]
618pub struct AreaEffectCloudMetadataBundle {
619 _marker: AreaEffectCloud,
620 parent: AbstractEntityMetadataBundle,
621 radius: Radius,
622 waiting: Waiting,
623 particle: Particle,
624}
625impl Default for AreaEffectCloudMetadataBundle {
626 fn default() -> Self {
627 Self {
628 _marker: AreaEffectCloud,
629 parent: Default::default(),
630 radius: Radius(3.0),
631 waiting: Waiting(false),
632 particle: Particle::default(),
633 }
634 }
635}
636
637#[derive(Component)]
655pub struct BreezeWindCharge;
656impl BreezeWindCharge {
657 fn apply_metadata(
658 entity: &mut bevy_ecs::system::EntityCommands,
659 d: EntityDataItem,
660 ) -> Result<(), UpdateMetadataError> {
661 match d.index {
662 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
663 _ => {}
664 }
665 Ok(())
666 }
667}
668
669#[derive(Bundle)]
673pub struct BreezeWindChargeMetadataBundle {
674 _marker: BreezeWindCharge,
675 parent: AbstractEntityMetadataBundle,
676}
677impl Default for BreezeWindChargeMetadataBundle {
678 fn default() -> Self {
679 Self {
680 _marker: BreezeWindCharge,
681 parent: Default::default(),
682 }
683 }
684}
685
686#[derive(Component)]
704pub struct DragonFireball;
705impl DragonFireball {
706 fn apply_metadata(
707 entity: &mut bevy_ecs::system::EntityCommands,
708 d: EntityDataItem,
709 ) -> Result<(), UpdateMetadataError> {
710 match d.index {
711 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
712 _ => {}
713 }
714 Ok(())
715 }
716}
717
718#[derive(Bundle)]
722pub struct DragonFireballMetadataBundle {
723 _marker: DragonFireball,
724 parent: AbstractEntityMetadataBundle,
725}
726impl Default for DragonFireballMetadataBundle {
727 fn default() -> Self {
728 Self {
729 _marker: DragonFireball,
730 parent: Default::default(),
731 }
732 }
733}
734
735#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
737pub struct BeamTarget(pub Option<BlockPos>);
738#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
740pub struct ShowBottom(pub bool);
741#[derive(Component)]
763pub struct EndCrystal;
764impl EndCrystal {
765 fn apply_metadata(
766 entity: &mut bevy_ecs::system::EntityCommands,
767 d: EntityDataItem,
768 ) -> Result<(), UpdateMetadataError> {
769 match d.index {
770 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
771 8 => {
772 entity.insert(BeamTarget(d.value.into_optional_block_pos()?));
773 }
774 9 => {
775 entity.insert(ShowBottom(d.value.into_boolean()?));
776 }
777 _ => {}
778 }
779 Ok(())
780 }
781}
782
783#[derive(Bundle)]
787pub struct EndCrystalMetadataBundle {
788 _marker: EndCrystal,
789 parent: AbstractEntityMetadataBundle,
790 beam_target: BeamTarget,
791 show_bottom: ShowBottom,
792}
793impl Default for EndCrystalMetadataBundle {
794 fn default() -> Self {
795 Self {
796 _marker: EndCrystal,
797 parent: Default::default(),
798 beam_target: BeamTarget(None),
799 show_bottom: ShowBottom(true),
800 }
801 }
802}
803
804#[derive(Component)]
822pub struct EvokerFangs;
823impl EvokerFangs {
824 fn apply_metadata(
825 entity: &mut bevy_ecs::system::EntityCommands,
826 d: EntityDataItem,
827 ) -> Result<(), UpdateMetadataError> {
828 match d.index {
829 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
830 _ => {}
831 }
832 Ok(())
833 }
834}
835
836#[derive(Bundle)]
840pub struct EvokerFangsMetadataBundle {
841 _marker: EvokerFangs,
842 parent: AbstractEntityMetadataBundle,
843}
844impl Default for EvokerFangsMetadataBundle {
845 fn default() -> Self {
846 Self {
847 _marker: EvokerFangs,
848 parent: Default::default(),
849 }
850 }
851}
852
853#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
855pub struct Value(pub i32);
856#[derive(Component)]
877pub struct ExperienceOrb;
878impl ExperienceOrb {
879 fn apply_metadata(
880 entity: &mut bevy_ecs::system::EntityCommands,
881 d: EntityDataItem,
882 ) -> Result<(), UpdateMetadataError> {
883 match d.index {
884 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
885 8 => {
886 entity.insert(Value(d.value.into_int()?));
887 }
888 _ => {}
889 }
890 Ok(())
891 }
892}
893
894#[derive(Bundle)]
898pub struct ExperienceOrbMetadataBundle {
899 _marker: ExperienceOrb,
900 parent: AbstractEntityMetadataBundle,
901 value: Value,
902}
903impl Default for ExperienceOrbMetadataBundle {
904 fn default() -> Self {
905 Self {
906 _marker: ExperienceOrb,
907 parent: Default::default(),
908 value: Value(0),
909 }
910 }
911}
912
913#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
915pub struct EyeOfEnderItemStack(pub ItemStack);
916#[derive(Component)]
937pub struct EyeOfEnder;
938impl EyeOfEnder {
939 fn apply_metadata(
940 entity: &mut bevy_ecs::system::EntityCommands,
941 d: EntityDataItem,
942 ) -> Result<(), UpdateMetadataError> {
943 match d.index {
944 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
945 8 => {
946 entity.insert(EyeOfEnderItemStack(d.value.into_item_stack()?));
947 }
948 _ => {}
949 }
950 Ok(())
951 }
952}
953
954#[derive(Bundle)]
958pub struct EyeOfEnderMetadataBundle {
959 _marker: EyeOfEnder,
960 parent: AbstractEntityMetadataBundle,
961 eye_of_ender_item_stack: EyeOfEnderItemStack,
962}
963impl Default for EyeOfEnderMetadataBundle {
964 fn default() -> Self {
965 Self {
966 _marker: EyeOfEnder,
967 parent: Default::default(),
968 eye_of_ender_item_stack: EyeOfEnderItemStack(Default::default()),
969 }
970 }
971}
972
973#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
975pub struct StartPos(pub BlockPos);
976#[derive(Component)]
997pub struct FallingBlock;
998impl FallingBlock {
999 fn apply_metadata(
1000 entity: &mut bevy_ecs::system::EntityCommands,
1001 d: EntityDataItem,
1002 ) -> Result<(), UpdateMetadataError> {
1003 match d.index {
1004 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1005 8 => {
1006 entity.insert(StartPos(d.value.into_block_pos()?));
1007 }
1008 _ => {}
1009 }
1010 Ok(())
1011 }
1012}
1013
1014#[derive(Bundle)]
1018pub struct FallingBlockMetadataBundle {
1019 _marker: FallingBlock,
1020 parent: AbstractEntityMetadataBundle,
1021 start_pos: StartPos,
1022}
1023impl Default for FallingBlockMetadataBundle {
1024 fn default() -> Self {
1025 Self {
1026 _marker: FallingBlock,
1027 parent: Default::default(),
1028 start_pos: StartPos(BlockPos::new(0, 0, 0)),
1029 }
1030 }
1031}
1032
1033#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1035pub struct FireballItemStack(pub ItemStack);
1036#[derive(Component)]
1057pub struct Fireball;
1058impl Fireball {
1059 fn apply_metadata(
1060 entity: &mut bevy_ecs::system::EntityCommands,
1061 d: EntityDataItem,
1062 ) -> Result<(), UpdateMetadataError> {
1063 match d.index {
1064 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1065 8 => {
1066 entity.insert(FireballItemStack(d.value.into_item_stack()?));
1067 }
1068 _ => {}
1069 }
1070 Ok(())
1071 }
1072}
1073
1074#[derive(Bundle)]
1078pub struct FireballMetadataBundle {
1079 _marker: Fireball,
1080 parent: AbstractEntityMetadataBundle,
1081 fireball_item_stack: FireballItemStack,
1082}
1083impl Default for FireballMetadataBundle {
1084 fn default() -> Self {
1085 Self {
1086 _marker: Fireball,
1087 parent: Default::default(),
1088 fireball_item_stack: FireballItemStack(Default::default()),
1089 }
1090 }
1091}
1092
1093#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1095pub struct FireworksItem(pub ItemStack);
1096#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1098pub struct AttachedToTarget(pub OptionalUnsignedInt);
1099#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1101pub struct ShotAtAngle(pub bool);
1102#[derive(Component)]
1125pub struct FireworkRocket;
1126impl FireworkRocket {
1127 fn apply_metadata(
1128 entity: &mut bevy_ecs::system::EntityCommands,
1129 d: EntityDataItem,
1130 ) -> Result<(), UpdateMetadataError> {
1131 match d.index {
1132 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1133 8 => {
1134 entity.insert(FireworksItem(d.value.into_item_stack()?));
1135 }
1136 9 => {
1137 entity.insert(AttachedToTarget(d.value.into_optional_unsigned_int()?));
1138 }
1139 10 => {
1140 entity.insert(ShotAtAngle(d.value.into_boolean()?));
1141 }
1142 _ => {}
1143 }
1144 Ok(())
1145 }
1146}
1147
1148#[derive(Bundle)]
1152pub struct FireworkRocketMetadataBundle {
1153 _marker: FireworkRocket,
1154 parent: AbstractEntityMetadataBundle,
1155 fireworks_item: FireworksItem,
1156 attached_to_target: AttachedToTarget,
1157 shot_at_angle: ShotAtAngle,
1158}
1159impl Default for FireworkRocketMetadataBundle {
1160 fn default() -> Self {
1161 Self {
1162 _marker: FireworkRocket,
1163 parent: Default::default(),
1164 fireworks_item: FireworksItem(Default::default()),
1165 attached_to_target: AttachedToTarget(OptionalUnsignedInt(None)),
1166 shot_at_angle: ShotAtAngle(false),
1167 }
1168 }
1169}
1170
1171#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1173pub struct HookedEntity(pub i32);
1174#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1176pub struct Biting(pub bool);
1177#[derive(Component)]
1199pub struct FishingBobber;
1200impl FishingBobber {
1201 fn apply_metadata(
1202 entity: &mut bevy_ecs::system::EntityCommands,
1203 d: EntityDataItem,
1204 ) -> Result<(), UpdateMetadataError> {
1205 match d.index {
1206 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1207 8 => {
1208 entity.insert(HookedEntity(d.value.into_int()?));
1209 }
1210 9 => {
1211 entity.insert(Biting(d.value.into_boolean()?));
1212 }
1213 _ => {}
1214 }
1215 Ok(())
1216 }
1217}
1218
1219#[derive(Bundle)]
1223pub struct FishingBobberMetadataBundle {
1224 _marker: FishingBobber,
1225 parent: AbstractEntityMetadataBundle,
1226 hooked_entity: HookedEntity,
1227 biting: Biting,
1228}
1229impl Default for FishingBobberMetadataBundle {
1230 fn default() -> Self {
1231 Self {
1232 _marker: FishingBobber,
1233 parent: Default::default(),
1234 hooked_entity: HookedEntity(0),
1235 biting: Biting(false),
1236 }
1237 }
1238}
1239
1240#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1242pub struct InteractionWidth(pub f32);
1243#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1245pub struct InteractionHeight(pub f32);
1246#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1248pub struct Response(pub bool);
1249#[derive(Component)]
1272pub struct Interaction;
1273impl Interaction {
1274 fn apply_metadata(
1275 entity: &mut bevy_ecs::system::EntityCommands,
1276 d: EntityDataItem,
1277 ) -> Result<(), UpdateMetadataError> {
1278 match d.index {
1279 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1280 8 => {
1281 entity.insert(InteractionWidth(d.value.into_float()?));
1282 }
1283 9 => {
1284 entity.insert(InteractionHeight(d.value.into_float()?));
1285 }
1286 10 => {
1287 entity.insert(Response(d.value.into_boolean()?));
1288 }
1289 _ => {}
1290 }
1291 Ok(())
1292 }
1293}
1294
1295#[derive(Bundle)]
1299pub struct InteractionMetadataBundle {
1300 _marker: Interaction,
1301 parent: AbstractEntityMetadataBundle,
1302 interaction_width: InteractionWidth,
1303 interaction_height: InteractionHeight,
1304 response: Response,
1305}
1306impl Default for InteractionMetadataBundle {
1307 fn default() -> Self {
1308 Self {
1309 _marker: Interaction,
1310 parent: Default::default(),
1311 interaction_width: InteractionWidth(1.0),
1312 interaction_height: InteractionHeight(1.0),
1313 response: Response(false),
1314 }
1315 }
1316}
1317
1318#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1320pub struct ItemItem(pub ItemStack);
1321#[derive(Component)]
1341pub struct Item;
1342impl Item {
1343 fn apply_metadata(
1344 entity: &mut bevy_ecs::system::EntityCommands,
1345 d: EntityDataItem,
1346 ) -> Result<(), UpdateMetadataError> {
1347 match d.index {
1348 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1349 8 => {
1350 entity.insert(ItemItem(d.value.into_item_stack()?));
1351 }
1352 _ => {}
1353 }
1354 Ok(())
1355 }
1356}
1357
1358#[derive(Bundle)]
1362pub struct ItemMetadataBundle {
1363 _marker: Item,
1364 parent: AbstractEntityMetadataBundle,
1365 item_item: ItemItem,
1366}
1367impl Default for ItemMetadataBundle {
1368 fn default() -> Self {
1369 Self {
1370 _marker: Item,
1371 parent: Default::default(),
1372 item_item: ItemItem(Default::default()),
1373 }
1374 }
1375}
1376
1377#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1379pub struct ItemFrameDirection(pub Direction);
1380#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1382pub struct ItemFrameItem(pub ItemStack);
1383#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1385pub struct Rotation(pub i32);
1386#[derive(Component)]
1409pub struct ItemFrame;
1410impl ItemFrame {
1411 fn apply_metadata(
1412 entity: &mut bevy_ecs::system::EntityCommands,
1413 d: EntityDataItem,
1414 ) -> Result<(), UpdateMetadataError> {
1415 match d.index {
1416 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1417 8 => {
1418 entity.insert(ItemFrameDirection(d.value.into_direction()?));
1419 }
1420 9 => {
1421 entity.insert(ItemFrameItem(d.value.into_item_stack()?));
1422 }
1423 10 => {
1424 entity.insert(Rotation(d.value.into_int()?));
1425 }
1426 _ => {}
1427 }
1428 Ok(())
1429 }
1430}
1431
1432#[derive(Bundle)]
1436pub struct ItemFrameMetadataBundle {
1437 _marker: ItemFrame,
1438 parent: AbstractEntityMetadataBundle,
1439 item_frame_direction: ItemFrameDirection,
1440 item_frame_item: ItemFrameItem,
1441 rotation: Rotation,
1442}
1443impl Default for ItemFrameMetadataBundle {
1444 fn default() -> Self {
1445 Self {
1446 _marker: ItemFrame,
1447 parent: Default::default(),
1448 item_frame_direction: ItemFrameDirection(Default::default()),
1449 item_frame_item: ItemFrameItem(Default::default()),
1450 rotation: Rotation(0),
1451 }
1452 }
1453}
1454
1455#[derive(Component)]
1474pub struct GlowItemFrame;
1475impl GlowItemFrame {
1476 fn apply_metadata(
1477 entity: &mut bevy_ecs::system::EntityCommands,
1478 d: EntityDataItem,
1479 ) -> Result<(), UpdateMetadataError> {
1480 match d.index {
1481 0..=10 => ItemFrame::apply_metadata(entity, d)?,
1482 _ => {}
1483 }
1484 Ok(())
1485 }
1486}
1487
1488#[derive(Bundle)]
1492pub struct GlowItemFrameMetadataBundle {
1493 _marker: GlowItemFrame,
1494 parent: ItemFrameMetadataBundle,
1495}
1496impl Default for GlowItemFrameMetadataBundle {
1497 fn default() -> Self {
1498 Self {
1499 _marker: GlowItemFrame,
1500 parent: Default::default(),
1501 }
1502 }
1503}
1504
1505#[derive(Component)]
1523pub struct LeashKnot;
1524impl LeashKnot {
1525 fn apply_metadata(
1526 entity: &mut bevy_ecs::system::EntityCommands,
1527 d: EntityDataItem,
1528 ) -> Result<(), UpdateMetadataError> {
1529 match d.index {
1530 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1531 _ => {}
1532 }
1533 Ok(())
1534 }
1535}
1536
1537#[derive(Bundle)]
1541pub struct LeashKnotMetadataBundle {
1542 _marker: LeashKnot,
1543 parent: AbstractEntityMetadataBundle,
1544}
1545impl Default for LeashKnotMetadataBundle {
1546 fn default() -> Self {
1547 Self {
1548 _marker: LeashKnot,
1549 parent: Default::default(),
1550 }
1551 }
1552}
1553
1554#[derive(Component)]
1572pub struct LightningBolt;
1573impl LightningBolt {
1574 fn apply_metadata(
1575 entity: &mut bevy_ecs::system::EntityCommands,
1576 d: EntityDataItem,
1577 ) -> Result<(), UpdateMetadataError> {
1578 match d.index {
1579 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1580 _ => {}
1581 }
1582 Ok(())
1583 }
1584}
1585
1586#[derive(Bundle)]
1590pub struct LightningBoltMetadataBundle {
1591 _marker: LightningBolt,
1592 parent: AbstractEntityMetadataBundle,
1593}
1594impl Default for LightningBoltMetadataBundle {
1595 fn default() -> Self {
1596 Self {
1597 _marker: LightningBolt,
1598 parent: Default::default(),
1599 }
1600 }
1601}
1602
1603#[derive(Component)]
1621pub struct LlamaSpit;
1622impl LlamaSpit {
1623 fn apply_metadata(
1624 entity: &mut bevy_ecs::system::EntityCommands,
1625 d: EntityDataItem,
1626 ) -> Result<(), UpdateMetadataError> {
1627 match d.index {
1628 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1629 _ => {}
1630 }
1631 Ok(())
1632 }
1633}
1634
1635#[derive(Bundle)]
1639pub struct LlamaSpitMetadataBundle {
1640 _marker: LlamaSpit,
1641 parent: AbstractEntityMetadataBundle,
1642}
1643impl Default for LlamaSpitMetadataBundle {
1644 fn default() -> Self {
1645 Self {
1646 _marker: LlamaSpit,
1647 parent: Default::default(),
1648 }
1649 }
1650}
1651
1652#[derive(Component)]
1670pub struct Marker;
1671impl Marker {
1672 fn apply_metadata(
1673 entity: &mut bevy_ecs::system::EntityCommands,
1674 d: EntityDataItem,
1675 ) -> Result<(), UpdateMetadataError> {
1676 match d.index {
1677 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1678 _ => {}
1679 }
1680 Ok(())
1681 }
1682}
1683
1684#[derive(Bundle)]
1688pub struct MarkerMetadataBundle {
1689 _marker: Marker,
1690 parent: AbstractEntityMetadataBundle,
1691}
1692impl Default for MarkerMetadataBundle {
1693 fn default() -> Self {
1694 Self {
1695 _marker: Marker,
1696 parent: Default::default(),
1697 }
1698 }
1699}
1700
1701#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1703pub struct OminousItemSpawnerItem(pub ItemStack);
1704#[derive(Component)]
1725pub struct OminousItemSpawner;
1726impl OminousItemSpawner {
1727 fn apply_metadata(
1728 entity: &mut bevy_ecs::system::EntityCommands,
1729 d: EntityDataItem,
1730 ) -> Result<(), UpdateMetadataError> {
1731 match d.index {
1732 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1733 8 => {
1734 entity.insert(OminousItemSpawnerItem(d.value.into_item_stack()?));
1735 }
1736 _ => {}
1737 }
1738 Ok(())
1739 }
1740}
1741
1742#[derive(Bundle)]
1746pub struct OminousItemSpawnerMetadataBundle {
1747 _marker: OminousItemSpawner,
1748 parent: AbstractEntityMetadataBundle,
1749 ominous_item_spawner_item: OminousItemSpawnerItem,
1750}
1751impl Default for OminousItemSpawnerMetadataBundle {
1752 fn default() -> Self {
1753 Self {
1754 _marker: OminousItemSpawner,
1755 parent: Default::default(),
1756 ominous_item_spawner_item: OminousItemSpawnerItem(Default::default()),
1757 }
1758 }
1759}
1760
1761#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1763pub struct PaintingDirection(pub Direction);
1764#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1766pub struct PaintingVariant(pub azalea_registry::data::PaintingVariant);
1767#[derive(Component)]
1789pub struct Painting;
1790impl Painting {
1791 fn apply_metadata(
1792 entity: &mut bevy_ecs::system::EntityCommands,
1793 d: EntityDataItem,
1794 ) -> Result<(), UpdateMetadataError> {
1795 match d.index {
1796 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1797 8 => {
1798 entity.insert(PaintingDirection(d.value.into_direction()?));
1799 }
1800 9 => {
1801 entity.insert(PaintingVariant(d.value.into_painting_variant()?));
1802 }
1803 _ => {}
1804 }
1805 Ok(())
1806 }
1807}
1808
1809#[derive(Bundle)]
1813pub struct PaintingMetadataBundle {
1814 _marker: Painting,
1815 parent: AbstractEntityMetadataBundle,
1816 painting_direction: PaintingDirection,
1817 painting_variant: PaintingVariant,
1818}
1819impl Default for PaintingMetadataBundle {
1820 fn default() -> Self {
1821 Self {
1822 _marker: Painting,
1823 parent: Default::default(),
1824 painting_direction: PaintingDirection(Default::default()),
1825 painting_variant: PaintingVariant(azalea_registry::data::PaintingVariant::new_raw(0)),
1826 }
1827 }
1828}
1829
1830#[derive(Component)]
1848pub struct ShulkerBullet;
1849impl ShulkerBullet {
1850 fn apply_metadata(
1851 entity: &mut bevy_ecs::system::EntityCommands,
1852 d: EntityDataItem,
1853 ) -> Result<(), UpdateMetadataError> {
1854 match d.index {
1855 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1856 _ => {}
1857 }
1858 Ok(())
1859 }
1860}
1861
1862#[derive(Bundle)]
1866pub struct ShulkerBulletMetadataBundle {
1867 _marker: ShulkerBullet,
1868 parent: AbstractEntityMetadataBundle,
1869}
1870impl Default for ShulkerBulletMetadataBundle {
1871 fn default() -> Self {
1872 Self {
1873 _marker: ShulkerBullet,
1874 parent: Default::default(),
1875 }
1876 }
1877}
1878
1879#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1881pub struct SmallFireballItemStack(pub ItemStack);
1882#[derive(Component)]
1903pub struct SmallFireball;
1904impl SmallFireball {
1905 fn apply_metadata(
1906 entity: &mut bevy_ecs::system::EntityCommands,
1907 d: EntityDataItem,
1908 ) -> Result<(), UpdateMetadataError> {
1909 match d.index {
1910 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1911 8 => {
1912 entity.insert(SmallFireballItemStack(d.value.into_item_stack()?));
1913 }
1914 _ => {}
1915 }
1916 Ok(())
1917 }
1918}
1919
1920#[derive(Bundle)]
1924pub struct SmallFireballMetadataBundle {
1925 _marker: SmallFireball,
1926 parent: AbstractEntityMetadataBundle,
1927 small_fireball_item_stack: SmallFireballItemStack,
1928}
1929impl Default for SmallFireballMetadataBundle {
1930 fn default() -> Self {
1931 Self {
1932 _marker: SmallFireball,
1933 parent: Default::default(),
1934 small_fireball_item_stack: SmallFireballItemStack(Default::default()),
1935 }
1936 }
1937}
1938
1939#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1941pub struct Fuse(pub i32);
1942#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1944pub struct TntBlockState(pub azalea_block::BlockState);
1945#[derive(Component)]
1966pub struct Tnt;
1967impl Tnt {
1968 fn apply_metadata(
1969 entity: &mut bevy_ecs::system::EntityCommands,
1970 d: EntityDataItem,
1971 ) -> Result<(), UpdateMetadataError> {
1972 match d.index {
1973 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1974 8 => {
1975 entity.insert(Fuse(d.value.into_int()?));
1976 }
1977 9 => {
1978 entity.insert(TntBlockState(d.value.into_block_state()?));
1979 }
1980 _ => {}
1981 }
1982 Ok(())
1983 }
1984}
1985
1986#[derive(Bundle)]
1990pub struct TntMetadataBundle {
1991 _marker: Tnt,
1992 parent: AbstractEntityMetadataBundle,
1993 fuse: Fuse,
1994 tnt_block_state: TntBlockState,
1995}
1996impl Default for TntMetadataBundle {
1997 fn default() -> Self {
1998 Self {
1999 _marker: Tnt,
2000 parent: Default::default(),
2001 fuse: Fuse(80),
2002 tnt_block_state: TntBlockState(Default::default()),
2003 }
2004 }
2005}
2006
2007#[derive(Component)]
2025pub struct WindCharge;
2026impl WindCharge {
2027 fn apply_metadata(
2028 entity: &mut bevy_ecs::system::EntityCommands,
2029 d: EntityDataItem,
2030 ) -> Result<(), UpdateMetadataError> {
2031 match d.index {
2032 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2033 _ => {}
2034 }
2035 Ok(())
2036 }
2037}
2038
2039#[derive(Bundle)]
2043pub struct WindChargeMetadataBundle {
2044 _marker: WindCharge,
2045 parent: AbstractEntityMetadataBundle,
2046}
2047impl Default for WindChargeMetadataBundle {
2048 fn default() -> Self {
2049 Self {
2050 _marker: WindCharge,
2051 parent: Default::default(),
2052 }
2053 }
2054}
2055
2056#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2058pub struct Dangerous(pub bool);
2059#[derive(Component)]
2080pub struct WitherSkull;
2081impl WitherSkull {
2082 fn apply_metadata(
2083 entity: &mut bevy_ecs::system::EntityCommands,
2084 d: EntityDataItem,
2085 ) -> Result<(), UpdateMetadataError> {
2086 match d.index {
2087 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2088 8 => {
2089 entity.insert(Dangerous(d.value.into_boolean()?));
2090 }
2091 _ => {}
2092 }
2093 Ok(())
2094 }
2095}
2096
2097#[derive(Bundle)]
2101pub struct WitherSkullMetadataBundle {
2102 _marker: WitherSkull,
2103 parent: AbstractEntityMetadataBundle,
2104 dangerous: Dangerous,
2105}
2106impl Default for WitherSkullMetadataBundle {
2107 fn default() -> Self {
2108 Self {
2109 _marker: WitherSkull,
2110 parent: Default::default(),
2111 dangerous: Dangerous(false),
2112 }
2113 }
2114}
2115
2116#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
2117pub struct CritArrow(pub bool);
2119#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
2120pub struct NoPhysics(pub bool);
2122#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2124pub struct PierceLevel(pub u8);
2125#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2127pub struct InGround(pub bool);
2128#[derive(Component)]
2154pub struct AbstractArrow;
2155impl AbstractArrow {
2156 fn apply_metadata(
2157 entity: &mut bevy_ecs::system::EntityCommands,
2158 d: EntityDataItem,
2159 ) -> Result<(), UpdateMetadataError> {
2160 match d.index {
2161 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2162 8 => {
2163 let bitfield = d.value.into_byte()?;
2164 entity.insert(CritArrow(bitfield & 0x1 != 0));
2165 entity.insert(NoPhysics(bitfield & 0x2 != 0));
2166 }
2167 9 => {
2168 entity.insert(PierceLevel(d.value.into_byte()?));
2169 }
2170 10 => {
2171 entity.insert(InGround(d.value.into_boolean()?));
2172 }
2173 _ => {}
2174 }
2175 Ok(())
2176 }
2177}
2178
2179#[derive(Bundle)]
2183pub struct AbstractArrowMetadataBundle {
2184 _marker: AbstractArrow,
2185 parent: AbstractEntityMetadataBundle,
2186 crit_arrow: CritArrow,
2187 no_physics: NoPhysics,
2188 pierce_level: PierceLevel,
2189 in_ground: InGround,
2190}
2191impl Default for AbstractArrowMetadataBundle {
2192 fn default() -> Self {
2193 Self {
2194 _marker: AbstractArrow,
2195 parent: Default::default(),
2196 crit_arrow: CritArrow(false),
2197 no_physics: NoPhysics(false),
2198 pierce_level: PierceLevel(0),
2199 in_ground: InGround(false),
2200 }
2201 }
2202}
2203
2204#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2206pub struct EffectColor(pub i32);
2207#[derive(Component)]
2228pub struct Arrow;
2229impl Arrow {
2230 fn apply_metadata(
2231 entity: &mut bevy_ecs::system::EntityCommands,
2232 d: EntityDataItem,
2233 ) -> Result<(), UpdateMetadataError> {
2234 match d.index {
2235 0..=10 => AbstractArrow::apply_metadata(entity, d)?,
2236 11 => {
2237 entity.insert(EffectColor(d.value.into_int()?));
2238 }
2239 _ => {}
2240 }
2241 Ok(())
2242 }
2243}
2244
2245#[derive(Bundle)]
2249pub struct ArrowMetadataBundle {
2250 _marker: Arrow,
2251 parent: AbstractArrowMetadataBundle,
2252 effect_color: EffectColor,
2253}
2254impl Default for ArrowMetadataBundle {
2255 fn default() -> Self {
2256 Self {
2257 _marker: Arrow,
2258 parent: Default::default(),
2259 effect_color: EffectColor(-1),
2260 }
2261 }
2262}
2263
2264#[derive(Component)]
2283pub struct SpectralArrow;
2284impl SpectralArrow {
2285 fn apply_metadata(
2286 entity: &mut bevy_ecs::system::EntityCommands,
2287 d: EntityDataItem,
2288 ) -> Result<(), UpdateMetadataError> {
2289 match d.index {
2290 0..=10 => AbstractArrow::apply_metadata(entity, d)?,
2291 _ => {}
2292 }
2293 Ok(())
2294 }
2295}
2296
2297#[derive(Bundle)]
2301pub struct SpectralArrowMetadataBundle {
2302 _marker: SpectralArrow,
2303 parent: AbstractArrowMetadataBundle,
2304}
2305impl Default for SpectralArrowMetadataBundle {
2306 fn default() -> Self {
2307 Self {
2308 _marker: SpectralArrow,
2309 parent: Default::default(),
2310 }
2311 }
2312}
2313
2314#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2316pub struct Loyalty(pub u8);
2317#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2319pub struct Foil(pub bool);
2320#[derive(Component)]
2342pub struct Trident;
2343impl Trident {
2344 fn apply_metadata(
2345 entity: &mut bevy_ecs::system::EntityCommands,
2346 d: EntityDataItem,
2347 ) -> Result<(), UpdateMetadataError> {
2348 match d.index {
2349 0..=10 => AbstractArrow::apply_metadata(entity, d)?,
2350 11 => {
2351 entity.insert(Loyalty(d.value.into_byte()?));
2352 }
2353 12 => {
2354 entity.insert(Foil(d.value.into_boolean()?));
2355 }
2356 _ => {}
2357 }
2358 Ok(())
2359 }
2360}
2361
2362#[derive(Bundle)]
2366pub struct TridentMetadataBundle {
2367 _marker: Trident,
2368 parent: AbstractArrowMetadataBundle,
2369 loyalty: Loyalty,
2370 foil: Foil,
2371}
2372impl Default for TridentMetadataBundle {
2373 fn default() -> Self {
2374 Self {
2375 _marker: Trident,
2376 parent: Default::default(),
2377 loyalty: Loyalty(0),
2378 foil: Foil(false),
2379 }
2380 }
2381}
2382
2383#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2385pub struct TransformationInterpolationStartDeltaTicks(pub i32);
2386#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2388pub struct TransformationInterpolationDuration(pub i32);
2389#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2391pub struct PosRotInterpolationDuration(pub i32);
2392#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2394pub struct Translation(pub Vec3f32);
2395#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2397pub struct Scale(pub Vec3f32);
2398#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2400pub struct LeftRotation(pub Quaternion);
2401#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2403pub struct RightRotation(pub Quaternion);
2404#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2406pub struct BillboardRenderConstraints(pub u8);
2407#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2409pub struct BrightnessOverride(pub i32);
2410#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2412pub struct ViewRange(pub f32);
2413#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2415pub struct ShadowRadius(pub f32);
2416#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2418pub struct ShadowStrength(pub f32);
2419#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2421pub struct AbstractDisplayWidth(pub f32);
2422#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2424pub struct AbstractDisplayHeight(pub f32);
2425#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2427pub struct GlowColorOverride(pub i32);
2428#[derive(Component)]
2465pub struct AbstractDisplay;
2466impl AbstractDisplay {
2467 fn apply_metadata(
2468 entity: &mut bevy_ecs::system::EntityCommands,
2469 d: EntityDataItem,
2470 ) -> Result<(), UpdateMetadataError> {
2471 match d.index {
2472 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2473 8 => {
2474 entity.insert(TransformationInterpolationStartDeltaTicks(
2475 d.value.into_int()?,
2476 ));
2477 }
2478 9 => {
2479 entity.insert(TransformationInterpolationDuration(d.value.into_int()?));
2480 }
2481 10 => {
2482 entity.insert(PosRotInterpolationDuration(d.value.into_int()?));
2483 }
2484 11 => {
2485 entity.insert(Translation(d.value.into_vector3()?));
2486 }
2487 12 => {
2488 entity.insert(Scale(d.value.into_vector3()?));
2489 }
2490 13 => {
2491 entity.insert(LeftRotation(d.value.into_quaternion()?));
2492 }
2493 14 => {
2494 entity.insert(RightRotation(d.value.into_quaternion()?));
2495 }
2496 15 => {
2497 entity.insert(BillboardRenderConstraints(d.value.into_byte()?));
2498 }
2499 16 => {
2500 entity.insert(BrightnessOverride(d.value.into_int()?));
2501 }
2502 17 => {
2503 entity.insert(ViewRange(d.value.into_float()?));
2504 }
2505 18 => {
2506 entity.insert(ShadowRadius(d.value.into_float()?));
2507 }
2508 19 => {
2509 entity.insert(ShadowStrength(d.value.into_float()?));
2510 }
2511 20 => {
2512 entity.insert(AbstractDisplayWidth(d.value.into_float()?));
2513 }
2514 21 => {
2515 entity.insert(AbstractDisplayHeight(d.value.into_float()?));
2516 }
2517 22 => {
2518 entity.insert(GlowColorOverride(d.value.into_int()?));
2519 }
2520 _ => {}
2521 }
2522 Ok(())
2523 }
2524}
2525
2526#[derive(Bundle)]
2530pub struct AbstractDisplayMetadataBundle {
2531 _marker: AbstractDisplay,
2532 parent: AbstractEntityMetadataBundle,
2533 transformation_interpolation_start_delta_ticks: TransformationInterpolationStartDeltaTicks,
2534 transformation_interpolation_duration: TransformationInterpolationDuration,
2535 pos_rot_interpolation_duration: PosRotInterpolationDuration,
2536 translation: Translation,
2537 scale: Scale,
2538 left_rotation: LeftRotation,
2539 right_rotation: RightRotation,
2540 billboard_render_constraints: BillboardRenderConstraints,
2541 brightness_override: BrightnessOverride,
2542 view_range: ViewRange,
2543 shadow_radius: ShadowRadius,
2544 shadow_strength: ShadowStrength,
2545 abstract_display_width: AbstractDisplayWidth,
2546 abstract_display_height: AbstractDisplayHeight,
2547 glow_color_override: GlowColorOverride,
2548}
2549impl Default for AbstractDisplayMetadataBundle {
2550 fn default() -> Self {
2551 Self {
2552 _marker: AbstractDisplay,
2553 parent: Default::default(),
2554 transformation_interpolation_start_delta_ticks:
2555 TransformationInterpolationStartDeltaTicks(0),
2556 transformation_interpolation_duration: TransformationInterpolationDuration(0),
2557 pos_rot_interpolation_duration: PosRotInterpolationDuration(0),
2558 translation: Translation(Vec3f32 {
2559 x: 0.0,
2560 y: 0.0,
2561 z: 0.0,
2562 }),
2563 scale: Scale(Vec3f32 {
2564 x: 1.0,
2565 y: 1.0,
2566 z: 1.0,
2567 }),
2568 left_rotation: LeftRotation(Quaternion {
2569 x: 0.0,
2570 y: 0.0,
2571 z: 0.0,
2572 w: 1.0,
2573 }),
2574 right_rotation: RightRotation(Quaternion {
2575 x: 0.0,
2576 y: 0.0,
2577 z: 0.0,
2578 w: 1.0,
2579 }),
2580 billboard_render_constraints: BillboardRenderConstraints(Default::default()),
2581 brightness_override: BrightnessOverride(-1),
2582 view_range: ViewRange(1.0),
2583 shadow_radius: ShadowRadius(0.0),
2584 shadow_strength: ShadowStrength(1.0),
2585 abstract_display_width: AbstractDisplayWidth(0.0),
2586 abstract_display_height: AbstractDisplayHeight(0.0),
2587 glow_color_override: GlowColorOverride(-1),
2588 }
2589 }
2590}
2591
2592#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2594pub struct BlockDisplayBlockState(pub azalea_block::BlockState);
2595#[derive(Component)]
2617pub struct BlockDisplay;
2618impl BlockDisplay {
2619 fn apply_metadata(
2620 entity: &mut bevy_ecs::system::EntityCommands,
2621 d: EntityDataItem,
2622 ) -> Result<(), UpdateMetadataError> {
2623 match d.index {
2624 0..=22 => AbstractDisplay::apply_metadata(entity, d)?,
2625 23 => {
2626 entity.insert(BlockDisplayBlockState(d.value.into_block_state()?));
2627 }
2628 _ => {}
2629 }
2630 Ok(())
2631 }
2632}
2633
2634#[derive(Bundle)]
2638pub struct BlockDisplayMetadataBundle {
2639 _marker: BlockDisplay,
2640 parent: AbstractDisplayMetadataBundle,
2641 block_display_block_state: BlockDisplayBlockState,
2642}
2643impl Default for BlockDisplayMetadataBundle {
2644 fn default() -> Self {
2645 Self {
2646 _marker: BlockDisplay,
2647 parent: Default::default(),
2648 block_display_block_state: BlockDisplayBlockState(Default::default()),
2649 }
2650 }
2651}
2652
2653#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2655pub struct ItemDisplayItemStack(pub ItemStack);
2656#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2658pub struct ItemDisplayItemDisplay(pub u8);
2659#[derive(Component)]
2682pub struct ItemDisplay;
2683impl ItemDisplay {
2684 fn apply_metadata(
2685 entity: &mut bevy_ecs::system::EntityCommands,
2686 d: EntityDataItem,
2687 ) -> Result<(), UpdateMetadataError> {
2688 match d.index {
2689 0..=22 => AbstractDisplay::apply_metadata(entity, d)?,
2690 23 => {
2691 entity.insert(ItemDisplayItemStack(d.value.into_item_stack()?));
2692 }
2693 24 => {
2694 entity.insert(ItemDisplayItemDisplay(d.value.into_byte()?));
2695 }
2696 _ => {}
2697 }
2698 Ok(())
2699 }
2700}
2701
2702#[derive(Bundle)]
2706pub struct ItemDisplayMetadataBundle {
2707 _marker: ItemDisplay,
2708 parent: AbstractDisplayMetadataBundle,
2709 item_display_item_stack: ItemDisplayItemStack,
2710 item_display_item_display: ItemDisplayItemDisplay,
2711}
2712impl Default for ItemDisplayMetadataBundle {
2713 fn default() -> Self {
2714 Self {
2715 _marker: ItemDisplay,
2716 parent: Default::default(),
2717 item_display_item_stack: ItemDisplayItemStack(Default::default()),
2718 item_display_item_display: ItemDisplayItemDisplay(Default::default()),
2719 }
2720 }
2721}
2722
2723#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2725pub struct Text(pub Box<FormattedText>);
2726#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2728pub struct LineWidth(pub i32);
2729#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2731pub struct BackgroundColor(pub i32);
2732#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2734pub struct TextOpacity(pub u8);
2735#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2737pub struct StyleFlags(pub u8);
2738#[derive(Component)]
2764pub struct TextDisplay;
2765impl TextDisplay {
2766 fn apply_metadata(
2767 entity: &mut bevy_ecs::system::EntityCommands,
2768 d: EntityDataItem,
2769 ) -> Result<(), UpdateMetadataError> {
2770 match d.index {
2771 0..=22 => AbstractDisplay::apply_metadata(entity, d)?,
2772 23 => {
2773 entity.insert(Text(d.value.into_formatted_text()?));
2774 }
2775 24 => {
2776 entity.insert(LineWidth(d.value.into_int()?));
2777 }
2778 25 => {
2779 entity.insert(BackgroundColor(d.value.into_int()?));
2780 }
2781 26 => {
2782 entity.insert(TextOpacity(d.value.into_byte()?));
2783 }
2784 27 => {
2785 entity.insert(StyleFlags(d.value.into_byte()?));
2786 }
2787 _ => {}
2788 }
2789 Ok(())
2790 }
2791}
2792
2793#[derive(Bundle)]
2797pub struct TextDisplayMetadataBundle {
2798 _marker: TextDisplay,
2799 parent: AbstractDisplayMetadataBundle,
2800 text: Text,
2801 line_width: LineWidth,
2802 background_color: BackgroundColor,
2803 text_opacity: TextOpacity,
2804 style_flags: StyleFlags,
2805}
2806impl Default for TextDisplayMetadataBundle {
2807 fn default() -> Self {
2808 Self {
2809 _marker: TextDisplay,
2810 parent: Default::default(),
2811 text: Text(Default::default()),
2812 line_width: LineWidth(200),
2813 background_color: BackgroundColor(1073741824),
2814 text_opacity: TextOpacity(127),
2815 style_flags: StyleFlags(0),
2816 }
2817 }
2818}
2819
2820#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
2821pub struct AutoSpinAttack(pub bool);
2823#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
2824pub struct AbstractLivingUsingItem(pub bool);
2826#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2828pub struct Health(pub f32);
2829#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2831pub struct EffectParticles(pub Box<[Particle]>);
2832#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2834pub struct EffectAmbience(pub bool);
2835#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2837pub struct ArrowCount(pub i32);
2838#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2840pub struct StingerCount(pub i32);
2841#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2843pub struct SleepingPos(pub Option<BlockPos>);
2844#[derive(Component)]
2979pub struct AbstractLiving;
2980impl AbstractLiving {
2981 fn apply_metadata(
2982 entity: &mut bevy_ecs::system::EntityCommands,
2983 d: EntityDataItem,
2984 ) -> Result<(), UpdateMetadataError> {
2985 match d.index {
2986 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2987 8 => {
2988 let bitfield = d.value.into_byte()?;
2989 entity.insert(AutoSpinAttack(bitfield & 0x4 != 0));
2990 entity.insert(AbstractLivingUsingItem(bitfield & 0x1 != 0));
2991 }
2992 9 => {
2993 entity.insert(Health(d.value.into_float()?));
2994 }
2995 10 => {
2996 entity.insert(EffectParticles(d.value.into_particles()?));
2997 }
2998 11 => {
2999 entity.insert(EffectAmbience(d.value.into_boolean()?));
3000 }
3001 12 => {
3002 entity.insert(ArrowCount(d.value.into_int()?));
3003 }
3004 13 => {
3005 entity.insert(StingerCount(d.value.into_int()?));
3006 }
3007 14 => {
3008 entity.insert(SleepingPos(d.value.into_optional_block_pos()?));
3009 }
3010 _ => {}
3011 }
3012 Ok(())
3013 }
3014}
3015
3016#[derive(Bundle)]
3020pub struct AbstractLivingMetadataBundle {
3021 _marker: AbstractLiving,
3022 parent: AbstractEntityMetadataBundle,
3023 auto_spin_attack: AutoSpinAttack,
3024 abstract_living_using_item: AbstractLivingUsingItem,
3025 health: Health,
3026 effect_particles: EffectParticles,
3027 effect_ambience: EffectAmbience,
3028 arrow_count: ArrowCount,
3029 stinger_count: StingerCount,
3030 sleeping_pos: SleepingPos,
3031}
3032impl Default for AbstractLivingMetadataBundle {
3033 fn default() -> Self {
3034 Self {
3035 _marker: AbstractLiving,
3036 parent: Default::default(),
3037 auto_spin_attack: AutoSpinAttack(false),
3038 abstract_living_using_item: AbstractLivingUsingItem(false),
3039 health: Health(1.0),
3040 effect_particles: EffectParticles(Default::default()),
3041 effect_ambience: EffectAmbience(false),
3042 arrow_count: ArrowCount(0),
3043 stinger_count: StingerCount(0),
3044 sleeping_pos: SleepingPos(None),
3045 }
3046 }
3047}
3048
3049#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3050pub struct Small(pub bool);
3052#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3053pub struct ShowArms(pub bool);
3055#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3056pub struct ShowBasePlate(pub bool);
3058#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3059pub struct ArmorStandMarker(pub bool);
3061#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3063pub struct HeadPose(pub Rotations);
3064#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3066pub struct BodyPose(pub Rotations);
3067#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3069pub struct LeftArmPose(pub Rotations);
3070#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3072pub struct RightArmPose(pub Rotations);
3073#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3075pub struct LeftLegPose(pub Rotations);
3076#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3078pub struct RightLegPose(pub Rotations);
3079#[derive(Component)]
3110pub struct ArmorStand;
3111impl ArmorStand {
3112 fn apply_metadata(
3113 entity: &mut bevy_ecs::system::EntityCommands,
3114 d: EntityDataItem,
3115 ) -> Result<(), UpdateMetadataError> {
3116 match d.index {
3117 0..=14 => AbstractLiving::apply_metadata(entity, d)?,
3118 15 => {
3119 let bitfield = d.value.into_byte()?;
3120 entity.insert(Small(bitfield & 0x1 != 0));
3121 entity.insert(ShowArms(bitfield & 0x4 != 0));
3122 entity.insert(ShowBasePlate(bitfield & 0x8 != 0));
3123 entity.insert(ArmorStandMarker(bitfield & 0x10 != 0));
3124 }
3125 16 => {
3126 entity.insert(HeadPose(d.value.into_rotations()?));
3127 }
3128 17 => {
3129 entity.insert(BodyPose(d.value.into_rotations()?));
3130 }
3131 18 => {
3132 entity.insert(LeftArmPose(d.value.into_rotations()?));
3133 }
3134 19 => {
3135 entity.insert(RightArmPose(d.value.into_rotations()?));
3136 }
3137 20 => {
3138 entity.insert(LeftLegPose(d.value.into_rotations()?));
3139 }
3140 21 => {
3141 entity.insert(RightLegPose(d.value.into_rotations()?));
3142 }
3143 _ => {}
3144 }
3145 Ok(())
3146 }
3147}
3148
3149#[derive(Bundle)]
3153pub struct ArmorStandMetadataBundle {
3154 _marker: ArmorStand,
3155 parent: AbstractLivingMetadataBundle,
3156 small: Small,
3157 show_arms: ShowArms,
3158 show_base_plate: ShowBasePlate,
3159 armor_stand_marker: ArmorStandMarker,
3160 head_pose: HeadPose,
3161 body_pose: BodyPose,
3162 left_arm_pose: LeftArmPose,
3163 right_arm_pose: RightArmPose,
3164 left_leg_pose: LeftLegPose,
3165 right_leg_pose: RightLegPose,
3166}
3167impl Default for ArmorStandMetadataBundle {
3168 fn default() -> Self {
3169 Self {
3170 _marker: ArmorStand,
3171 parent: Default::default(),
3172 small: Small(false),
3173 show_arms: ShowArms(false),
3174 show_base_plate: ShowBasePlate(false),
3175 armor_stand_marker: ArmorStandMarker(false),
3176 head_pose: HeadPose(Default::default()),
3177 body_pose: BodyPose(Default::default()),
3178 left_arm_pose: LeftArmPose(Default::default()),
3179 right_arm_pose: RightArmPose(Default::default()),
3180 left_leg_pose: LeftLegPose(Default::default()),
3181 right_leg_pose: RightLegPose(Default::default()),
3182 }
3183 }
3184}
3185
3186#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3188pub struct PlayerMainHand(pub HumanoidArm);
3189#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3191pub struct PlayerModeCustomisation(pub u8);
3192#[derive(Component)]
3216pub struct AbstractAvatar;
3217impl AbstractAvatar {
3218 fn apply_metadata(
3219 entity: &mut bevy_ecs::system::EntityCommands,
3220 d: EntityDataItem,
3221 ) -> Result<(), UpdateMetadataError> {
3222 match d.index {
3223 0..=14 => AbstractLiving::apply_metadata(entity, d)?,
3224 15 => {
3225 entity.insert(PlayerMainHand(d.value.into_humanoid_arm()?));
3226 }
3227 16 => {
3228 entity.insert(PlayerModeCustomisation(d.value.into_byte()?));
3229 }
3230 _ => {}
3231 }
3232 Ok(())
3233 }
3234}
3235
3236#[derive(Bundle)]
3240pub struct AbstractAvatarMetadataBundle {
3241 _marker: AbstractAvatar,
3242 parent: AbstractLivingMetadataBundle,
3243 player_main_hand: PlayerMainHand,
3244 player_mode_customisation: PlayerModeCustomisation,
3245}
3246impl Default for AbstractAvatarMetadataBundle {
3247 fn default() -> Self {
3248 Self {
3249 _marker: AbstractAvatar,
3250 parent: Default::default(),
3251 player_main_hand: PlayerMainHand(Default::default()),
3252 player_mode_customisation: PlayerModeCustomisation(0),
3253 }
3254 }
3255}
3256
3257#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3259pub struct Profile(pub components::Profile);
3260#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3262pub struct Immovable(pub bool);
3263#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3265pub struct Description(pub Option<Box<FormattedText>>);
3266#[derive(Component)]
3291pub struct Mannequin;
3292impl Mannequin {
3293 fn apply_metadata(
3294 entity: &mut bevy_ecs::system::EntityCommands,
3295 d: EntityDataItem,
3296 ) -> Result<(), UpdateMetadataError> {
3297 match d.index {
3298 0..=16 => AbstractAvatar::apply_metadata(entity, d)?,
3299 17 => {
3300 entity.insert(Profile(d.value.into_resolvable_profile()?));
3301 }
3302 18 => {
3303 entity.insert(Immovable(d.value.into_boolean()?));
3304 }
3305 19 => {
3306 entity.insert(Description(d.value.into_optional_formatted_text()?));
3307 }
3308 _ => {}
3309 }
3310 Ok(())
3311 }
3312}
3313
3314#[derive(Bundle)]
3318pub struct MannequinMetadataBundle {
3319 _marker: Mannequin,
3320 parent: AbstractAvatarMetadataBundle,
3321 profile: Profile,
3322 immovable: Immovable,
3323 description: Description,
3324}
3325impl Default for MannequinMetadataBundle {
3326 fn default() -> Self {
3327 Self {
3328 _marker: Mannequin,
3329 parent: Default::default(),
3330 profile: Profile(Default::default()),
3331 immovable: Immovable(false),
3332 description: Description(Default::default()),
3333 }
3334 }
3335}
3336
3337#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3339pub struct PlayerAbsorption(pub f32);
3340#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3342pub struct Score(pub i32);
3343#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3345pub struct ShoulderParrotLeft(pub OptionalUnsignedInt);
3346#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3348pub struct ShoulderParrotRight(pub OptionalUnsignedInt);
3349#[derive(Component)]
3374pub struct Player;
3375impl Player {
3376 fn apply_metadata(
3377 entity: &mut bevy_ecs::system::EntityCommands,
3378 d: EntityDataItem,
3379 ) -> Result<(), UpdateMetadataError> {
3380 match d.index {
3381 0..=16 => AbstractAvatar::apply_metadata(entity, d)?,
3382 17 => {
3383 entity.insert(PlayerAbsorption(d.value.into_float()?));
3384 }
3385 18 => {
3386 entity.insert(Score(d.value.into_int()?));
3387 }
3388 19 => {
3389 entity.insert(ShoulderParrotLeft(d.value.into_optional_unsigned_int()?));
3390 }
3391 20 => {
3392 entity.insert(ShoulderParrotRight(d.value.into_optional_unsigned_int()?));
3393 }
3394 _ => {}
3395 }
3396 Ok(())
3397 }
3398}
3399
3400#[derive(Bundle)]
3404pub struct PlayerMetadataBundle {
3405 _marker: Player,
3406 parent: AbstractAvatarMetadataBundle,
3407 player_absorption: PlayerAbsorption,
3408 score: Score,
3409 shoulder_parrot_left: ShoulderParrotLeft,
3410 shoulder_parrot_right: ShoulderParrotRight,
3411}
3412impl Default for PlayerMetadataBundle {
3413 fn default() -> Self {
3414 Self {
3415 _marker: Player,
3416 parent: Default::default(),
3417 player_absorption: PlayerAbsorption(0.0),
3418 score: Score(0),
3419 shoulder_parrot_left: ShoulderParrotLeft(OptionalUnsignedInt(None)),
3420 shoulder_parrot_right: ShoulderParrotRight(OptionalUnsignedInt(None)),
3421 }
3422 }
3423}
3424
3425#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3426pub struct NoAi(pub bool);
3428#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3429pub struct LeftHanded(pub bool);
3431#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3432pub struct Aggressive(pub bool);
3434#[derive(Component)]
3560pub struct AbstractInsentient;
3561impl AbstractInsentient {
3562 fn apply_metadata(
3563 entity: &mut bevy_ecs::system::EntityCommands,
3564 d: EntityDataItem,
3565 ) -> Result<(), UpdateMetadataError> {
3566 match d.index {
3567 0..=14 => AbstractLiving::apply_metadata(entity, d)?,
3568 15 => {
3569 let bitfield = d.value.into_byte()?;
3570 entity.insert(NoAi(bitfield & 0x1 != 0));
3571 entity.insert(LeftHanded(bitfield & 0x2 != 0));
3572 entity.insert(Aggressive(bitfield & 0x4 != 0));
3573 }
3574 _ => {}
3575 }
3576 Ok(())
3577 }
3578}
3579
3580#[derive(Bundle)]
3584pub struct AbstractInsentientMetadataBundle {
3585 _marker: AbstractInsentient,
3586 parent: AbstractLivingMetadataBundle,
3587 no_ai: NoAi,
3588 left_handed: LeftHanded,
3589 aggressive: Aggressive,
3590}
3591impl Default for AbstractInsentientMetadataBundle {
3592 fn default() -> Self {
3593 Self {
3594 _marker: AbstractInsentient,
3595 parent: Default::default(),
3596 no_ai: NoAi(false),
3597 left_handed: LeftHanded(false),
3598 aggressive: Aggressive(false),
3599 }
3600 }
3601}
3602
3603#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3604pub struct Resting(pub bool);
3606#[derive(Component)]
3628pub struct Bat;
3629impl Bat {
3630 fn apply_metadata(
3631 entity: &mut bevy_ecs::system::EntityCommands,
3632 d: EntityDataItem,
3633 ) -> Result<(), UpdateMetadataError> {
3634 match d.index {
3635 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
3636 16 => {
3637 let bitfield = d.value.into_byte()?;
3638 entity.insert(Resting(bitfield & 0x1 != 0));
3639 }
3640 _ => {}
3641 }
3642 Ok(())
3643 }
3644}
3645
3646#[derive(Bundle)]
3650pub struct BatMetadataBundle {
3651 _marker: Bat,
3652 parent: AbstractInsentientMetadataBundle,
3653 resting: Resting,
3654}
3655impl Default for BatMetadataBundle {
3656 fn default() -> Self {
3657 Self {
3658 _marker: Bat,
3659 parent: Default::default(),
3660 resting: Resting(false),
3661 }
3662 }
3663}
3664
3665#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3667pub struct Phase(pub i32);
3668#[derive(Component)]
3691pub struct EnderDragon;
3692impl EnderDragon {
3693 fn apply_metadata(
3694 entity: &mut bevy_ecs::system::EntityCommands,
3695 d: EntityDataItem,
3696 ) -> Result<(), UpdateMetadataError> {
3697 match d.index {
3698 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
3699 16 => {
3700 entity.insert(Phase(d.value.into_int()?));
3701 }
3702 _ => {}
3703 }
3704 Ok(())
3705 }
3706}
3707
3708#[derive(Bundle)]
3712pub struct EnderDragonMetadataBundle {
3713 _marker: EnderDragon,
3714 parent: AbstractInsentientMetadataBundle,
3715 phase: Phase,
3716}
3717impl Default for EnderDragonMetadataBundle {
3718 fn default() -> Self {
3719 Self {
3720 _marker: EnderDragon,
3721 parent: Default::default(),
3722 phase: Phase(Default::default()),
3723 }
3724 }
3725}
3726
3727#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3729pub struct IsCharging(pub bool);
3730#[derive(Component)]
3752pub struct Ghast;
3753impl Ghast {
3754 fn apply_metadata(
3755 entity: &mut bevy_ecs::system::EntityCommands,
3756 d: EntityDataItem,
3757 ) -> Result<(), UpdateMetadataError> {
3758 match d.index {
3759 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
3760 16 => {
3761 entity.insert(IsCharging(d.value.into_boolean()?));
3762 }
3763 _ => {}
3764 }
3765 Ok(())
3766 }
3767}
3768
3769#[derive(Bundle)]
3773pub struct GhastMetadataBundle {
3774 _marker: Ghast,
3775 parent: AbstractInsentientMetadataBundle,
3776 is_charging: IsCharging,
3777}
3778impl Default for GhastMetadataBundle {
3779 fn default() -> Self {
3780 Self {
3781 _marker: Ghast,
3782 parent: Default::default(),
3783 is_charging: IsCharging(false),
3784 }
3785 }
3786}
3787
3788#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3790pub struct PhantomSize(pub i32);
3791#[derive(Component)]
3813pub struct Phantom;
3814impl Phantom {
3815 fn apply_metadata(
3816 entity: &mut bevy_ecs::system::EntityCommands,
3817 d: EntityDataItem,
3818 ) -> Result<(), UpdateMetadataError> {
3819 match d.index {
3820 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
3821 16 => {
3822 entity.insert(PhantomSize(d.value.into_int()?));
3823 }
3824 _ => {}
3825 }
3826 Ok(())
3827 }
3828}
3829
3830#[derive(Bundle)]
3834pub struct PhantomMetadataBundle {
3835 _marker: Phantom,
3836 parent: AbstractInsentientMetadataBundle,
3837 phantom_size: PhantomSize,
3838}
3839impl Default for PhantomMetadataBundle {
3840 fn default() -> Self {
3841 Self {
3842 _marker: Phantom,
3843 parent: Default::default(),
3844 phantom_size: PhantomSize(0),
3845 }
3846 }
3847}
3848
3849#[derive(Component)]
3966pub struct AbstractCreature;
3967impl AbstractCreature {
3968 fn apply_metadata(
3969 entity: &mut bevy_ecs::system::EntityCommands,
3970 d: EntityDataItem,
3971 ) -> Result<(), UpdateMetadataError> {
3972 match d.index {
3973 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
3974 _ => {}
3975 }
3976 Ok(())
3977 }
3978}
3979
3980#[derive(Bundle)]
3984pub struct AbstractCreatureMetadataBundle {
3985 _marker: AbstractCreature,
3986 parent: AbstractInsentientMetadataBundle,
3987}
3988impl Default for AbstractCreatureMetadataBundle {
3989 fn default() -> Self {
3990 Self {
3991 _marker: AbstractCreature,
3992 parent: Default::default(),
3993 }
3994 }
3995}
3996
3997#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3999pub struct Dancing(pub bool);
4000#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4002pub struct CanDuplicate(pub bool);
4003#[derive(Component)]
4027pub struct Allay;
4028impl Allay {
4029 fn apply_metadata(
4030 entity: &mut bevy_ecs::system::EntityCommands,
4031 d: EntityDataItem,
4032 ) -> Result<(), UpdateMetadataError> {
4033 match d.index {
4034 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4035 16 => {
4036 entity.insert(Dancing(d.value.into_boolean()?));
4037 }
4038 17 => {
4039 entity.insert(CanDuplicate(d.value.into_boolean()?));
4040 }
4041 _ => {}
4042 }
4043 Ok(())
4044 }
4045}
4046
4047#[derive(Bundle)]
4051pub struct AllayMetadataBundle {
4052 _marker: Allay,
4053 parent: AbstractCreatureMetadataBundle,
4054 dancing: Dancing,
4055 can_duplicate: CanDuplicate,
4056}
4057impl Default for AllayMetadataBundle {
4058 fn default() -> Self {
4059 Self {
4060 _marker: Allay,
4061 parent: Default::default(),
4062 dancing: Dancing(false),
4063 can_duplicate: CanDuplicate(true),
4064 }
4065 }
4066}
4067
4068#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4070pub struct WeatherState(pub WeatheringCopperStateKind);
4071#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4073pub struct CopperGolemState(pub CopperGolemStateKind);
4074#[derive(Component)]
4099pub struct CopperGolem;
4100impl CopperGolem {
4101 fn apply_metadata(
4102 entity: &mut bevy_ecs::system::EntityCommands,
4103 d: EntityDataItem,
4104 ) -> Result<(), UpdateMetadataError> {
4105 match d.index {
4106 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4107 16 => {
4108 entity.insert(WeatherState(d.value.into_weathering_copper_state()?));
4109 }
4110 17 => {
4111 entity.insert(CopperGolemState(d.value.into_copper_golem_state()?));
4112 }
4113 _ => {}
4114 }
4115 Ok(())
4116 }
4117}
4118
4119#[derive(Bundle)]
4123pub struct CopperGolemMetadataBundle {
4124 _marker: CopperGolem,
4125 parent: AbstractCreatureMetadataBundle,
4126 weather_state: WeatherState,
4127 copper_golem_state: CopperGolemState,
4128}
4129impl Default for CopperGolemMetadataBundle {
4130 fn default() -> Self {
4131 Self {
4132 _marker: CopperGolem,
4133 parent: Default::default(),
4134 weather_state: WeatherState(Default::default()),
4135 copper_golem_state: CopperGolemState(Default::default()),
4136 }
4137 }
4138}
4139
4140#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
4141pub struct PlayerCreated(pub bool);
4143#[derive(Component)]
4167pub struct IronGolem;
4168impl IronGolem {
4169 fn apply_metadata(
4170 entity: &mut bevy_ecs::system::EntityCommands,
4171 d: EntityDataItem,
4172 ) -> Result<(), UpdateMetadataError> {
4173 match d.index {
4174 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4175 16 => {
4176 let bitfield = d.value.into_byte()?;
4177 entity.insert(PlayerCreated(bitfield & 0x1 != 0));
4178 }
4179 _ => {}
4180 }
4181 Ok(())
4182 }
4183}
4184
4185#[derive(Bundle)]
4189pub struct IronGolemMetadataBundle {
4190 _marker: IronGolem,
4191 parent: AbstractCreatureMetadataBundle,
4192 player_created: PlayerCreated,
4193}
4194impl Default for IronGolemMetadataBundle {
4195 fn default() -> Self {
4196 Self {
4197 _marker: IronGolem,
4198 parent: Default::default(),
4199 player_created: PlayerCreated(false),
4200 }
4201 }
4202}
4203
4204#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4206pub struct PufferfishFromBucket(pub bool);
4207#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4209pub struct PuffState(pub i32);
4210#[derive(Component)]
4235pub struct Pufferfish;
4236impl Pufferfish {
4237 fn apply_metadata(
4238 entity: &mut bevy_ecs::system::EntityCommands,
4239 d: EntityDataItem,
4240 ) -> Result<(), UpdateMetadataError> {
4241 match d.index {
4242 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4243 16 => {
4244 entity.insert(PufferfishFromBucket(d.value.into_boolean()?));
4245 }
4246 17 => {
4247 entity.insert(PuffState(d.value.into_int()?));
4248 }
4249 _ => {}
4250 }
4251 Ok(())
4252 }
4253}
4254
4255#[derive(Bundle)]
4259pub struct PufferfishMetadataBundle {
4260 _marker: Pufferfish,
4261 parent: AbstractCreatureMetadataBundle,
4262 pufferfish_from_bucket: PufferfishFromBucket,
4263 puff_state: PuffState,
4264}
4265impl Default for PufferfishMetadataBundle {
4266 fn default() -> Self {
4267 Self {
4268 _marker: Pufferfish,
4269 parent: Default::default(),
4270 pufferfish_from_bucket: PufferfishFromBucket(false),
4271 puff_state: PuffState(0),
4272 }
4273 }
4274}
4275
4276#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4278pub struct AttachFace(pub Direction);
4279#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4281pub struct Peek(pub u8);
4282#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4284pub struct Color(pub u8);
4285#[derive(Component)]
4310pub struct Shulker;
4311impl Shulker {
4312 fn apply_metadata(
4313 entity: &mut bevy_ecs::system::EntityCommands,
4314 d: EntityDataItem,
4315 ) -> Result<(), UpdateMetadataError> {
4316 match d.index {
4317 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4318 16 => {
4319 entity.insert(AttachFace(d.value.into_direction()?));
4320 }
4321 17 => {
4322 entity.insert(Peek(d.value.into_byte()?));
4323 }
4324 18 => {
4325 entity.insert(Color(d.value.into_byte()?));
4326 }
4327 _ => {}
4328 }
4329 Ok(())
4330 }
4331}
4332
4333#[derive(Bundle)]
4337pub struct ShulkerMetadataBundle {
4338 _marker: Shulker,
4339 parent: AbstractCreatureMetadataBundle,
4340 attach_face: AttachFace,
4341 peek: Peek,
4342 color: Color,
4343}
4344impl Default for ShulkerMetadataBundle {
4345 fn default() -> Self {
4346 Self {
4347 _marker: Shulker,
4348 parent: Default::default(),
4349 attach_face: AttachFace(Default::default()),
4350 peek: Peek(0),
4351 color: Color(16),
4352 }
4353 }
4354}
4355
4356#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
4357pub struct HasPumpkin(pub bool);
4359#[derive(Component)]
4383pub struct SnowGolem;
4384impl SnowGolem {
4385 fn apply_metadata(
4386 entity: &mut bevy_ecs::system::EntityCommands,
4387 d: EntityDataItem,
4388 ) -> Result<(), UpdateMetadataError> {
4389 match d.index {
4390 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4391 16 => {
4392 let bitfield = d.value.into_byte()?;
4393 entity.insert(HasPumpkin(bitfield & 0x10 != 0));
4394 }
4395 _ => {}
4396 }
4397 Ok(())
4398 }
4399}
4400
4401#[derive(Bundle)]
4405pub struct SnowGolemMetadataBundle {
4406 _marker: SnowGolem,
4407 parent: AbstractCreatureMetadataBundle,
4408 has_pumpkin: HasPumpkin,
4409}
4410impl Default for SnowGolemMetadataBundle {
4411 fn default() -> Self {
4412 Self {
4413 _marker: SnowGolem,
4414 parent: Default::default(),
4415 has_pumpkin: HasPumpkin(true),
4416 }
4417 }
4418}
4419
4420#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4422pub struct TadpoleFromBucket(pub bool);
4423#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4425pub struct TadpoleAgeLocked(pub bool);
4426#[derive(Component)]
4450pub struct Tadpole;
4451impl Tadpole {
4452 fn apply_metadata(
4453 entity: &mut bevy_ecs::system::EntityCommands,
4454 d: EntityDataItem,
4455 ) -> Result<(), UpdateMetadataError> {
4456 match d.index {
4457 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4458 16 => {
4459 entity.insert(TadpoleFromBucket(d.value.into_boolean()?));
4460 }
4461 17 => {
4462 entity.insert(TadpoleAgeLocked(d.value.into_boolean()?));
4463 }
4464 _ => {}
4465 }
4466 Ok(())
4467 }
4468}
4469
4470#[derive(Bundle)]
4474pub struct TadpoleMetadataBundle {
4475 _marker: Tadpole,
4476 parent: AbstractCreatureMetadataBundle,
4477 tadpole_from_bucket: TadpoleFromBucket,
4478 tadpole_age_locked: TadpoleAgeLocked,
4479}
4480impl Default for TadpoleMetadataBundle {
4481 fn default() -> Self {
4482 Self {
4483 _marker: Tadpole,
4484 parent: Default::default(),
4485 tadpole_from_bucket: TadpoleFromBucket(false),
4486 tadpole_age_locked: TadpoleAgeLocked(false),
4487 }
4488 }
4489}
4490
4491#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4493pub struct AbstractAgeableBaby(pub bool);
4494#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4496pub struct AbstractAgeableAgeLocked(pub bool);
4497#[derive(Component)]
4569pub struct AbstractAgeable;
4570impl AbstractAgeable {
4571 fn apply_metadata(
4572 entity: &mut bevy_ecs::system::EntityCommands,
4573 d: EntityDataItem,
4574 ) -> Result<(), UpdateMetadataError> {
4575 match d.index {
4576 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4577 16 => {
4578 entity.insert(AbstractAgeableBaby(d.value.into_boolean()?));
4579 }
4580 17 => {
4581 entity.insert(AbstractAgeableAgeLocked(d.value.into_boolean()?));
4582 }
4583 _ => {}
4584 }
4585 Ok(())
4586 }
4587}
4588
4589#[derive(Bundle)]
4593pub struct AbstractAgeableMetadataBundle {
4594 _marker: AbstractAgeable,
4595 parent: AbstractCreatureMetadataBundle,
4596 abstract_ageable_baby: AbstractAgeableBaby,
4597 abstract_ageable_age_locked: AbstractAgeableAgeLocked,
4598}
4599impl Default for AbstractAgeableMetadataBundle {
4600 fn default() -> Self {
4601 Self {
4602 _marker: AbstractAgeable,
4603 parent: Default::default(),
4604 abstract_ageable_baby: AbstractAgeableBaby(false),
4605 abstract_ageable_age_locked: AbstractAgeableAgeLocked(false),
4606 }
4607 }
4608}
4609
4610#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4612pub struct GotFish(pub bool);
4613#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4615pub struct MoistnessLevel(pub i32);
4616#[derive(Component)]
4641pub struct Dolphin;
4642impl Dolphin {
4643 fn apply_metadata(
4644 entity: &mut bevy_ecs::system::EntityCommands,
4645 d: EntityDataItem,
4646 ) -> Result<(), UpdateMetadataError> {
4647 match d.index {
4648 0..=17 => AbstractAgeable::apply_metadata(entity, d)?,
4649 18 => {
4650 entity.insert(GotFish(d.value.into_boolean()?));
4651 }
4652 19 => {
4653 entity.insert(MoistnessLevel(d.value.into_int()?));
4654 }
4655 _ => {}
4656 }
4657 Ok(())
4658 }
4659}
4660
4661#[derive(Bundle)]
4665pub struct DolphinMetadataBundle {
4666 _marker: Dolphin,
4667 parent: AbstractAgeableMetadataBundle,
4668 got_fish: GotFish,
4669 moistness_level: MoistnessLevel,
4670}
4671impl Default for DolphinMetadataBundle {
4672 fn default() -> Self {
4673 Self {
4674 _marker: Dolphin,
4675 parent: Default::default(),
4676 got_fish: GotFish(false),
4677 moistness_level: MoistnessLevel(2400),
4678 }
4679 }
4680}
4681
4682#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4684pub struct MagmaCubeSize(pub i32);
4685#[derive(Component)]
4710pub struct MagmaCube;
4711impl MagmaCube {
4712 fn apply_metadata(
4713 entity: &mut bevy_ecs::system::EntityCommands,
4714 d: EntityDataItem,
4715 ) -> Result<(), UpdateMetadataError> {
4716 match d.index {
4717 0..=17 => AbstractAgeable::apply_metadata(entity, d)?,
4718 18 => {
4719 entity.insert(MagmaCubeSize(d.value.into_int()?));
4720 }
4721 _ => {}
4722 }
4723 Ok(())
4724 }
4725}
4726
4727#[derive(Bundle)]
4731pub struct MagmaCubeMetadataBundle {
4732 _marker: MagmaCube,
4733 parent: AbstractAgeableMetadataBundle,
4734 magma_cube_size: MagmaCubeSize,
4735}
4736impl Default for MagmaCubeMetadataBundle {
4737 fn default() -> Self {
4738 Self {
4739 _marker: MagmaCube,
4740 parent: Default::default(),
4741 magma_cube_size: MagmaCubeSize(1),
4742 }
4743 }
4744}
4745
4746#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4748pub struct SlimeSize(pub i32);
4749#[derive(Component)]
4773pub struct Slime;
4774impl Slime {
4775 fn apply_metadata(
4776 entity: &mut bevy_ecs::system::EntityCommands,
4777 d: EntityDataItem,
4778 ) -> Result<(), UpdateMetadataError> {
4779 match d.index {
4780 0..=17 => AbstractAgeable::apply_metadata(entity, d)?,
4781 18 => {
4782 entity.insert(SlimeSize(d.value.into_int()?));
4783 }
4784 _ => {}
4785 }
4786 Ok(())
4787 }
4788}
4789
4790#[derive(Bundle)]
4794pub struct SlimeMetadataBundle {
4795 _marker: Slime,
4796 parent: AbstractAgeableMetadataBundle,
4797 slime_size: SlimeSize,
4798}
4799impl Default for SlimeMetadataBundle {
4800 fn default() -> Self {
4801 Self {
4802 _marker: Slime,
4803 parent: Default::default(),
4804 slime_size: SlimeSize(1),
4805 }
4806 }
4807}
4808
4809#[derive(Component)]
4831pub struct Squid;
4832impl Squid {
4833 fn apply_metadata(
4834 entity: &mut bevy_ecs::system::EntityCommands,
4835 d: EntityDataItem,
4836 ) -> Result<(), UpdateMetadataError> {
4837 match d.index {
4838 0..=17 => AbstractAgeable::apply_metadata(entity, d)?,
4839 _ => {}
4840 }
4841 Ok(())
4842 }
4843}
4844
4845#[derive(Bundle)]
4849pub struct SquidMetadataBundle {
4850 _marker: Squid,
4851 parent: AbstractAgeableMetadataBundle,
4852}
4853impl Default for SquidMetadataBundle {
4854 fn default() -> Self {
4855 Self {
4856 _marker: Squid,
4857 parent: Default::default(),
4858 }
4859 }
4860}
4861
4862#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4864pub struct DarkTicksRemaining(pub i32);
4865#[derive(Component)]
4891pub struct GlowSquid;
4892impl GlowSquid {
4893 fn apply_metadata(
4894 entity: &mut bevy_ecs::system::EntityCommands,
4895 d: EntityDataItem,
4896 ) -> Result<(), UpdateMetadataError> {
4897 match d.index {
4898 0..=17 => Squid::apply_metadata(entity, d)?,
4899 18 => {
4900 entity.insert(DarkTicksRemaining(d.value.into_int()?));
4901 }
4902 _ => {}
4903 }
4904 Ok(())
4905 }
4906}
4907
4908#[derive(Bundle)]
4912pub struct GlowSquidMetadataBundle {
4913 _marker: GlowSquid,
4914 parent: SquidMetadataBundle,
4915 dark_ticks_remaining: DarkTicksRemaining,
4916}
4917impl Default for GlowSquidMetadataBundle {
4918 fn default() -> Self {
4919 Self {
4920 _marker: GlowSquid,
4921 parent: Default::default(),
4922 dark_ticks_remaining: DarkTicksRemaining(0),
4923 }
4924 }
4925}
4926
4927#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4929pub struct SulfurCubeSize(pub i32);
4930#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4932pub struct MaxFuse(pub i32);
4933#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4935pub struct SulfurCubeFromBucket(pub bool);
4936#[derive(Component)]
4963pub struct SulfurCube;
4964impl SulfurCube {
4965 fn apply_metadata(
4966 entity: &mut bevy_ecs::system::EntityCommands,
4967 d: EntityDataItem,
4968 ) -> Result<(), UpdateMetadataError> {
4969 match d.index {
4970 0..=17 => AbstractAgeable::apply_metadata(entity, d)?,
4971 18 => {
4972 entity.insert(SulfurCubeSize(d.value.into_int()?));
4973 }
4974 19 => {
4975 entity.insert(MaxFuse(d.value.into_int()?));
4976 }
4977 20 => {
4978 entity.insert(SulfurCubeFromBucket(d.value.into_boolean()?));
4979 }
4980 _ => {}
4981 }
4982 Ok(())
4983 }
4984}
4985
4986#[derive(Bundle)]
4990pub struct SulfurCubeMetadataBundle {
4991 _marker: SulfurCube,
4992 parent: AbstractAgeableMetadataBundle,
4993 sulfur_cube_size: SulfurCubeSize,
4994 max_fuse: MaxFuse,
4995 sulfur_cube_from_bucket: SulfurCubeFromBucket,
4996}
4997impl Default for SulfurCubeMetadataBundle {
4998 fn default() -> Self {
4999 Self {
5000 _marker: SulfurCube,
5001 parent: Default::default(),
5002 sulfur_cube_size: SulfurCubeSize(1),
5003 max_fuse: MaxFuse(-1),
5004 sulfur_cube_from_bucket: SulfurCubeFromBucket(false),
5005 }
5006 }
5007}
5008
5009#[derive(Component)]
5068pub struct AbstractAnimal;
5069impl AbstractAnimal {
5070 fn apply_metadata(
5071 entity: &mut bevy_ecs::system::EntityCommands,
5072 d: EntityDataItem,
5073 ) -> Result<(), UpdateMetadataError> {
5074 match d.index {
5075 0..=17 => AbstractAgeable::apply_metadata(entity, d)?,
5076 _ => {}
5077 }
5078 Ok(())
5079 }
5080}
5081
5082#[derive(Bundle)]
5086pub struct AbstractAnimalMetadataBundle {
5087 _marker: AbstractAnimal,
5088 parent: AbstractAgeableMetadataBundle,
5089}
5090impl Default for AbstractAnimalMetadataBundle {
5091 fn default() -> Self {
5092 Self {
5093 _marker: AbstractAnimal,
5094 parent: Default::default(),
5095 }
5096 }
5097}
5098
5099#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5101pub struct ArmadilloState(pub ArmadilloStateKind);
5102#[derive(Component)]
5128pub struct Armadillo;
5129impl Armadillo {
5130 fn apply_metadata(
5131 entity: &mut bevy_ecs::system::EntityCommands,
5132 d: EntityDataItem,
5133 ) -> Result<(), UpdateMetadataError> {
5134 match d.index {
5135 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5136 18 => {
5137 entity.insert(ArmadilloState(d.value.into_armadillo_state()?));
5138 }
5139 _ => {}
5140 }
5141 Ok(())
5142 }
5143}
5144
5145#[derive(Bundle)]
5149pub struct ArmadilloMetadataBundle {
5150 _marker: Armadillo,
5151 parent: AbstractAnimalMetadataBundle,
5152 armadillo_state: ArmadilloState,
5153}
5154impl Default for ArmadilloMetadataBundle {
5155 fn default() -> Self {
5156 Self {
5157 _marker: Armadillo,
5158 parent: Default::default(),
5159 armadillo_state: ArmadilloState(Default::default()),
5160 }
5161 }
5162}
5163
5164#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5166pub struct AxolotlVariant(pub i32);
5167#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5169pub struct PlayingDead(pub bool);
5170#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5172pub struct AxolotlFromBucket(pub bool);
5173#[derive(Component)]
5200pub struct Axolotl;
5201impl Axolotl {
5202 fn apply_metadata(
5203 entity: &mut bevy_ecs::system::EntityCommands,
5204 d: EntityDataItem,
5205 ) -> Result<(), UpdateMetadataError> {
5206 match d.index {
5207 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5208 18 => {
5209 entity.insert(AxolotlVariant(d.value.into_int()?));
5210 }
5211 19 => {
5212 entity.insert(PlayingDead(d.value.into_boolean()?));
5213 }
5214 20 => {
5215 entity.insert(AxolotlFromBucket(d.value.into_boolean()?));
5216 }
5217 _ => {}
5218 }
5219 Ok(())
5220 }
5221}
5222
5223#[derive(Bundle)]
5227pub struct AxolotlMetadataBundle {
5228 _marker: Axolotl,
5229 parent: AbstractAnimalMetadataBundle,
5230 axolotl_variant: AxolotlVariant,
5231 playing_dead: PlayingDead,
5232 axolotl_from_bucket: AxolotlFromBucket,
5233}
5234impl Default for AxolotlMetadataBundle {
5235 fn default() -> Self {
5236 Self {
5237 _marker: Axolotl,
5238 parent: Default::default(),
5239 axolotl_variant: AxolotlVariant(0),
5240 playing_dead: PlayingDead(false),
5241 axolotl_from_bucket: AxolotlFromBucket(false),
5242 }
5243 }
5244}
5245
5246#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5247pub struct HasNectar(pub bool);
5249#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5250pub struct HasStung(pub bool);
5252#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5253pub struct BeeRolling(pub bool);
5255#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5257pub struct BeeAngerEndTime(pub i64);
5258#[derive(Component)]
5286pub struct Bee;
5287impl Bee {
5288 fn apply_metadata(
5289 entity: &mut bevy_ecs::system::EntityCommands,
5290 d: EntityDataItem,
5291 ) -> Result<(), UpdateMetadataError> {
5292 match d.index {
5293 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5294 18 => {
5295 let bitfield = d.value.into_byte()?;
5296 entity.insert(HasNectar(bitfield & 0x8 != 0));
5297 entity.insert(HasStung(bitfield & 0x4 != 0));
5298 entity.insert(BeeRolling(bitfield & 0x2 != 0));
5299 }
5300 19 => {
5301 entity.insert(BeeAngerEndTime(d.value.into_long()?));
5302 }
5303 _ => {}
5304 }
5305 Ok(())
5306 }
5307}
5308
5309#[derive(Bundle)]
5313pub struct BeeMetadataBundle {
5314 _marker: Bee,
5315 parent: AbstractAnimalMetadataBundle,
5316 has_nectar: HasNectar,
5317 has_stung: HasStung,
5318 bee_rolling: BeeRolling,
5319 bee_anger_end_time: BeeAngerEndTime,
5320}
5321impl Default for BeeMetadataBundle {
5322 fn default() -> Self {
5323 Self {
5324 _marker: Bee,
5325 parent: Default::default(),
5326 has_nectar: HasNectar(false),
5327 has_stung: HasStung(false),
5328 bee_rolling: BeeRolling(false),
5329 bee_anger_end_time: BeeAngerEndTime(-1),
5330 }
5331 }
5332}
5333
5334#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5336pub struct ChickenVariant(pub azalea_registry::data::ChickenVariant);
5337#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5339pub struct ChickenSoundVariant(pub azalea_registry::data::ChickenSoundVariant);
5340#[derive(Component)]
5366pub struct Chicken;
5367impl Chicken {
5368 fn apply_metadata(
5369 entity: &mut bevy_ecs::system::EntityCommands,
5370 d: EntityDataItem,
5371 ) -> Result<(), UpdateMetadataError> {
5372 match d.index {
5373 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5374 18 => {
5375 entity.insert(ChickenVariant(d.value.into_chicken_variant()?));
5376 }
5377 19 => {
5378 entity.insert(ChickenSoundVariant(d.value.into_chicken_sound_variant()?));
5379 }
5380 _ => {}
5381 }
5382 Ok(())
5383 }
5384}
5385
5386#[derive(Bundle)]
5390pub struct ChickenMetadataBundle {
5391 _marker: Chicken,
5392 parent: AbstractAnimalMetadataBundle,
5393 chicken_variant: ChickenVariant,
5394 chicken_sound_variant: ChickenSoundVariant,
5395}
5396impl Default for ChickenMetadataBundle {
5397 fn default() -> Self {
5398 Self {
5399 _marker: Chicken,
5400 parent: Default::default(),
5401 chicken_variant: ChickenVariant(azalea_registry::data::ChickenVariant::new_raw(0)),
5402 chicken_sound_variant: ChickenSoundVariant(
5403 azalea_registry::data::ChickenSoundVariant::new_raw(0),
5404 ),
5405 }
5406 }
5407}
5408
5409#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5411pub struct CowVariant(pub azalea_registry::data::CowVariant);
5412#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5414pub struct CowSoundVariant(pub azalea_registry::data::CowSoundVariant);
5415#[derive(Component)]
5441pub struct Cow;
5442impl Cow {
5443 fn apply_metadata(
5444 entity: &mut bevy_ecs::system::EntityCommands,
5445 d: EntityDataItem,
5446 ) -> Result<(), UpdateMetadataError> {
5447 match d.index {
5448 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5449 18 => {
5450 entity.insert(CowVariant(d.value.into_cow_variant()?));
5451 }
5452 19 => {
5453 entity.insert(CowSoundVariant(d.value.into_cow_sound_variant()?));
5454 }
5455 _ => {}
5456 }
5457 Ok(())
5458 }
5459}
5460
5461#[derive(Bundle)]
5465pub struct CowMetadataBundle {
5466 _marker: Cow,
5467 parent: AbstractAnimalMetadataBundle,
5468 cow_variant: CowVariant,
5469 cow_sound_variant: CowSoundVariant,
5470}
5471impl Default for CowMetadataBundle {
5472 fn default() -> Self {
5473 Self {
5474 _marker: Cow,
5475 parent: Default::default(),
5476 cow_variant: CowVariant(azalea_registry::data::CowVariant::new_raw(0)),
5477 cow_sound_variant: CowSoundVariant(azalea_registry::data::CowSoundVariant::new_raw(0)),
5478 }
5479 }
5480}
5481
5482#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5484pub struct FoxKind(pub i32);
5485#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5486pub struct FoxSitting(pub bool);
5488#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5489pub struct Faceplanted(pub bool);
5491#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5492pub struct Defending(pub bool);
5494#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5495pub struct Sleeping(pub bool);
5497#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5498pub struct Pouncing(pub bool);
5500#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5501pub struct FoxCrouching(pub bool);
5503#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5504pub struct FoxInterested(pub bool);
5506#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5508pub struct TrustedId0(pub Option<Uuid>);
5509#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5511pub struct TrustedId1(pub Option<Uuid>);
5512#[derive(Component)]
5546pub struct Fox;
5547impl Fox {
5548 fn apply_metadata(
5549 entity: &mut bevy_ecs::system::EntityCommands,
5550 d: EntityDataItem,
5551 ) -> Result<(), UpdateMetadataError> {
5552 match d.index {
5553 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5554 18 => {
5555 entity.insert(FoxKind(d.value.into_int()?));
5556 }
5557 19 => {
5558 let bitfield = d.value.into_byte()?;
5559 entity.insert(FoxSitting(bitfield & 0x1 != 0));
5560 entity.insert(Faceplanted(bitfield & 0x40 != 0));
5561 entity.insert(Defending(bitfield & 0x80 != 0));
5562 entity.insert(Sleeping(bitfield & 0x20 != 0));
5563 entity.insert(Pouncing(bitfield & 0x10 != 0));
5564 entity.insert(FoxCrouching(bitfield & 0x4 != 0));
5565 entity.insert(FoxInterested(bitfield & 0x8 != 0));
5566 }
5567 20 => {
5568 entity.insert(TrustedId0(d.value.into_optional_living_entity_reference()?));
5569 }
5570 21 => {
5571 entity.insert(TrustedId1(d.value.into_optional_living_entity_reference()?));
5572 }
5573 _ => {}
5574 }
5575 Ok(())
5576 }
5577}
5578
5579#[derive(Bundle)]
5583pub struct FoxMetadataBundle {
5584 _marker: Fox,
5585 parent: AbstractAnimalMetadataBundle,
5586 fox_kind: FoxKind,
5587 fox_sitting: FoxSitting,
5588 faceplanted: Faceplanted,
5589 defending: Defending,
5590 sleeping: Sleeping,
5591 pouncing: Pouncing,
5592 fox_crouching: FoxCrouching,
5593 fox_interested: FoxInterested,
5594 trusted_id_0: TrustedId0,
5595 trusted_id_1: TrustedId1,
5596}
5597impl Default for FoxMetadataBundle {
5598 fn default() -> Self {
5599 Self {
5600 _marker: Fox,
5601 parent: Default::default(),
5602 fox_kind: FoxKind(Default::default()),
5603 fox_sitting: FoxSitting(false),
5604 faceplanted: Faceplanted(false),
5605 defending: Defending(false),
5606 sleeping: Sleeping(false),
5607 pouncing: Pouncing(false),
5608 fox_crouching: FoxCrouching(false),
5609 fox_interested: FoxInterested(false),
5610 trusted_id_0: TrustedId0(None),
5611 trusted_id_1: TrustedId1(None),
5612 }
5613 }
5614}
5615
5616#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5618pub struct FrogVariant(pub azalea_registry::data::FrogVariant);
5619#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5621pub struct TongueTarget(pub OptionalUnsignedInt);
5622#[derive(Component)]
5648pub struct Frog;
5649impl Frog {
5650 fn apply_metadata(
5651 entity: &mut bevy_ecs::system::EntityCommands,
5652 d: EntityDataItem,
5653 ) -> Result<(), UpdateMetadataError> {
5654 match d.index {
5655 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5656 18 => {
5657 entity.insert(FrogVariant(d.value.into_frog_variant()?));
5658 }
5659 19 => {
5660 entity.insert(TongueTarget(d.value.into_optional_unsigned_int()?));
5661 }
5662 _ => {}
5663 }
5664 Ok(())
5665 }
5666}
5667
5668#[derive(Bundle)]
5672pub struct FrogMetadataBundle {
5673 _marker: Frog,
5674 parent: AbstractAnimalMetadataBundle,
5675 frog_variant: FrogVariant,
5676 tongue_target: TongueTarget,
5677}
5678impl Default for FrogMetadataBundle {
5679 fn default() -> Self {
5680 Self {
5681 _marker: Frog,
5682 parent: Default::default(),
5683 frog_variant: FrogVariant(azalea_registry::data::FrogVariant::new_raw(0)),
5684 tongue_target: TongueTarget(OptionalUnsignedInt(None)),
5685 }
5686 }
5687}
5688
5689#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5691pub struct IsScreamingGoat(pub bool);
5692#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5694pub struct HasLeftHorn(pub bool);
5695#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5697pub struct HasRightHorn(pub bool);
5698#[derive(Component)]
5725pub struct Goat;
5726impl Goat {
5727 fn apply_metadata(
5728 entity: &mut bevy_ecs::system::EntityCommands,
5729 d: EntityDataItem,
5730 ) -> Result<(), UpdateMetadataError> {
5731 match d.index {
5732 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5733 18 => {
5734 entity.insert(IsScreamingGoat(d.value.into_boolean()?));
5735 }
5736 19 => {
5737 entity.insert(HasLeftHorn(d.value.into_boolean()?));
5738 }
5739 20 => {
5740 entity.insert(HasRightHorn(d.value.into_boolean()?));
5741 }
5742 _ => {}
5743 }
5744 Ok(())
5745 }
5746}
5747
5748#[derive(Bundle)]
5752pub struct GoatMetadataBundle {
5753 _marker: Goat,
5754 parent: AbstractAnimalMetadataBundle,
5755 is_screaming_goat: IsScreamingGoat,
5756 has_left_horn: HasLeftHorn,
5757 has_right_horn: HasRightHorn,
5758}
5759impl Default for GoatMetadataBundle {
5760 fn default() -> Self {
5761 Self {
5762 _marker: Goat,
5763 parent: Default::default(),
5764 is_screaming_goat: IsScreamingGoat(false),
5765 has_left_horn: HasLeftHorn(true),
5766 has_right_horn: HasRightHorn(true),
5767 }
5768 }
5769}
5770
5771#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5773pub struct IsLeashHolder(pub bool);
5774#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5776pub struct StaysStill(pub bool);
5777#[derive(Component)]
5804pub struct HappyGhast;
5805impl HappyGhast {
5806 fn apply_metadata(
5807 entity: &mut bevy_ecs::system::EntityCommands,
5808 d: EntityDataItem,
5809 ) -> Result<(), UpdateMetadataError> {
5810 match d.index {
5811 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5812 18 => {
5813 entity.insert(IsLeashHolder(d.value.into_boolean()?));
5814 }
5815 19 => {
5816 entity.insert(StaysStill(d.value.into_boolean()?));
5817 }
5818 _ => {}
5819 }
5820 Ok(())
5821 }
5822}
5823
5824#[derive(Bundle)]
5828pub struct HappyGhastMetadataBundle {
5829 _marker: HappyGhast,
5830 parent: AbstractAnimalMetadataBundle,
5831 is_leash_holder: IsLeashHolder,
5832 stays_still: StaysStill,
5833}
5834impl Default for HappyGhastMetadataBundle {
5835 fn default() -> Self {
5836 Self {
5837 _marker: HappyGhast,
5838 parent: Default::default(),
5839 is_leash_holder: IsLeashHolder(false),
5840 stays_still: StaysStill(false),
5841 }
5842 }
5843}
5844
5845#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5847pub struct HoglinImmuneToZombification(pub bool);
5848#[derive(Component)]
5873pub struct Hoglin;
5874impl Hoglin {
5875 fn apply_metadata(
5876 entity: &mut bevy_ecs::system::EntityCommands,
5877 d: EntityDataItem,
5878 ) -> Result<(), UpdateMetadataError> {
5879 match d.index {
5880 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5881 18 => {
5882 entity.insert(HoglinImmuneToZombification(d.value.into_boolean()?));
5883 }
5884 _ => {}
5885 }
5886 Ok(())
5887 }
5888}
5889
5890#[derive(Bundle)]
5894pub struct HoglinMetadataBundle {
5895 _marker: Hoglin,
5896 parent: AbstractAnimalMetadataBundle,
5897 hoglin_immune_to_zombification: HoglinImmuneToZombification,
5898}
5899impl Default for HoglinMetadataBundle {
5900 fn default() -> Self {
5901 Self {
5902 _marker: Hoglin,
5903 parent: Default::default(),
5904 hoglin_immune_to_zombification: HoglinImmuneToZombification(false),
5905 }
5906 }
5907}
5908
5909#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5911pub struct MooshroomKind(pub i32);
5912#[derive(Component)]
5938pub struct Mooshroom;
5939impl Mooshroom {
5940 fn apply_metadata(
5941 entity: &mut bevy_ecs::system::EntityCommands,
5942 d: EntityDataItem,
5943 ) -> Result<(), UpdateMetadataError> {
5944 match d.index {
5945 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5946 18 => {
5947 entity.insert(MooshroomKind(d.value.into_int()?));
5948 }
5949 _ => {}
5950 }
5951 Ok(())
5952 }
5953}
5954
5955#[derive(Bundle)]
5959pub struct MooshroomMetadataBundle {
5960 _marker: Mooshroom,
5961 parent: AbstractAnimalMetadataBundle,
5962 mooshroom_kind: MooshroomKind,
5963}
5964impl Default for MooshroomMetadataBundle {
5965 fn default() -> Self {
5966 Self {
5967 _marker: Mooshroom,
5968 parent: Default::default(),
5969 mooshroom_kind: MooshroomKind(Default::default()),
5970 }
5971 }
5972}
5973
5974#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5976pub struct Trusting(pub bool);
5977#[derive(Component)]
6002pub struct Ocelot;
6003impl Ocelot {
6004 fn apply_metadata(
6005 entity: &mut bevy_ecs::system::EntityCommands,
6006 d: EntityDataItem,
6007 ) -> Result<(), UpdateMetadataError> {
6008 match d.index {
6009 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6010 18 => {
6011 entity.insert(Trusting(d.value.into_boolean()?));
6012 }
6013 _ => {}
6014 }
6015 Ok(())
6016 }
6017}
6018
6019#[derive(Bundle)]
6023pub struct OcelotMetadataBundle {
6024 _marker: Ocelot,
6025 parent: AbstractAnimalMetadataBundle,
6026 trusting: Trusting,
6027}
6028impl Default for OcelotMetadataBundle {
6029 fn default() -> Self {
6030 Self {
6031 _marker: Ocelot,
6032 parent: Default::default(),
6033 trusting: Trusting(false),
6034 }
6035 }
6036}
6037
6038#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6040pub struct PandaUnhappyCounter(pub i32);
6041#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6043pub struct SneezeCounter(pub i32);
6044#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6046pub struct EatCounter(pub i32);
6047#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6048pub struct Sneezing(pub bool);
6050#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6051pub struct PandaSitting(pub bool);
6053#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6054pub struct OnBack(pub bool);
6056#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6057pub struct PandaRolling(pub bool);
6059#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6061pub struct HiddenGene(pub u8);
6062#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6064pub struct PandaFlags(pub u8);
6065#[derive(Component)]
6098pub struct Panda;
6099impl Panda {
6100 fn apply_metadata(
6101 entity: &mut bevy_ecs::system::EntityCommands,
6102 d: EntityDataItem,
6103 ) -> Result<(), UpdateMetadataError> {
6104 match d.index {
6105 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6106 18 => {
6107 entity.insert(PandaUnhappyCounter(d.value.into_int()?));
6108 }
6109 19 => {
6110 entity.insert(SneezeCounter(d.value.into_int()?));
6111 }
6112 20 => {
6113 entity.insert(EatCounter(d.value.into_int()?));
6114 }
6115 21 => {
6116 let bitfield = d.value.into_byte()?;
6117 entity.insert(Sneezing(bitfield & 0x2 != 0));
6118 entity.insert(PandaSitting(bitfield & 0x8 != 0));
6119 entity.insert(OnBack(bitfield & 0x10 != 0));
6120 entity.insert(PandaRolling(bitfield & 0x4 != 0));
6121 }
6122 22 => {
6123 entity.insert(HiddenGene(d.value.into_byte()?));
6124 }
6125 23 => {
6126 entity.insert(PandaFlags(d.value.into_byte()?));
6127 }
6128 _ => {}
6129 }
6130 Ok(())
6131 }
6132}
6133
6134#[derive(Bundle)]
6138pub struct PandaMetadataBundle {
6139 _marker: Panda,
6140 parent: AbstractAnimalMetadataBundle,
6141 panda_unhappy_counter: PandaUnhappyCounter,
6142 sneeze_counter: SneezeCounter,
6143 eat_counter: EatCounter,
6144 sneezing: Sneezing,
6145 panda_sitting: PandaSitting,
6146 on_back: OnBack,
6147 panda_rolling: PandaRolling,
6148 hidden_gene: HiddenGene,
6149 panda_flags: PandaFlags,
6150}
6151impl Default for PandaMetadataBundle {
6152 fn default() -> Self {
6153 Self {
6154 _marker: Panda,
6155 parent: Default::default(),
6156 panda_unhappy_counter: PandaUnhappyCounter(0),
6157 sneeze_counter: SneezeCounter(0),
6158 eat_counter: EatCounter(0),
6159 sneezing: Sneezing(false),
6160 panda_sitting: PandaSitting(false),
6161 on_back: OnBack(false),
6162 panda_rolling: PandaRolling(false),
6163 hidden_gene: HiddenGene(0),
6164 panda_flags: PandaFlags(0),
6165 }
6166 }
6167}
6168
6169#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6171pub struct PigBoostTime(pub i32);
6172#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6174pub struct PigVariant(pub azalea_registry::data::PigVariant);
6175#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6177pub struct PigSoundVariant(pub azalea_registry::data::PigSoundVariant);
6178#[derive(Component)]
6205pub struct Pig;
6206impl Pig {
6207 fn apply_metadata(
6208 entity: &mut bevy_ecs::system::EntityCommands,
6209 d: EntityDataItem,
6210 ) -> Result<(), UpdateMetadataError> {
6211 match d.index {
6212 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6213 18 => {
6214 entity.insert(PigBoostTime(d.value.into_int()?));
6215 }
6216 19 => {
6217 entity.insert(PigVariant(d.value.into_pig_variant()?));
6218 }
6219 20 => {
6220 entity.insert(PigSoundVariant(d.value.into_pig_sound_variant()?));
6221 }
6222 _ => {}
6223 }
6224 Ok(())
6225 }
6226}
6227
6228#[derive(Bundle)]
6232pub struct PigMetadataBundle {
6233 _marker: Pig,
6234 parent: AbstractAnimalMetadataBundle,
6235 pig_boost_time: PigBoostTime,
6236 pig_variant: PigVariant,
6237 pig_sound_variant: PigSoundVariant,
6238}
6239impl Default for PigMetadataBundle {
6240 fn default() -> Self {
6241 Self {
6242 _marker: Pig,
6243 parent: Default::default(),
6244 pig_boost_time: PigBoostTime(0),
6245 pig_variant: PigVariant(azalea_registry::data::PigVariant::new_raw(0)),
6246 pig_sound_variant: PigSoundVariant(azalea_registry::data::PigSoundVariant::new_raw(0)),
6247 }
6248 }
6249}
6250
6251#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6253pub struct PolarBearStanding(pub bool);
6254#[derive(Component)]
6280pub struct PolarBear;
6281impl PolarBear {
6282 fn apply_metadata(
6283 entity: &mut bevy_ecs::system::EntityCommands,
6284 d: EntityDataItem,
6285 ) -> Result<(), UpdateMetadataError> {
6286 match d.index {
6287 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6288 18 => {
6289 entity.insert(PolarBearStanding(d.value.into_boolean()?));
6290 }
6291 _ => {}
6292 }
6293 Ok(())
6294 }
6295}
6296
6297#[derive(Bundle)]
6301pub struct PolarBearMetadataBundle {
6302 _marker: PolarBear,
6303 parent: AbstractAnimalMetadataBundle,
6304 polar_bear_standing: PolarBearStanding,
6305}
6306impl Default for PolarBearMetadataBundle {
6307 fn default() -> Self {
6308 Self {
6309 _marker: PolarBear,
6310 parent: Default::default(),
6311 polar_bear_standing: PolarBearStanding(false),
6312 }
6313 }
6314}
6315
6316#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6318pub struct RabbitKind(pub i32);
6319#[derive(Component)]
6344pub struct Rabbit;
6345impl Rabbit {
6346 fn apply_metadata(
6347 entity: &mut bevy_ecs::system::EntityCommands,
6348 d: EntityDataItem,
6349 ) -> Result<(), UpdateMetadataError> {
6350 match d.index {
6351 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6352 18 => {
6353 entity.insert(RabbitKind(d.value.into_int()?));
6354 }
6355 _ => {}
6356 }
6357 Ok(())
6358 }
6359}
6360
6361#[derive(Bundle)]
6365pub struct RabbitMetadataBundle {
6366 _marker: Rabbit,
6367 parent: AbstractAnimalMetadataBundle,
6368 rabbit_kind: RabbitKind,
6369}
6370impl Default for RabbitMetadataBundle {
6371 fn default() -> Self {
6372 Self {
6373 _marker: Rabbit,
6374 parent: Default::default(),
6375 rabbit_kind: RabbitKind(Default::default()),
6376 }
6377 }
6378}
6379
6380#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6381pub struct SheepSheared(pub bool);
6383#[derive(Component)]
6408pub struct Sheep;
6409impl Sheep {
6410 fn apply_metadata(
6411 entity: &mut bevy_ecs::system::EntityCommands,
6412 d: EntityDataItem,
6413 ) -> Result<(), UpdateMetadataError> {
6414 match d.index {
6415 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6416 18 => {
6417 let bitfield = d.value.into_byte()?;
6418 entity.insert(SheepSheared(bitfield & 0x10 != 0));
6419 }
6420 _ => {}
6421 }
6422 Ok(())
6423 }
6424}
6425
6426#[derive(Bundle)]
6430pub struct SheepMetadataBundle {
6431 _marker: Sheep,
6432 parent: AbstractAnimalMetadataBundle,
6433 sheep_sheared: SheepSheared,
6434}
6435impl Default for SheepMetadataBundle {
6436 fn default() -> Self {
6437 Self {
6438 _marker: Sheep,
6439 parent: Default::default(),
6440 sheep_sheared: SheepSheared(false),
6441 }
6442 }
6443}
6444
6445#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6447pub struct SnifferState(pub SnifferStateKind);
6448#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6450pub struct DropSeedAtTick(pub i32);
6451#[derive(Component)]
6477pub struct Sniffer;
6478impl Sniffer {
6479 fn apply_metadata(
6480 entity: &mut bevy_ecs::system::EntityCommands,
6481 d: EntityDataItem,
6482 ) -> Result<(), UpdateMetadataError> {
6483 match d.index {
6484 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6485 18 => {
6486 entity.insert(SnifferState(d.value.into_sniffer_state()?));
6487 }
6488 19 => {
6489 entity.insert(DropSeedAtTick(d.value.into_int()?));
6490 }
6491 _ => {}
6492 }
6493 Ok(())
6494 }
6495}
6496
6497#[derive(Bundle)]
6501pub struct SnifferMetadataBundle {
6502 _marker: Sniffer,
6503 parent: AbstractAnimalMetadataBundle,
6504 sniffer_state: SnifferState,
6505 drop_seed_at_tick: DropSeedAtTick,
6506}
6507impl Default for SnifferMetadataBundle {
6508 fn default() -> Self {
6509 Self {
6510 _marker: Sniffer,
6511 parent: Default::default(),
6512 sniffer_state: SnifferState(Default::default()),
6513 drop_seed_at_tick: DropSeedAtTick(0),
6514 }
6515 }
6516}
6517
6518#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6520pub struct StriderBoostTime(pub i32);
6521#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6523pub struct Suffocating(pub bool);
6524#[derive(Component)]
6550pub struct Strider;
6551impl Strider {
6552 fn apply_metadata(
6553 entity: &mut bevy_ecs::system::EntityCommands,
6554 d: EntityDataItem,
6555 ) -> Result<(), UpdateMetadataError> {
6556 match d.index {
6557 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6558 18 => {
6559 entity.insert(StriderBoostTime(d.value.into_int()?));
6560 }
6561 19 => {
6562 entity.insert(Suffocating(d.value.into_boolean()?));
6563 }
6564 _ => {}
6565 }
6566 Ok(())
6567 }
6568}
6569
6570#[derive(Bundle)]
6574pub struct StriderMetadataBundle {
6575 _marker: Strider,
6576 parent: AbstractAnimalMetadataBundle,
6577 strider_boost_time: StriderBoostTime,
6578 suffocating: Suffocating,
6579}
6580impl Default for StriderMetadataBundle {
6581 fn default() -> Self {
6582 Self {
6583 _marker: Strider,
6584 parent: Default::default(),
6585 strider_boost_time: StriderBoostTime(0),
6586 suffocating: Suffocating(false),
6587 }
6588 }
6589}
6590
6591#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6593pub struct HasEgg(pub bool);
6594#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6596pub struct LayingEgg(pub bool);
6597#[derive(Component)]
6623pub struct Turtle;
6624impl Turtle {
6625 fn apply_metadata(
6626 entity: &mut bevy_ecs::system::EntityCommands,
6627 d: EntityDataItem,
6628 ) -> Result<(), UpdateMetadataError> {
6629 match d.index {
6630 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6631 18 => {
6632 entity.insert(HasEgg(d.value.into_boolean()?));
6633 }
6634 19 => {
6635 entity.insert(LayingEgg(d.value.into_boolean()?));
6636 }
6637 _ => {}
6638 }
6639 Ok(())
6640 }
6641}
6642
6643#[derive(Bundle)]
6647pub struct TurtleMetadataBundle {
6648 _marker: Turtle,
6649 parent: AbstractAnimalMetadataBundle,
6650 has_egg: HasEgg,
6651 laying_egg: LayingEgg,
6652}
6653impl Default for TurtleMetadataBundle {
6654 fn default() -> Self {
6655 Self {
6656 _marker: Turtle,
6657 parent: Default::default(),
6658 has_egg: HasEgg(false),
6659 laying_egg: LayingEgg(false),
6660 }
6661 }
6662}
6663
6664#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6665pub struct Tamed(pub bool);
6667#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6668pub struct Eating(pub bool);
6670#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6671pub struct AbstractHorseStanding(pub bool);
6673#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6674pub struct Bred(pub bool);
6676#[derive(Component)]
6714pub struct AbstractHorse;
6715impl AbstractHorse {
6716 fn apply_metadata(
6717 entity: &mut bevy_ecs::system::EntityCommands,
6718 d: EntityDataItem,
6719 ) -> Result<(), UpdateMetadataError> {
6720 match d.index {
6721 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6722 18 => {
6723 let bitfield = d.value.into_byte()?;
6724 entity.insert(Tamed(bitfield & 0x2 != 0));
6725 entity.insert(Eating(bitfield & 0x10 != 0));
6726 entity.insert(AbstractHorseStanding(bitfield & 0x20 != 0));
6727 entity.insert(Bred(bitfield & 0x8 != 0));
6728 }
6729 _ => {}
6730 }
6731 Ok(())
6732 }
6733}
6734
6735#[derive(Bundle)]
6739pub struct AbstractHorseMetadataBundle {
6740 _marker: AbstractHorse,
6741 parent: AbstractAnimalMetadataBundle,
6742 tamed: Tamed,
6743 eating: Eating,
6744 abstract_horse_standing: AbstractHorseStanding,
6745 bred: Bred,
6746}
6747impl Default for AbstractHorseMetadataBundle {
6748 fn default() -> Self {
6749 Self {
6750 _marker: AbstractHorse,
6751 parent: Default::default(),
6752 tamed: Tamed(false),
6753 eating: Eating(false),
6754 abstract_horse_standing: AbstractHorseStanding(false),
6755 bred: Bred(false),
6756 }
6757 }
6758}
6759
6760#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6762pub struct CamelDash(pub bool);
6763#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6765pub struct LastPoseChangeTick(pub i64);
6766#[derive(Component)]
6793pub struct Camel;
6794impl Camel {
6795 fn apply_metadata(
6796 entity: &mut bevy_ecs::system::EntityCommands,
6797 d: EntityDataItem,
6798 ) -> Result<(), UpdateMetadataError> {
6799 match d.index {
6800 0..=18 => AbstractHorse::apply_metadata(entity, d)?,
6801 19 => {
6802 entity.insert(CamelDash(d.value.into_boolean()?));
6803 }
6804 20 => {
6805 entity.insert(LastPoseChangeTick(d.value.into_long()?));
6806 }
6807 _ => {}
6808 }
6809 Ok(())
6810 }
6811}
6812
6813#[derive(Bundle)]
6817pub struct CamelMetadataBundle {
6818 _marker: Camel,
6819 parent: AbstractHorseMetadataBundle,
6820 camel_dash: CamelDash,
6821 last_pose_change_tick: LastPoseChangeTick,
6822}
6823impl Default for CamelMetadataBundle {
6824 fn default() -> Self {
6825 Self {
6826 _marker: Camel,
6827 parent: Default::default(),
6828 camel_dash: CamelDash(false),
6829 last_pose_change_tick: LastPoseChangeTick(0),
6830 }
6831 }
6832}
6833
6834#[derive(Component)]
6859pub struct CamelHusk;
6860impl CamelHusk {
6861 fn apply_metadata(
6862 entity: &mut bevy_ecs::system::EntityCommands,
6863 d: EntityDataItem,
6864 ) -> Result<(), UpdateMetadataError> {
6865 match d.index {
6866 0..=20 => Camel::apply_metadata(entity, d)?,
6867 _ => {}
6868 }
6869 Ok(())
6870 }
6871}
6872
6873#[derive(Bundle)]
6877pub struct CamelHuskMetadataBundle {
6878 _marker: CamelHusk,
6879 parent: CamelMetadataBundle,
6880}
6881impl Default for CamelHuskMetadataBundle {
6882 fn default() -> Self {
6883 Self {
6884 _marker: CamelHusk,
6885 parent: Default::default(),
6886 }
6887 }
6888}
6889
6890#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6892pub struct HorseTypeVariant(pub i32);
6893#[derive(Component)]
6919pub struct Horse;
6920impl Horse {
6921 fn apply_metadata(
6922 entity: &mut bevy_ecs::system::EntityCommands,
6923 d: EntityDataItem,
6924 ) -> Result<(), UpdateMetadataError> {
6925 match d.index {
6926 0..=18 => AbstractHorse::apply_metadata(entity, d)?,
6927 19 => {
6928 entity.insert(HorseTypeVariant(d.value.into_int()?));
6929 }
6930 _ => {}
6931 }
6932 Ok(())
6933 }
6934}
6935
6936#[derive(Bundle)]
6940pub struct HorseMetadataBundle {
6941 _marker: Horse,
6942 parent: AbstractHorseMetadataBundle,
6943 horse_type_variant: HorseTypeVariant,
6944}
6945impl Default for HorseMetadataBundle {
6946 fn default() -> Self {
6947 Self {
6948 _marker: Horse,
6949 parent: Default::default(),
6950 horse_type_variant: HorseTypeVariant(0),
6951 }
6952 }
6953}
6954
6955#[derive(Component)]
6979pub struct SkeletonHorse;
6980impl SkeletonHorse {
6981 fn apply_metadata(
6982 entity: &mut bevy_ecs::system::EntityCommands,
6983 d: EntityDataItem,
6984 ) -> Result<(), UpdateMetadataError> {
6985 match d.index {
6986 0..=18 => AbstractHorse::apply_metadata(entity, d)?,
6987 _ => {}
6988 }
6989 Ok(())
6990 }
6991}
6992
6993#[derive(Bundle)]
6997pub struct SkeletonHorseMetadataBundle {
6998 _marker: SkeletonHorse,
6999 parent: AbstractHorseMetadataBundle,
7000}
7001impl Default for SkeletonHorseMetadataBundle {
7002 fn default() -> Self {
7003 Self {
7004 _marker: SkeletonHorse,
7005 parent: Default::default(),
7006 }
7007 }
7008}
7009
7010#[derive(Component)]
7034pub struct ZombieHorse;
7035impl ZombieHorse {
7036 fn apply_metadata(
7037 entity: &mut bevy_ecs::system::EntityCommands,
7038 d: EntityDataItem,
7039 ) -> Result<(), UpdateMetadataError> {
7040 match d.index {
7041 0..=18 => AbstractHorse::apply_metadata(entity, d)?,
7042 _ => {}
7043 }
7044 Ok(())
7045 }
7046}
7047
7048#[derive(Bundle)]
7052pub struct ZombieHorseMetadataBundle {
7053 _marker: ZombieHorse,
7054 parent: AbstractHorseMetadataBundle,
7055}
7056impl Default for ZombieHorseMetadataBundle {
7057 fn default() -> Self {
7058 Self {
7059 _marker: ZombieHorse,
7060 parent: Default::default(),
7061 }
7062 }
7063}
7064
7065#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7067pub struct Chest(pub bool);
7068#[derive(Component)]
7098pub struct AbstractChestedHorse;
7099impl AbstractChestedHorse {
7100 fn apply_metadata(
7101 entity: &mut bevy_ecs::system::EntityCommands,
7102 d: EntityDataItem,
7103 ) -> Result<(), UpdateMetadataError> {
7104 match d.index {
7105 0..=18 => AbstractHorse::apply_metadata(entity, d)?,
7106 19 => {
7107 entity.insert(Chest(d.value.into_boolean()?));
7108 }
7109 _ => {}
7110 }
7111 Ok(())
7112 }
7113}
7114
7115#[derive(Bundle)]
7119pub struct AbstractChestedHorseMetadataBundle {
7120 _marker: AbstractChestedHorse,
7121 parent: AbstractHorseMetadataBundle,
7122 chest: Chest,
7123}
7124impl Default for AbstractChestedHorseMetadataBundle {
7125 fn default() -> Self {
7126 Self {
7127 _marker: AbstractChestedHorse,
7128 parent: Default::default(),
7129 chest: Chest(false),
7130 }
7131 }
7132}
7133
7134#[derive(Component)]
7159pub struct Donkey;
7160impl Donkey {
7161 fn apply_metadata(
7162 entity: &mut bevy_ecs::system::EntityCommands,
7163 d: EntityDataItem,
7164 ) -> Result<(), UpdateMetadataError> {
7165 match d.index {
7166 0..=19 => AbstractChestedHorse::apply_metadata(entity, d)?,
7167 _ => {}
7168 }
7169 Ok(())
7170 }
7171}
7172
7173#[derive(Bundle)]
7177pub struct DonkeyMetadataBundle {
7178 _marker: Donkey,
7179 parent: AbstractChestedHorseMetadataBundle,
7180}
7181impl Default for DonkeyMetadataBundle {
7182 fn default() -> Self {
7183 Self {
7184 _marker: Donkey,
7185 parent: Default::default(),
7186 }
7187 }
7188}
7189
7190#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7192pub struct Strength(pub i32);
7193#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7195pub struct LlamaVariant(pub i32);
7196#[derive(Component)]
7224pub struct Llama;
7225impl Llama {
7226 fn apply_metadata(
7227 entity: &mut bevy_ecs::system::EntityCommands,
7228 d: EntityDataItem,
7229 ) -> Result<(), UpdateMetadataError> {
7230 match d.index {
7231 0..=19 => AbstractChestedHorse::apply_metadata(entity, d)?,
7232 20 => {
7233 entity.insert(Strength(d.value.into_int()?));
7234 }
7235 21 => {
7236 entity.insert(LlamaVariant(d.value.into_int()?));
7237 }
7238 _ => {}
7239 }
7240 Ok(())
7241 }
7242}
7243
7244#[derive(Bundle)]
7248pub struct LlamaMetadataBundle {
7249 _marker: Llama,
7250 parent: AbstractChestedHorseMetadataBundle,
7251 strength: Strength,
7252 llama_variant: LlamaVariant,
7253}
7254impl Default for LlamaMetadataBundle {
7255 fn default() -> Self {
7256 Self {
7257 _marker: Llama,
7258 parent: Default::default(),
7259 strength: Strength(0),
7260 llama_variant: LlamaVariant(0),
7261 }
7262 }
7263}
7264
7265#[derive(Component)]
7291pub struct TraderLlama;
7292impl TraderLlama {
7293 fn apply_metadata(
7294 entity: &mut bevy_ecs::system::EntityCommands,
7295 d: EntityDataItem,
7296 ) -> Result<(), UpdateMetadataError> {
7297 match d.index {
7298 0..=21 => Llama::apply_metadata(entity, d)?,
7299 _ => {}
7300 }
7301 Ok(())
7302 }
7303}
7304
7305#[derive(Bundle)]
7309pub struct TraderLlamaMetadataBundle {
7310 _marker: TraderLlama,
7311 parent: LlamaMetadataBundle,
7312}
7313impl Default for TraderLlamaMetadataBundle {
7314 fn default() -> Self {
7315 Self {
7316 _marker: TraderLlama,
7317 parent: Default::default(),
7318 }
7319 }
7320}
7321
7322#[derive(Component)]
7347pub struct Mule;
7348impl Mule {
7349 fn apply_metadata(
7350 entity: &mut bevy_ecs::system::EntityCommands,
7351 d: EntityDataItem,
7352 ) -> Result<(), UpdateMetadataError> {
7353 match d.index {
7354 0..=19 => AbstractChestedHorse::apply_metadata(entity, d)?,
7355 _ => {}
7356 }
7357 Ok(())
7358 }
7359}
7360
7361#[derive(Bundle)]
7365pub struct MuleMetadataBundle {
7366 _marker: Mule,
7367 parent: AbstractChestedHorseMetadataBundle,
7368}
7369impl Default for MuleMetadataBundle {
7370 fn default() -> Self {
7371 Self {
7372 _marker: Mule,
7373 parent: Default::default(),
7374 }
7375 }
7376}
7377
7378#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
7379pub struct Tame(pub bool);
7381#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
7382pub struct InSittingPose(pub bool);
7384#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7386pub struct Owneruuid(pub Option<Uuid>);
7387#[derive(Component)]
7420pub struct AbstractTameable;
7421impl AbstractTameable {
7422 fn apply_metadata(
7423 entity: &mut bevy_ecs::system::EntityCommands,
7424 d: EntityDataItem,
7425 ) -> Result<(), UpdateMetadataError> {
7426 match d.index {
7427 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
7428 18 => {
7429 let bitfield = d.value.into_byte()?;
7430 entity.insert(Tame(bitfield & 0x4 != 0));
7431 entity.insert(InSittingPose(bitfield & 0x1 != 0));
7432 }
7433 19 => {
7434 entity.insert(Owneruuid(d.value.into_optional_living_entity_reference()?));
7435 }
7436 _ => {}
7437 }
7438 Ok(())
7439 }
7440}
7441
7442#[derive(Bundle)]
7446pub struct AbstractTameableMetadataBundle {
7447 _marker: AbstractTameable,
7448 parent: AbstractAnimalMetadataBundle,
7449 tame: Tame,
7450 in_sitting_pose: InSittingPose,
7451 owneruuid: Owneruuid,
7452}
7453impl Default for AbstractTameableMetadataBundle {
7454 fn default() -> Self {
7455 Self {
7456 _marker: AbstractTameable,
7457 parent: Default::default(),
7458 tame: Tame(false),
7459 in_sitting_pose: InSittingPose(false),
7460 owneruuid: Owneruuid(None),
7461 }
7462 }
7463}
7464
7465#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7467pub struct CatVariant(pub azalea_registry::data::CatVariant);
7468#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7470pub struct IsLying(pub bool);
7471#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7473pub struct RelaxStateOne(pub bool);
7474#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7476pub struct CatCollarColor(pub i32);
7477#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7479pub struct CatSoundVariant(pub azalea_registry::data::CatSoundVariant);
7480#[derive(Component)]
7510pub struct Cat;
7511impl Cat {
7512 fn apply_metadata(
7513 entity: &mut bevy_ecs::system::EntityCommands,
7514 d: EntityDataItem,
7515 ) -> Result<(), UpdateMetadataError> {
7516 match d.index {
7517 0..=19 => AbstractTameable::apply_metadata(entity, d)?,
7518 20 => {
7519 entity.insert(CatVariant(d.value.into_cat_variant()?));
7520 }
7521 21 => {
7522 entity.insert(IsLying(d.value.into_boolean()?));
7523 }
7524 22 => {
7525 entity.insert(RelaxStateOne(d.value.into_boolean()?));
7526 }
7527 23 => {
7528 entity.insert(CatCollarColor(d.value.into_int()?));
7529 }
7530 24 => {
7531 entity.insert(CatSoundVariant(d.value.into_cat_sound_variant()?));
7532 }
7533 _ => {}
7534 }
7535 Ok(())
7536 }
7537}
7538
7539#[derive(Bundle)]
7543pub struct CatMetadataBundle {
7544 _marker: Cat,
7545 parent: AbstractTameableMetadataBundle,
7546 cat_variant: CatVariant,
7547 is_lying: IsLying,
7548 relax_state_one: RelaxStateOne,
7549 cat_collar_color: CatCollarColor,
7550 cat_sound_variant: CatSoundVariant,
7551}
7552impl Default for CatMetadataBundle {
7553 fn default() -> Self {
7554 Self {
7555 _marker: Cat,
7556 parent: Default::default(),
7557 cat_variant: CatVariant(azalea_registry::data::CatVariant::new_raw(0)),
7558 is_lying: IsLying(false),
7559 relax_state_one: RelaxStateOne(false),
7560 cat_collar_color: CatCollarColor(Default::default()),
7561 cat_sound_variant: CatSoundVariant(azalea_registry::data::CatSoundVariant::new_raw(0)),
7562 }
7563 }
7564}
7565
7566#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7568pub struct ParrotVariant(pub i32);
7569#[derive(Component)]
7595pub struct Parrot;
7596impl Parrot {
7597 fn apply_metadata(
7598 entity: &mut bevy_ecs::system::EntityCommands,
7599 d: EntityDataItem,
7600 ) -> Result<(), UpdateMetadataError> {
7601 match d.index {
7602 0..=19 => AbstractTameable::apply_metadata(entity, d)?,
7603 20 => {
7604 entity.insert(ParrotVariant(d.value.into_int()?));
7605 }
7606 _ => {}
7607 }
7608 Ok(())
7609 }
7610}
7611
7612#[derive(Bundle)]
7616pub struct ParrotMetadataBundle {
7617 _marker: Parrot,
7618 parent: AbstractTameableMetadataBundle,
7619 parrot_variant: ParrotVariant,
7620}
7621impl Default for ParrotMetadataBundle {
7622 fn default() -> Self {
7623 Self {
7624 _marker: Parrot,
7625 parent: Default::default(),
7626 parrot_variant: ParrotVariant(Default::default()),
7627 }
7628 }
7629}
7630
7631#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7633pub struct WolfInterested(pub bool);
7634#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7636pub struct WolfCollarColor(pub i32);
7637#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7639pub struct WolfAngerEndTime(pub i64);
7640#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7642pub struct WolfVariant(pub azalea_registry::data::WolfVariant);
7643#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7645pub struct WolfSoundVariant(pub azalea_registry::data::WolfSoundVariant);
7646#[derive(Component)]
7676pub struct Wolf;
7677impl Wolf {
7678 fn apply_metadata(
7679 entity: &mut bevy_ecs::system::EntityCommands,
7680 d: EntityDataItem,
7681 ) -> Result<(), UpdateMetadataError> {
7682 match d.index {
7683 0..=19 => AbstractTameable::apply_metadata(entity, d)?,
7684 20 => {
7685 entity.insert(WolfInterested(d.value.into_boolean()?));
7686 }
7687 21 => {
7688 entity.insert(WolfCollarColor(d.value.into_int()?));
7689 }
7690 22 => {
7691 entity.insert(WolfAngerEndTime(d.value.into_long()?));
7692 }
7693 23 => {
7694 entity.insert(WolfVariant(d.value.into_wolf_variant()?));
7695 }
7696 24 => {
7697 entity.insert(WolfSoundVariant(d.value.into_wolf_sound_variant()?));
7698 }
7699 _ => {}
7700 }
7701 Ok(())
7702 }
7703}
7704
7705#[derive(Bundle)]
7709pub struct WolfMetadataBundle {
7710 _marker: Wolf,
7711 parent: AbstractTameableMetadataBundle,
7712 wolf_interested: WolfInterested,
7713 wolf_collar_color: WolfCollarColor,
7714 wolf_anger_end_time: WolfAngerEndTime,
7715 wolf_variant: WolfVariant,
7716 wolf_sound_variant: WolfSoundVariant,
7717}
7718impl Default for WolfMetadataBundle {
7719 fn default() -> Self {
7720 Self {
7721 _marker: Wolf,
7722 parent: Default::default(),
7723 wolf_interested: WolfInterested(false),
7724 wolf_collar_color: WolfCollarColor(Default::default()),
7725 wolf_anger_end_time: WolfAngerEndTime(-1),
7726 wolf_variant: WolfVariant(azalea_registry::data::WolfVariant::new_raw(0)),
7727 wolf_sound_variant: WolfSoundVariant(azalea_registry::data::WolfSoundVariant::new_raw(
7728 0,
7729 )),
7730 }
7731 }
7732}
7733
7734#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7736pub struct AbstractNautilusDash(pub bool);
7737#[derive(Component)]
7765pub struct AbstractNautilus;
7766impl AbstractNautilus {
7767 fn apply_metadata(
7768 entity: &mut bevy_ecs::system::EntityCommands,
7769 d: EntityDataItem,
7770 ) -> Result<(), UpdateMetadataError> {
7771 match d.index {
7772 0..=19 => AbstractTameable::apply_metadata(entity, d)?,
7773 20 => {
7774 entity.insert(AbstractNautilusDash(d.value.into_boolean()?));
7775 }
7776 _ => {}
7777 }
7778 Ok(())
7779 }
7780}
7781
7782#[derive(Bundle)]
7786pub struct AbstractNautilusMetadataBundle {
7787 _marker: AbstractNautilus,
7788 parent: AbstractTameableMetadataBundle,
7789 abstract_nautilus_dash: AbstractNautilusDash,
7790}
7791impl Default for AbstractNautilusMetadataBundle {
7792 fn default() -> Self {
7793 Self {
7794 _marker: AbstractNautilus,
7795 parent: Default::default(),
7796 abstract_nautilus_dash: AbstractNautilusDash(false),
7797 }
7798 }
7799}
7800
7801#[derive(Component)]
7826pub struct Nautilus;
7827impl Nautilus {
7828 fn apply_metadata(
7829 entity: &mut bevy_ecs::system::EntityCommands,
7830 d: EntityDataItem,
7831 ) -> Result<(), UpdateMetadataError> {
7832 match d.index {
7833 0..=20 => AbstractNautilus::apply_metadata(entity, d)?,
7834 _ => {}
7835 }
7836 Ok(())
7837 }
7838}
7839
7840#[derive(Bundle)]
7844pub struct NautilusMetadataBundle {
7845 _marker: Nautilus,
7846 parent: AbstractNautilusMetadataBundle,
7847}
7848impl Default for NautilusMetadataBundle {
7849 fn default() -> Self {
7850 Self {
7851 _marker: Nautilus,
7852 parent: Default::default(),
7853 }
7854 }
7855}
7856
7857#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7859pub struct ZombieNautilusVariant(pub azalea_registry::data::ZombieNautilusVariant);
7860#[derive(Component)]
7888pub struct ZombieNautilus;
7889impl ZombieNautilus {
7890 fn apply_metadata(
7891 entity: &mut bevy_ecs::system::EntityCommands,
7892 d: EntityDataItem,
7893 ) -> Result<(), UpdateMetadataError> {
7894 match d.index {
7895 0..=20 => AbstractNautilus::apply_metadata(entity, d)?,
7896 21 => {
7897 entity.insert(ZombieNautilusVariant(
7898 d.value.into_zombie_nautilus_variant()?,
7899 ));
7900 }
7901 _ => {}
7902 }
7903 Ok(())
7904 }
7905}
7906
7907#[derive(Bundle)]
7911pub struct ZombieNautilusMetadataBundle {
7912 _marker: ZombieNautilus,
7913 parent: AbstractNautilusMetadataBundle,
7914 zombie_nautilus_variant: ZombieNautilusVariant,
7915}
7916impl Default for ZombieNautilusMetadataBundle {
7917 fn default() -> Self {
7918 Self {
7919 _marker: ZombieNautilus,
7920 parent: Default::default(),
7921 zombie_nautilus_variant: ZombieNautilusVariant(
7922 azalea_registry::data::ZombieNautilusVariant::new_raw(0),
7923 ),
7924 }
7925 }
7926}
7927
7928#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7930pub struct AbstractVillagerUnhappyCounter(pub i32);
7931#[derive(Component)]
7957pub struct AbstractVillager;
7958impl AbstractVillager {
7959 fn apply_metadata(
7960 entity: &mut bevy_ecs::system::EntityCommands,
7961 d: EntityDataItem,
7962 ) -> Result<(), UpdateMetadataError> {
7963 match d.index {
7964 0..=17 => AbstractAgeable::apply_metadata(entity, d)?,
7965 18 => {
7966 entity.insert(AbstractVillagerUnhappyCounter(d.value.into_int()?));
7967 }
7968 _ => {}
7969 }
7970 Ok(())
7971 }
7972}
7973
7974#[derive(Bundle)]
7978pub struct AbstractVillagerMetadataBundle {
7979 _marker: AbstractVillager,
7980 parent: AbstractAgeableMetadataBundle,
7981 abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter,
7982}
7983impl Default for AbstractVillagerMetadataBundle {
7984 fn default() -> Self {
7985 Self {
7986 _marker: AbstractVillager,
7987 parent: Default::default(),
7988 abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter(0),
7989 }
7990 }
7991}
7992
7993#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7995pub struct VillagerVillagerData(pub VillagerData);
7996#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7998pub struct VillagerVillagerDataFinalized(pub bool);
7999#[derive(Component)]
8026pub struct Villager;
8027impl Villager {
8028 fn apply_metadata(
8029 entity: &mut bevy_ecs::system::EntityCommands,
8030 d: EntityDataItem,
8031 ) -> Result<(), UpdateMetadataError> {
8032 match d.index {
8033 0..=18 => AbstractVillager::apply_metadata(entity, d)?,
8034 19 => {
8035 entity.insert(VillagerVillagerData(d.value.into_villager_data()?));
8036 }
8037 20 => {
8038 entity.insert(VillagerVillagerDataFinalized(d.value.into_boolean()?));
8039 }
8040 _ => {}
8041 }
8042 Ok(())
8043 }
8044}
8045
8046#[derive(Bundle)]
8050pub struct VillagerMetadataBundle {
8051 _marker: Villager,
8052 parent: AbstractVillagerMetadataBundle,
8053 villager_villager_data: VillagerVillagerData,
8054 villager_villager_data_finalized: VillagerVillagerDataFinalized,
8055}
8056impl Default for VillagerMetadataBundle {
8057 fn default() -> Self {
8058 Self {
8059 _marker: Villager,
8060 parent: Default::default(),
8061 villager_villager_data: VillagerVillagerData(VillagerData {
8062 kind: azalea_registry::builtin::VillagerKind::Plains,
8063 profession: azalea_registry::builtin::VillagerProfession::None,
8064 level: 0,
8065 }),
8066 villager_villager_data_finalized: VillagerVillagerDataFinalized(false),
8067 }
8068 }
8069}
8070
8071#[derive(Component)]
8094pub struct WanderingTrader;
8095impl WanderingTrader {
8096 fn apply_metadata(
8097 entity: &mut bevy_ecs::system::EntityCommands,
8098 d: EntityDataItem,
8099 ) -> Result<(), UpdateMetadataError> {
8100 match d.index {
8101 0..=18 => AbstractVillager::apply_metadata(entity, d)?,
8102 _ => {}
8103 }
8104 Ok(())
8105 }
8106}
8107
8108#[derive(Bundle)]
8112pub struct WanderingTraderMetadataBundle {
8113 _marker: WanderingTrader,
8114 parent: AbstractVillagerMetadataBundle,
8115}
8116impl Default for WanderingTraderMetadataBundle {
8117 fn default() -> Self {
8118 Self {
8119 _marker: WanderingTrader,
8120 parent: Default::default(),
8121 }
8122 }
8123}
8124
8125#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8127pub struct AbstractFishFromBucket(pub bool);
8128#[derive(Component)]
8154pub struct AbstractFish;
8155impl AbstractFish {
8156 fn apply_metadata(
8157 entity: &mut bevy_ecs::system::EntityCommands,
8158 d: EntityDataItem,
8159 ) -> Result<(), UpdateMetadataError> {
8160 match d.index {
8161 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
8162 16 => {
8163 entity.insert(AbstractFishFromBucket(d.value.into_boolean()?));
8164 }
8165 _ => {}
8166 }
8167 Ok(())
8168 }
8169}
8170
8171#[derive(Bundle)]
8175pub struct AbstractFishMetadataBundle {
8176 _marker: AbstractFish,
8177 parent: AbstractCreatureMetadataBundle,
8178 abstract_fish_from_bucket: AbstractFishFromBucket,
8179}
8180impl Default for AbstractFishMetadataBundle {
8181 fn default() -> Self {
8182 Self {
8183 _marker: AbstractFish,
8184 parent: Default::default(),
8185 abstract_fish_from_bucket: AbstractFishFromBucket(false),
8186 }
8187 }
8188}
8189
8190#[derive(Component)]
8212pub struct Cod;
8213impl Cod {
8214 fn apply_metadata(
8215 entity: &mut bevy_ecs::system::EntityCommands,
8216 d: EntityDataItem,
8217 ) -> Result<(), UpdateMetadataError> {
8218 match d.index {
8219 0..=16 => AbstractFish::apply_metadata(entity, d)?,
8220 _ => {}
8221 }
8222 Ok(())
8223 }
8224}
8225
8226#[derive(Bundle)]
8230pub struct CodMetadataBundle {
8231 _marker: Cod,
8232 parent: AbstractFishMetadataBundle,
8233}
8234impl Default for CodMetadataBundle {
8235 fn default() -> Self {
8236 Self {
8237 _marker: Cod,
8238 parent: Default::default(),
8239 }
8240 }
8241}
8242
8243#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8245pub struct SalmonKind(pub i32);
8246#[derive(Component)]
8270pub struct Salmon;
8271impl Salmon {
8272 fn apply_metadata(
8273 entity: &mut bevy_ecs::system::EntityCommands,
8274 d: EntityDataItem,
8275 ) -> Result<(), UpdateMetadataError> {
8276 match d.index {
8277 0..=16 => AbstractFish::apply_metadata(entity, d)?,
8278 17 => {
8279 entity.insert(SalmonKind(d.value.into_int()?));
8280 }
8281 _ => {}
8282 }
8283 Ok(())
8284 }
8285}
8286
8287#[derive(Bundle)]
8291pub struct SalmonMetadataBundle {
8292 _marker: Salmon,
8293 parent: AbstractFishMetadataBundle,
8294 salmon_kind: SalmonKind,
8295}
8296impl Default for SalmonMetadataBundle {
8297 fn default() -> Self {
8298 Self {
8299 _marker: Salmon,
8300 parent: Default::default(),
8301 salmon_kind: SalmonKind(Default::default()),
8302 }
8303 }
8304}
8305
8306#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8308pub struct TropicalFishTypeVariant(pub i32);
8309#[derive(Component)]
8334pub struct TropicalFish;
8335impl TropicalFish {
8336 fn apply_metadata(
8337 entity: &mut bevy_ecs::system::EntityCommands,
8338 d: EntityDataItem,
8339 ) -> Result<(), UpdateMetadataError> {
8340 match d.index {
8341 0..=16 => AbstractFish::apply_metadata(entity, d)?,
8342 17 => {
8343 entity.insert(TropicalFishTypeVariant(d.value.into_int()?));
8344 }
8345 _ => {}
8346 }
8347 Ok(())
8348 }
8349}
8350
8351#[derive(Bundle)]
8355pub struct TropicalFishMetadataBundle {
8356 _marker: TropicalFish,
8357 parent: AbstractFishMetadataBundle,
8358 tropical_fish_type_variant: TropicalFishTypeVariant,
8359}
8360impl Default for TropicalFishMetadataBundle {
8361 fn default() -> Self {
8362 Self {
8363 _marker: TropicalFish,
8364 parent: Default::default(),
8365 tropical_fish_type_variant: TropicalFishTypeVariant(Default::default()),
8366 }
8367 }
8368}
8369
8370#[derive(Component)]
8427pub struct AbstractMonster;
8428impl AbstractMonster {
8429 fn apply_metadata(
8430 entity: &mut bevy_ecs::system::EntityCommands,
8431 d: EntityDataItem,
8432 ) -> Result<(), UpdateMetadataError> {
8433 match d.index {
8434 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
8435 _ => {}
8436 }
8437 Ok(())
8438 }
8439}
8440
8441#[derive(Bundle)]
8445pub struct AbstractMonsterMetadataBundle {
8446 _marker: AbstractMonster,
8447 parent: AbstractCreatureMetadataBundle,
8448}
8449impl Default for AbstractMonsterMetadataBundle {
8450 fn default() -> Self {
8451 Self {
8452 _marker: AbstractMonster,
8453 parent: Default::default(),
8454 }
8455 }
8456}
8457
8458#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
8459pub struct Charged(pub bool);
8461#[derive(Component)]
8485pub struct Blaze;
8486impl Blaze {
8487 fn apply_metadata(
8488 entity: &mut bevy_ecs::system::EntityCommands,
8489 d: EntityDataItem,
8490 ) -> Result<(), UpdateMetadataError> {
8491 match d.index {
8492 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8493 16 => {
8494 let bitfield = d.value.into_byte()?;
8495 entity.insert(Charged(bitfield & 0x1 != 0));
8496 }
8497 _ => {}
8498 }
8499 Ok(())
8500 }
8501}
8502
8503#[derive(Bundle)]
8507pub struct BlazeMetadataBundle {
8508 _marker: Blaze,
8509 parent: AbstractMonsterMetadataBundle,
8510 charged: Charged,
8511}
8512impl Default for BlazeMetadataBundle {
8513 fn default() -> Self {
8514 Self {
8515 _marker: Blaze,
8516 parent: Default::default(),
8517 charged: Charged(false),
8518 }
8519 }
8520}
8521
8522#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8524pub struct BoggedSheared(pub bool);
8525#[derive(Component)]
8549pub struct Bogged;
8550impl Bogged {
8551 fn apply_metadata(
8552 entity: &mut bevy_ecs::system::EntityCommands,
8553 d: EntityDataItem,
8554 ) -> Result<(), UpdateMetadataError> {
8555 match d.index {
8556 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8557 16 => {
8558 entity.insert(BoggedSheared(d.value.into_boolean()?));
8559 }
8560 _ => {}
8561 }
8562 Ok(())
8563 }
8564}
8565
8566#[derive(Bundle)]
8570pub struct BoggedMetadataBundle {
8571 _marker: Bogged,
8572 parent: AbstractMonsterMetadataBundle,
8573 bogged_sheared: BoggedSheared,
8574}
8575impl Default for BoggedMetadataBundle {
8576 fn default() -> Self {
8577 Self {
8578 _marker: Bogged,
8579 parent: Default::default(),
8580 bogged_sheared: BoggedSheared(false),
8581 }
8582 }
8583}
8584
8585#[derive(Component)]
8607pub struct Breeze;
8608impl Breeze {
8609 fn apply_metadata(
8610 entity: &mut bevy_ecs::system::EntityCommands,
8611 d: EntityDataItem,
8612 ) -> Result<(), UpdateMetadataError> {
8613 match d.index {
8614 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8615 _ => {}
8616 }
8617 Ok(())
8618 }
8619}
8620
8621#[derive(Bundle)]
8625pub struct BreezeMetadataBundle {
8626 _marker: Breeze,
8627 parent: AbstractMonsterMetadataBundle,
8628}
8629impl Default for BreezeMetadataBundle {
8630 fn default() -> Self {
8631 Self {
8632 _marker: Breeze,
8633 parent: Default::default(),
8634 }
8635 }
8636}
8637
8638#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8640pub struct CanMove(pub bool);
8641#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8643pub struct IsActive(pub bool);
8644#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8646pub struct IsTearingDown(pub bool);
8647#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8649pub struct HomePos(pub Option<BlockPos>);
8650#[derive(Component)]
8678pub struct Creaking;
8679impl Creaking {
8680 fn apply_metadata(
8681 entity: &mut bevy_ecs::system::EntityCommands,
8682 d: EntityDataItem,
8683 ) -> Result<(), UpdateMetadataError> {
8684 match d.index {
8685 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8686 16 => {
8687 entity.insert(CanMove(d.value.into_boolean()?));
8688 }
8689 17 => {
8690 entity.insert(IsActive(d.value.into_boolean()?));
8691 }
8692 18 => {
8693 entity.insert(IsTearingDown(d.value.into_boolean()?));
8694 }
8695 19 => {
8696 entity.insert(HomePos(d.value.into_optional_block_pos()?));
8697 }
8698 _ => {}
8699 }
8700 Ok(())
8701 }
8702}
8703
8704#[derive(Bundle)]
8708pub struct CreakingMetadataBundle {
8709 _marker: Creaking,
8710 parent: AbstractMonsterMetadataBundle,
8711 can_move: CanMove,
8712 is_active: IsActive,
8713 is_tearing_down: IsTearingDown,
8714 home_pos: HomePos,
8715}
8716impl Default for CreakingMetadataBundle {
8717 fn default() -> Self {
8718 Self {
8719 _marker: Creaking,
8720 parent: Default::default(),
8721 can_move: CanMove(true),
8722 is_active: IsActive(false),
8723 is_tearing_down: IsTearingDown(false),
8724 home_pos: HomePos(None),
8725 }
8726 }
8727}
8728
8729#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8731pub struct SwellDir(pub i32);
8732#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8734pub struct IsPowered(pub bool);
8735#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8737pub struct IsIgnited(pub bool);
8738#[derive(Component)]
8764pub struct Creeper;
8765impl Creeper {
8766 fn apply_metadata(
8767 entity: &mut bevy_ecs::system::EntityCommands,
8768 d: EntityDataItem,
8769 ) -> Result<(), UpdateMetadataError> {
8770 match d.index {
8771 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8772 16 => {
8773 entity.insert(SwellDir(d.value.into_int()?));
8774 }
8775 17 => {
8776 entity.insert(IsPowered(d.value.into_boolean()?));
8777 }
8778 18 => {
8779 entity.insert(IsIgnited(d.value.into_boolean()?));
8780 }
8781 _ => {}
8782 }
8783 Ok(())
8784 }
8785}
8786
8787#[derive(Bundle)]
8791pub struct CreeperMetadataBundle {
8792 _marker: Creeper,
8793 parent: AbstractMonsterMetadataBundle,
8794 swell_dir: SwellDir,
8795 is_powered: IsPowered,
8796 is_ignited: IsIgnited,
8797}
8798impl Default for CreeperMetadataBundle {
8799 fn default() -> Self {
8800 Self {
8801 _marker: Creeper,
8802 parent: Default::default(),
8803 swell_dir: SwellDir(-1),
8804 is_powered: IsPowered(false),
8805 is_ignited: IsIgnited(false),
8806 }
8807 }
8808}
8809
8810#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8812pub struct CarryState(pub azalea_block::BlockState);
8813#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8815pub struct Creepy(pub bool);
8816#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8818pub struct StaredAt(pub bool);
8819#[derive(Component)]
8846pub struct Enderman;
8847impl Enderman {
8848 fn apply_metadata(
8849 entity: &mut bevy_ecs::system::EntityCommands,
8850 d: EntityDataItem,
8851 ) -> Result<(), UpdateMetadataError> {
8852 match d.index {
8853 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8854 16 => {
8855 entity.insert(CarryState(d.value.into_optional_block_state()?));
8856 }
8857 17 => {
8858 entity.insert(Creepy(d.value.into_boolean()?));
8859 }
8860 18 => {
8861 entity.insert(StaredAt(d.value.into_boolean()?));
8862 }
8863 _ => {}
8864 }
8865 Ok(())
8866 }
8867}
8868
8869#[derive(Bundle)]
8873pub struct EndermanMetadataBundle {
8874 _marker: Enderman,
8875 parent: AbstractMonsterMetadataBundle,
8876 carry_state: CarryState,
8877 creepy: Creepy,
8878 stared_at: StaredAt,
8879}
8880impl Default for EndermanMetadataBundle {
8881 fn default() -> Self {
8882 Self {
8883 _marker: Enderman,
8884 parent: Default::default(),
8885 carry_state: CarryState(azalea_block::BlockState::AIR),
8886 creepy: Creepy(false),
8887 stared_at: StaredAt(false),
8888 }
8889 }
8890}
8891
8892#[derive(Component)]
8914pub struct Endermite;
8915impl Endermite {
8916 fn apply_metadata(
8917 entity: &mut bevy_ecs::system::EntityCommands,
8918 d: EntityDataItem,
8919 ) -> Result<(), UpdateMetadataError> {
8920 match d.index {
8921 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8922 _ => {}
8923 }
8924 Ok(())
8925 }
8926}
8927
8928#[derive(Bundle)]
8932pub struct EndermiteMetadataBundle {
8933 _marker: Endermite,
8934 parent: AbstractMonsterMetadataBundle,
8935}
8936impl Default for EndermiteMetadataBundle {
8937 fn default() -> Self {
8938 Self {
8939 _marker: Endermite,
8940 parent: Default::default(),
8941 }
8942 }
8943}
8944
8945#[derive(Component)]
8967pub struct Giant;
8968impl Giant {
8969 fn apply_metadata(
8970 entity: &mut bevy_ecs::system::EntityCommands,
8971 d: EntityDataItem,
8972 ) -> Result<(), UpdateMetadataError> {
8973 match d.index {
8974 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
8975 _ => {}
8976 }
8977 Ok(())
8978 }
8979}
8980
8981#[derive(Bundle)]
8985pub struct GiantMetadataBundle {
8986 _marker: Giant,
8987 parent: AbstractMonsterMetadataBundle,
8988}
8989impl Default for GiantMetadataBundle {
8990 fn default() -> Self {
8991 Self {
8992 _marker: Giant,
8993 parent: Default::default(),
8994 }
8995 }
8996}
8997
8998#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9000pub struct Moving(pub bool);
9001#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9003pub struct AttackTarget(pub i32);
9004#[derive(Component)]
9030pub struct Guardian;
9031impl Guardian {
9032 fn apply_metadata(
9033 entity: &mut bevy_ecs::system::EntityCommands,
9034 d: EntityDataItem,
9035 ) -> Result<(), UpdateMetadataError> {
9036 match d.index {
9037 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9038 16 => {
9039 entity.insert(Moving(d.value.into_boolean()?));
9040 }
9041 17 => {
9042 entity.insert(AttackTarget(d.value.into_int()?));
9043 }
9044 _ => {}
9045 }
9046 Ok(())
9047 }
9048}
9049
9050#[derive(Bundle)]
9054pub struct GuardianMetadataBundle {
9055 _marker: Guardian,
9056 parent: AbstractMonsterMetadataBundle,
9057 moving: Moving,
9058 attack_target: AttackTarget,
9059}
9060impl Default for GuardianMetadataBundle {
9061 fn default() -> Self {
9062 Self {
9063 _marker: Guardian,
9064 parent: Default::default(),
9065 moving: Moving(false),
9066 attack_target: AttackTarget(0),
9067 }
9068 }
9069}
9070
9071#[derive(Component)]
9094pub struct ElderGuardian;
9095impl ElderGuardian {
9096 fn apply_metadata(
9097 entity: &mut bevy_ecs::system::EntityCommands,
9098 d: EntityDataItem,
9099 ) -> Result<(), UpdateMetadataError> {
9100 match d.index {
9101 0..=17 => Guardian::apply_metadata(entity, d)?,
9102 _ => {}
9103 }
9104 Ok(())
9105 }
9106}
9107
9108#[derive(Bundle)]
9112pub struct ElderGuardianMetadataBundle {
9113 _marker: ElderGuardian,
9114 parent: GuardianMetadataBundle,
9115}
9116impl Default for ElderGuardianMetadataBundle {
9117 fn default() -> Self {
9118 Self {
9119 _marker: ElderGuardian,
9120 parent: Default::default(),
9121 }
9122 }
9123}
9124
9125#[derive(Component)]
9147pub struct Parched;
9148impl Parched {
9149 fn apply_metadata(
9150 entity: &mut bevy_ecs::system::EntityCommands,
9151 d: EntityDataItem,
9152 ) -> Result<(), UpdateMetadataError> {
9153 match d.index {
9154 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9155 _ => {}
9156 }
9157 Ok(())
9158 }
9159}
9160
9161#[derive(Bundle)]
9165pub struct ParchedMetadataBundle {
9166 _marker: Parched,
9167 parent: AbstractMonsterMetadataBundle,
9168}
9169impl Default for ParchedMetadataBundle {
9170 fn default() -> Self {
9171 Self {
9172 _marker: Parched,
9173 parent: Default::default(),
9174 }
9175 }
9176}
9177
9178#[derive(Component)]
9200pub struct Silverfish;
9201impl Silverfish {
9202 fn apply_metadata(
9203 entity: &mut bevy_ecs::system::EntityCommands,
9204 d: EntityDataItem,
9205 ) -> Result<(), UpdateMetadataError> {
9206 match d.index {
9207 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9208 _ => {}
9209 }
9210 Ok(())
9211 }
9212}
9213
9214#[derive(Bundle)]
9218pub struct SilverfishMetadataBundle {
9219 _marker: Silverfish,
9220 parent: AbstractMonsterMetadataBundle,
9221}
9222impl Default for SilverfishMetadataBundle {
9223 fn default() -> Self {
9224 Self {
9225 _marker: Silverfish,
9226 parent: Default::default(),
9227 }
9228 }
9229}
9230
9231#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9233pub struct StrayConversion(pub bool);
9234#[derive(Component)]
9259pub struct Skeleton;
9260impl Skeleton {
9261 fn apply_metadata(
9262 entity: &mut bevy_ecs::system::EntityCommands,
9263 d: EntityDataItem,
9264 ) -> Result<(), UpdateMetadataError> {
9265 match d.index {
9266 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9267 16 => {
9268 entity.insert(StrayConversion(d.value.into_boolean()?));
9269 }
9270 _ => {}
9271 }
9272 Ok(())
9273 }
9274}
9275
9276#[derive(Bundle)]
9280pub struct SkeletonMetadataBundle {
9281 _marker: Skeleton,
9282 parent: AbstractMonsterMetadataBundle,
9283 stray_conversion: StrayConversion,
9284}
9285impl Default for SkeletonMetadataBundle {
9286 fn default() -> Self {
9287 Self {
9288 _marker: Skeleton,
9289 parent: Default::default(),
9290 stray_conversion: StrayConversion(false),
9291 }
9292 }
9293}
9294
9295#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
9296pub struct Climbing(pub bool);
9298#[derive(Component)]
9322pub struct Spider;
9323impl Spider {
9324 fn apply_metadata(
9325 entity: &mut bevy_ecs::system::EntityCommands,
9326 d: EntityDataItem,
9327 ) -> Result<(), UpdateMetadataError> {
9328 match d.index {
9329 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9330 16 => {
9331 let bitfield = d.value.into_byte()?;
9332 entity.insert(Climbing(bitfield & 0x1 != 0));
9333 }
9334 _ => {}
9335 }
9336 Ok(())
9337 }
9338}
9339
9340#[derive(Bundle)]
9344pub struct SpiderMetadataBundle {
9345 _marker: Spider,
9346 parent: AbstractMonsterMetadataBundle,
9347 climbing: Climbing,
9348}
9349impl Default for SpiderMetadataBundle {
9350 fn default() -> Self {
9351 Self {
9352 _marker: Spider,
9353 parent: Default::default(),
9354 climbing: Climbing(false),
9355 }
9356 }
9357}
9358
9359#[derive(Component)]
9382pub struct CaveSpider;
9383impl CaveSpider {
9384 fn apply_metadata(
9385 entity: &mut bevy_ecs::system::EntityCommands,
9386 d: EntityDataItem,
9387 ) -> Result<(), UpdateMetadataError> {
9388 match d.index {
9389 0..=16 => Spider::apply_metadata(entity, d)?,
9390 _ => {}
9391 }
9392 Ok(())
9393 }
9394}
9395
9396#[derive(Bundle)]
9400pub struct CaveSpiderMetadataBundle {
9401 _marker: CaveSpider,
9402 parent: SpiderMetadataBundle,
9403}
9404impl Default for CaveSpiderMetadataBundle {
9405 fn default() -> Self {
9406 Self {
9407 _marker: CaveSpider,
9408 parent: Default::default(),
9409 }
9410 }
9411}
9412
9413#[derive(Component)]
9435pub struct Stray;
9436impl Stray {
9437 fn apply_metadata(
9438 entity: &mut bevy_ecs::system::EntityCommands,
9439 d: EntityDataItem,
9440 ) -> Result<(), UpdateMetadataError> {
9441 match d.index {
9442 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9443 _ => {}
9444 }
9445 Ok(())
9446 }
9447}
9448
9449#[derive(Bundle)]
9453pub struct StrayMetadataBundle {
9454 _marker: Stray,
9455 parent: AbstractMonsterMetadataBundle,
9456}
9457impl Default for StrayMetadataBundle {
9458 fn default() -> Self {
9459 Self {
9460 _marker: Stray,
9461 parent: Default::default(),
9462 }
9463 }
9464}
9465
9466#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9468pub struct VexFlags(pub u8);
9469#[derive(Component)]
9493pub struct Vex;
9494impl Vex {
9495 fn apply_metadata(
9496 entity: &mut bevy_ecs::system::EntityCommands,
9497 d: EntityDataItem,
9498 ) -> Result<(), UpdateMetadataError> {
9499 match d.index {
9500 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9501 16 => {
9502 entity.insert(VexFlags(d.value.into_byte()?));
9503 }
9504 _ => {}
9505 }
9506 Ok(())
9507 }
9508}
9509
9510#[derive(Bundle)]
9514pub struct VexMetadataBundle {
9515 _marker: Vex,
9516 parent: AbstractMonsterMetadataBundle,
9517 vex_flags: VexFlags,
9518}
9519impl Default for VexMetadataBundle {
9520 fn default() -> Self {
9521 Self {
9522 _marker: Vex,
9523 parent: Default::default(),
9524 vex_flags: VexFlags(0),
9525 }
9526 }
9527}
9528
9529#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9531pub struct ClientAngerLevel(pub i32);
9532#[derive(Component)]
9556pub struct Warden;
9557impl Warden {
9558 fn apply_metadata(
9559 entity: &mut bevy_ecs::system::EntityCommands,
9560 d: EntityDataItem,
9561 ) -> Result<(), UpdateMetadataError> {
9562 match d.index {
9563 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9564 16 => {
9565 entity.insert(ClientAngerLevel(d.value.into_int()?));
9566 }
9567 _ => {}
9568 }
9569 Ok(())
9570 }
9571}
9572
9573#[derive(Bundle)]
9577pub struct WardenMetadataBundle {
9578 _marker: Warden,
9579 parent: AbstractMonsterMetadataBundle,
9580 client_anger_level: ClientAngerLevel,
9581}
9582impl Default for WardenMetadataBundle {
9583 fn default() -> Self {
9584 Self {
9585 _marker: Warden,
9586 parent: Default::default(),
9587 client_anger_level: ClientAngerLevel(0),
9588 }
9589 }
9590}
9591
9592#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9594pub struct TargetA(pub i32);
9595#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9597pub struct TargetB(pub i32);
9598#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9600pub struct TargetC(pub i32);
9601#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9603pub struct Inv(pub i32);
9604#[derive(Component)]
9631pub struct Wither;
9632impl Wither {
9633 fn apply_metadata(
9634 entity: &mut bevy_ecs::system::EntityCommands,
9635 d: EntityDataItem,
9636 ) -> Result<(), UpdateMetadataError> {
9637 match d.index {
9638 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9639 16 => {
9640 entity.insert(TargetA(d.value.into_int()?));
9641 }
9642 17 => {
9643 entity.insert(TargetB(d.value.into_int()?));
9644 }
9645 18 => {
9646 entity.insert(TargetC(d.value.into_int()?));
9647 }
9648 19 => {
9649 entity.insert(Inv(d.value.into_int()?));
9650 }
9651 _ => {}
9652 }
9653 Ok(())
9654 }
9655}
9656
9657#[derive(Bundle)]
9661pub struct WitherMetadataBundle {
9662 _marker: Wither,
9663 parent: AbstractMonsterMetadataBundle,
9664 target_a: TargetA,
9665 target_b: TargetB,
9666 target_c: TargetC,
9667 inv: Inv,
9668}
9669impl Default for WitherMetadataBundle {
9670 fn default() -> Self {
9671 Self {
9672 _marker: Wither,
9673 parent: Default::default(),
9674 target_a: TargetA(0),
9675 target_b: TargetB(0),
9676 target_c: TargetC(0),
9677 inv: Inv(0),
9678 }
9679 }
9680}
9681
9682#[derive(Component)]
9704pub struct WitherSkeleton;
9705impl WitherSkeleton {
9706 fn apply_metadata(
9707 entity: &mut bevy_ecs::system::EntityCommands,
9708 d: EntityDataItem,
9709 ) -> Result<(), UpdateMetadataError> {
9710 match d.index {
9711 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9712 _ => {}
9713 }
9714 Ok(())
9715 }
9716}
9717
9718#[derive(Bundle)]
9722pub struct WitherSkeletonMetadataBundle {
9723 _marker: WitherSkeleton,
9724 parent: AbstractMonsterMetadataBundle,
9725}
9726impl Default for WitherSkeletonMetadataBundle {
9727 fn default() -> Self {
9728 Self {
9729 _marker: WitherSkeleton,
9730 parent: Default::default(),
9731 }
9732 }
9733}
9734
9735#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9737pub struct ZoglinBaby(pub bool);
9738#[derive(Component)]
9762pub struct Zoglin;
9763impl Zoglin {
9764 fn apply_metadata(
9765 entity: &mut bevy_ecs::system::EntityCommands,
9766 d: EntityDataItem,
9767 ) -> Result<(), UpdateMetadataError> {
9768 match d.index {
9769 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9770 16 => {
9771 entity.insert(ZoglinBaby(d.value.into_boolean()?));
9772 }
9773 _ => {}
9774 }
9775 Ok(())
9776 }
9777}
9778
9779#[derive(Bundle)]
9783pub struct ZoglinMetadataBundle {
9784 _marker: Zoglin,
9785 parent: AbstractMonsterMetadataBundle,
9786 zoglin_baby: ZoglinBaby,
9787}
9788impl Default for ZoglinMetadataBundle {
9789 fn default() -> Self {
9790 Self {
9791 _marker: Zoglin,
9792 parent: Default::default(),
9793 zoglin_baby: ZoglinBaby(false),
9794 }
9795 }
9796}
9797
9798#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9800pub struct ZombieBaby(pub bool);
9801#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9803pub struct SpecialType(pub i32);
9804#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9806pub struct DrownedConversion(pub bool);
9807#[derive(Component)]
9836pub struct Zombie;
9837impl Zombie {
9838 fn apply_metadata(
9839 entity: &mut bevy_ecs::system::EntityCommands,
9840 d: EntityDataItem,
9841 ) -> Result<(), UpdateMetadataError> {
9842 match d.index {
9843 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9844 16 => {
9845 entity.insert(ZombieBaby(d.value.into_boolean()?));
9846 }
9847 17 => {
9848 entity.insert(SpecialType(d.value.into_int()?));
9849 }
9850 18 => {
9851 entity.insert(DrownedConversion(d.value.into_boolean()?));
9852 }
9853 _ => {}
9854 }
9855 Ok(())
9856 }
9857}
9858
9859#[derive(Bundle)]
9863pub struct ZombieMetadataBundle {
9864 _marker: Zombie,
9865 parent: AbstractMonsterMetadataBundle,
9866 zombie_baby: ZombieBaby,
9867 special_type: SpecialType,
9868 drowned_conversion: DrownedConversion,
9869}
9870impl Default for ZombieMetadataBundle {
9871 fn default() -> Self {
9872 Self {
9873 _marker: Zombie,
9874 parent: Default::default(),
9875 zombie_baby: ZombieBaby(false),
9876 special_type: SpecialType(0),
9877 drowned_conversion: DrownedConversion(false),
9878 }
9879 }
9880}
9881
9882#[derive(Component)]
9905pub struct Drowned;
9906impl Drowned {
9907 fn apply_metadata(
9908 entity: &mut bevy_ecs::system::EntityCommands,
9909 d: EntityDataItem,
9910 ) -> Result<(), UpdateMetadataError> {
9911 match d.index {
9912 0..=18 => Zombie::apply_metadata(entity, d)?,
9913 _ => {}
9914 }
9915 Ok(())
9916 }
9917}
9918
9919#[derive(Bundle)]
9923pub struct DrownedMetadataBundle {
9924 _marker: Drowned,
9925 parent: ZombieMetadataBundle,
9926}
9927impl Default for DrownedMetadataBundle {
9928 fn default() -> Self {
9929 Self {
9930 _marker: Drowned,
9931 parent: Default::default(),
9932 }
9933 }
9934}
9935
9936#[derive(Component)]
9959pub struct Husk;
9960impl Husk {
9961 fn apply_metadata(
9962 entity: &mut bevy_ecs::system::EntityCommands,
9963 d: EntityDataItem,
9964 ) -> Result<(), UpdateMetadataError> {
9965 match d.index {
9966 0..=18 => Zombie::apply_metadata(entity, d)?,
9967 _ => {}
9968 }
9969 Ok(())
9970 }
9971}
9972
9973#[derive(Bundle)]
9977pub struct HuskMetadataBundle {
9978 _marker: Husk,
9979 parent: ZombieMetadataBundle,
9980}
9981impl Default for HuskMetadataBundle {
9982 fn default() -> Self {
9983 Self {
9984 _marker: Husk,
9985 parent: Default::default(),
9986 }
9987 }
9988}
9989
9990#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9992pub struct Converting(pub bool);
9993#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9995pub struct ZombieVillagerVillagerData(pub VillagerData);
9996#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9998pub struct ZombieVillagerVillagerDataFinalized(pub bool);
9999#[derive(Component)]
10027pub struct ZombieVillager;
10028impl ZombieVillager {
10029 fn apply_metadata(
10030 entity: &mut bevy_ecs::system::EntityCommands,
10031 d: EntityDataItem,
10032 ) -> Result<(), UpdateMetadataError> {
10033 match d.index {
10034 0..=18 => Zombie::apply_metadata(entity, d)?,
10035 19 => {
10036 entity.insert(Converting(d.value.into_boolean()?));
10037 }
10038 20 => {
10039 entity.insert(ZombieVillagerVillagerData(d.value.into_villager_data()?));
10040 }
10041 21 => {
10042 entity.insert(ZombieVillagerVillagerDataFinalized(d.value.into_boolean()?));
10043 }
10044 _ => {}
10045 }
10046 Ok(())
10047 }
10048}
10049
10050#[derive(Bundle)]
10054pub struct ZombieVillagerMetadataBundle {
10055 _marker: ZombieVillager,
10056 parent: ZombieMetadataBundle,
10057 converting: Converting,
10058 zombie_villager_villager_data: ZombieVillagerVillagerData,
10059 zombie_villager_villager_data_finalized: ZombieVillagerVillagerDataFinalized,
10060}
10061impl Default for ZombieVillagerMetadataBundle {
10062 fn default() -> Self {
10063 Self {
10064 _marker: ZombieVillager,
10065 parent: Default::default(),
10066 converting: Converting(false),
10067 zombie_villager_villager_data: ZombieVillagerVillagerData(VillagerData {
10068 kind: azalea_registry::builtin::VillagerKind::Plains,
10069 profession: azalea_registry::builtin::VillagerProfession::None,
10070 level: 0,
10071 }),
10072 zombie_villager_villager_data_finalized: ZombieVillagerVillagerDataFinalized(false),
10073 }
10074 }
10075}
10076
10077#[derive(Component)]
10100pub struct ZombifiedPiglin;
10101impl ZombifiedPiglin {
10102 fn apply_metadata(
10103 entity: &mut bevy_ecs::system::EntityCommands,
10104 d: EntityDataItem,
10105 ) -> Result<(), UpdateMetadataError> {
10106 match d.index {
10107 0..=18 => Zombie::apply_metadata(entity, d)?,
10108 _ => {}
10109 }
10110 Ok(())
10111 }
10112}
10113
10114#[derive(Bundle)]
10118pub struct ZombifiedPiglinMetadataBundle {
10119 _marker: ZombifiedPiglin,
10120 parent: ZombieMetadataBundle,
10121}
10122impl Default for ZombifiedPiglinMetadataBundle {
10123 fn default() -> Self {
10124 Self {
10125 _marker: ZombifiedPiglin,
10126 parent: Default::default(),
10127 }
10128 }
10129}
10130
10131#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10133pub struct AbstractPiglinImmuneToZombification(pub bool);
10134#[derive(Component)]
10160pub struct AbstractPiglin;
10161impl AbstractPiglin {
10162 fn apply_metadata(
10163 entity: &mut bevy_ecs::system::EntityCommands,
10164 d: EntityDataItem,
10165 ) -> Result<(), UpdateMetadataError> {
10166 match d.index {
10167 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
10168 16 => {
10169 entity.insert(AbstractPiglinImmuneToZombification(d.value.into_boolean()?));
10170 }
10171 _ => {}
10172 }
10173 Ok(())
10174 }
10175}
10176
10177#[derive(Bundle)]
10181pub struct AbstractPiglinMetadataBundle {
10182 _marker: AbstractPiglin,
10183 parent: AbstractMonsterMetadataBundle,
10184 abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification,
10185}
10186impl Default for AbstractPiglinMetadataBundle {
10187 fn default() -> Self {
10188 Self {
10189 _marker: AbstractPiglin,
10190 parent: Default::default(),
10191 abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification(false),
10192 }
10193 }
10194}
10195
10196#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10198pub struct PiglinBaby(pub bool);
10199#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10201pub struct PiglinIsChargingCrossbow(pub bool);
10202#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10204pub struct IsDancing(pub bool);
10205#[derive(Component)]
10232pub struct Piglin;
10233impl Piglin {
10234 fn apply_metadata(
10235 entity: &mut bevy_ecs::system::EntityCommands,
10236 d: EntityDataItem,
10237 ) -> Result<(), UpdateMetadataError> {
10238 match d.index {
10239 0..=16 => AbstractPiglin::apply_metadata(entity, d)?,
10240 17 => {
10241 entity.insert(PiglinBaby(d.value.into_boolean()?));
10242 }
10243 18 => {
10244 entity.insert(PiglinIsChargingCrossbow(d.value.into_boolean()?));
10245 }
10246 19 => {
10247 entity.insert(IsDancing(d.value.into_boolean()?));
10248 }
10249 _ => {}
10250 }
10251 Ok(())
10252 }
10253}
10254
10255#[derive(Bundle)]
10259pub struct PiglinMetadataBundle {
10260 _marker: Piglin,
10261 parent: AbstractPiglinMetadataBundle,
10262 piglin_baby: PiglinBaby,
10263 piglin_is_charging_crossbow: PiglinIsChargingCrossbow,
10264 is_dancing: IsDancing,
10265}
10266impl Default for PiglinMetadataBundle {
10267 fn default() -> Self {
10268 Self {
10269 _marker: Piglin,
10270 parent: Default::default(),
10271 piglin_baby: PiglinBaby(false),
10272 piglin_is_charging_crossbow: PiglinIsChargingCrossbow(false),
10273 is_dancing: IsDancing(false),
10274 }
10275 }
10276}
10277
10278#[derive(Component)]
10301pub struct PiglinBrute;
10302impl PiglinBrute {
10303 fn apply_metadata(
10304 entity: &mut bevy_ecs::system::EntityCommands,
10305 d: EntityDataItem,
10306 ) -> Result<(), UpdateMetadataError> {
10307 match d.index {
10308 0..=16 => AbstractPiglin::apply_metadata(entity, d)?,
10309 _ => {}
10310 }
10311 Ok(())
10312 }
10313}
10314
10315#[derive(Bundle)]
10319pub struct PiglinBruteMetadataBundle {
10320 _marker: PiglinBrute,
10321 parent: AbstractPiglinMetadataBundle,
10322}
10323impl Default for PiglinBruteMetadataBundle {
10324 fn default() -> Self {
10325 Self {
10326 _marker: PiglinBrute,
10327 parent: Default::default(),
10328 }
10329 }
10330}
10331
10332#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10334pub struct IsCelebrating(pub bool);
10335#[derive(Component)]
10366pub struct AbstractRaider;
10367impl AbstractRaider {
10368 fn apply_metadata(
10369 entity: &mut bevy_ecs::system::EntityCommands,
10370 d: EntityDataItem,
10371 ) -> Result<(), UpdateMetadataError> {
10372 match d.index {
10373 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
10374 16 => {
10375 entity.insert(IsCelebrating(d.value.into_boolean()?));
10376 }
10377 _ => {}
10378 }
10379 Ok(())
10380 }
10381}
10382
10383#[derive(Bundle)]
10387pub struct AbstractRaiderMetadataBundle {
10388 _marker: AbstractRaider,
10389 parent: AbstractMonsterMetadataBundle,
10390 is_celebrating: IsCelebrating,
10391}
10392impl Default for AbstractRaiderMetadataBundle {
10393 fn default() -> Self {
10394 Self {
10395 _marker: AbstractRaider,
10396 parent: Default::default(),
10397 is_celebrating: IsCelebrating(false),
10398 }
10399 }
10400}
10401
10402#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10404pub struct PillagerIsChargingCrossbow(pub bool);
10405#[derive(Component)]
10431pub struct Pillager;
10432impl Pillager {
10433 fn apply_metadata(
10434 entity: &mut bevy_ecs::system::EntityCommands,
10435 d: EntityDataItem,
10436 ) -> Result<(), UpdateMetadataError> {
10437 match d.index {
10438 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
10439 17 => {
10440 entity.insert(PillagerIsChargingCrossbow(d.value.into_boolean()?));
10441 }
10442 _ => {}
10443 }
10444 Ok(())
10445 }
10446}
10447
10448#[derive(Bundle)]
10452pub struct PillagerMetadataBundle {
10453 _marker: Pillager,
10454 parent: AbstractRaiderMetadataBundle,
10455 pillager_is_charging_crossbow: PillagerIsChargingCrossbow,
10456}
10457impl Default for PillagerMetadataBundle {
10458 fn default() -> Self {
10459 Self {
10460 _marker: Pillager,
10461 parent: Default::default(),
10462 pillager_is_charging_crossbow: PillagerIsChargingCrossbow(false),
10463 }
10464 }
10465}
10466
10467#[derive(Component)]
10490pub struct Ravager;
10491impl Ravager {
10492 fn apply_metadata(
10493 entity: &mut bevy_ecs::system::EntityCommands,
10494 d: EntityDataItem,
10495 ) -> Result<(), UpdateMetadataError> {
10496 match d.index {
10497 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
10498 _ => {}
10499 }
10500 Ok(())
10501 }
10502}
10503
10504#[derive(Bundle)]
10508pub struct RavagerMetadataBundle {
10509 _marker: Ravager,
10510 parent: AbstractRaiderMetadataBundle,
10511}
10512impl Default for RavagerMetadataBundle {
10513 fn default() -> Self {
10514 Self {
10515 _marker: Ravager,
10516 parent: Default::default(),
10517 }
10518 }
10519}
10520
10521#[derive(Component)]
10544pub struct Vindicator;
10545impl Vindicator {
10546 fn apply_metadata(
10547 entity: &mut bevy_ecs::system::EntityCommands,
10548 d: EntityDataItem,
10549 ) -> Result<(), UpdateMetadataError> {
10550 match d.index {
10551 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
10552 _ => {}
10553 }
10554 Ok(())
10555 }
10556}
10557
10558#[derive(Bundle)]
10562pub struct VindicatorMetadataBundle {
10563 _marker: Vindicator,
10564 parent: AbstractRaiderMetadataBundle,
10565}
10566impl Default for VindicatorMetadataBundle {
10567 fn default() -> Self {
10568 Self {
10569 _marker: Vindicator,
10570 parent: Default::default(),
10571 }
10572 }
10573}
10574
10575#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10577pub struct WitchUsingItem(pub bool);
10578#[derive(Component)]
10603pub struct Witch;
10604impl Witch {
10605 fn apply_metadata(
10606 entity: &mut bevy_ecs::system::EntityCommands,
10607 d: EntityDataItem,
10608 ) -> Result<(), UpdateMetadataError> {
10609 match d.index {
10610 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
10611 17 => {
10612 entity.insert(WitchUsingItem(d.value.into_boolean()?));
10613 }
10614 _ => {}
10615 }
10616 Ok(())
10617 }
10618}
10619
10620#[derive(Bundle)]
10624pub struct WitchMetadataBundle {
10625 _marker: Witch,
10626 parent: AbstractRaiderMetadataBundle,
10627 witch_using_item: WitchUsingItem,
10628}
10629impl Default for WitchMetadataBundle {
10630 fn default() -> Self {
10631 Self {
10632 _marker: Witch,
10633 parent: Default::default(),
10634 witch_using_item: WitchUsingItem(false),
10635 }
10636 }
10637}
10638
10639#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10641pub struct SpellCasting(pub u8);
10642#[derive(Component)]
10669pub struct AbstractSpellcasterIllager;
10670impl AbstractSpellcasterIllager {
10671 fn apply_metadata(
10672 entity: &mut bevy_ecs::system::EntityCommands,
10673 d: EntityDataItem,
10674 ) -> Result<(), UpdateMetadataError> {
10675 match d.index {
10676 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
10677 17 => {
10678 entity.insert(SpellCasting(d.value.into_byte()?));
10679 }
10680 _ => {}
10681 }
10682 Ok(())
10683 }
10684}
10685
10686#[derive(Bundle)]
10690pub struct AbstractSpellcasterIllagerMetadataBundle {
10691 _marker: AbstractSpellcasterIllager,
10692 parent: AbstractRaiderMetadataBundle,
10693 spell_casting: SpellCasting,
10694}
10695impl Default for AbstractSpellcasterIllagerMetadataBundle {
10696 fn default() -> Self {
10697 Self {
10698 _marker: AbstractSpellcasterIllager,
10699 parent: Default::default(),
10700 spell_casting: SpellCasting(0),
10701 }
10702 }
10703}
10704
10705#[derive(Component)]
10729pub struct Evoker;
10730impl Evoker {
10731 fn apply_metadata(
10732 entity: &mut bevy_ecs::system::EntityCommands,
10733 d: EntityDataItem,
10734 ) -> Result<(), UpdateMetadataError> {
10735 match d.index {
10736 0..=17 => AbstractSpellcasterIllager::apply_metadata(entity, d)?,
10737 _ => {}
10738 }
10739 Ok(())
10740 }
10741}
10742
10743#[derive(Bundle)]
10747pub struct EvokerMetadataBundle {
10748 _marker: Evoker,
10749 parent: AbstractSpellcasterIllagerMetadataBundle,
10750}
10751impl Default for EvokerMetadataBundle {
10752 fn default() -> Self {
10753 Self {
10754 _marker: Evoker,
10755 parent: Default::default(),
10756 }
10757 }
10758}
10759
10760#[derive(Component)]
10784pub struct Illusioner;
10785impl Illusioner {
10786 fn apply_metadata(
10787 entity: &mut bevy_ecs::system::EntityCommands,
10788 d: EntityDataItem,
10789 ) -> Result<(), UpdateMetadataError> {
10790 match d.index {
10791 0..=17 => AbstractSpellcasterIllager::apply_metadata(entity, d)?,
10792 _ => {}
10793 }
10794 Ok(())
10795 }
10796}
10797
10798#[derive(Bundle)]
10802pub struct IllusionerMetadataBundle {
10803 _marker: Illusioner,
10804 parent: AbstractSpellcasterIllagerMetadataBundle,
10805}
10806impl Default for IllusionerMetadataBundle {
10807 fn default() -> Self {
10808 Self {
10809 _marker: Illusioner,
10810 parent: Default::default(),
10811 }
10812 }
10813}
10814
10815#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10817pub struct AbstractThrownItemProjectileItemStack(pub ItemStack);
10818#[derive(Component)]
10844pub struct AbstractThrownItemProjectile;
10845impl AbstractThrownItemProjectile {
10846 fn apply_metadata(
10847 entity: &mut bevy_ecs::system::EntityCommands,
10848 d: EntityDataItem,
10849 ) -> Result<(), UpdateMetadataError> {
10850 match d.index {
10851 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
10852 8 => {
10853 entity.insert(AbstractThrownItemProjectileItemStack(
10854 d.value.into_item_stack()?,
10855 ));
10856 }
10857 _ => {}
10858 }
10859 Ok(())
10860 }
10861}
10862
10863#[derive(Bundle)]
10867pub struct AbstractThrownItemProjectileMetadataBundle {
10868 _marker: AbstractThrownItemProjectile,
10869 parent: AbstractEntityMetadataBundle,
10870 abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack,
10871}
10872impl Default for AbstractThrownItemProjectileMetadataBundle {
10873 fn default() -> Self {
10874 Self {
10875 _marker: AbstractThrownItemProjectile,
10876 parent: Default::default(),
10877 abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack(
10878 Default::default(),
10879 ),
10880 }
10881 }
10882}
10883
10884#[derive(Component)]
10903pub struct Egg;
10904impl Egg {
10905 fn apply_metadata(
10906 entity: &mut bevy_ecs::system::EntityCommands,
10907 d: EntityDataItem,
10908 ) -> Result<(), UpdateMetadataError> {
10909 match d.index {
10910 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
10911 _ => {}
10912 }
10913 Ok(())
10914 }
10915}
10916
10917#[derive(Bundle)]
10921pub struct EggMetadataBundle {
10922 _marker: Egg,
10923 parent: AbstractThrownItemProjectileMetadataBundle,
10924}
10925impl Default for EggMetadataBundle {
10926 fn default() -> Self {
10927 Self {
10928 _marker: Egg,
10929 parent: Default::default(),
10930 }
10931 }
10932}
10933
10934#[derive(Component)]
10953pub struct EnderPearl;
10954impl EnderPearl {
10955 fn apply_metadata(
10956 entity: &mut bevy_ecs::system::EntityCommands,
10957 d: EntityDataItem,
10958 ) -> Result<(), UpdateMetadataError> {
10959 match d.index {
10960 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
10961 _ => {}
10962 }
10963 Ok(())
10964 }
10965}
10966
10967#[derive(Bundle)]
10971pub struct EnderPearlMetadataBundle {
10972 _marker: EnderPearl,
10973 parent: AbstractThrownItemProjectileMetadataBundle,
10974}
10975impl Default for EnderPearlMetadataBundle {
10976 fn default() -> Self {
10977 Self {
10978 _marker: EnderPearl,
10979 parent: Default::default(),
10980 }
10981 }
10982}
10983
10984#[derive(Component)]
11003pub struct ExperienceBottle;
11004impl ExperienceBottle {
11005 fn apply_metadata(
11006 entity: &mut bevy_ecs::system::EntityCommands,
11007 d: EntityDataItem,
11008 ) -> Result<(), UpdateMetadataError> {
11009 match d.index {
11010 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
11011 _ => {}
11012 }
11013 Ok(())
11014 }
11015}
11016
11017#[derive(Bundle)]
11021pub struct ExperienceBottleMetadataBundle {
11022 _marker: ExperienceBottle,
11023 parent: AbstractThrownItemProjectileMetadataBundle,
11024}
11025impl Default for ExperienceBottleMetadataBundle {
11026 fn default() -> Self {
11027 Self {
11028 _marker: ExperienceBottle,
11029 parent: Default::default(),
11030 }
11031 }
11032}
11033
11034#[derive(Component)]
11053pub struct LingeringPotion;
11054impl LingeringPotion {
11055 fn apply_metadata(
11056 entity: &mut bevy_ecs::system::EntityCommands,
11057 d: EntityDataItem,
11058 ) -> Result<(), UpdateMetadataError> {
11059 match d.index {
11060 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
11061 _ => {}
11062 }
11063 Ok(())
11064 }
11065}
11066
11067#[derive(Bundle)]
11071pub struct LingeringPotionMetadataBundle {
11072 _marker: LingeringPotion,
11073 parent: AbstractThrownItemProjectileMetadataBundle,
11074}
11075impl Default for LingeringPotionMetadataBundle {
11076 fn default() -> Self {
11077 Self {
11078 _marker: LingeringPotion,
11079 parent: Default::default(),
11080 }
11081 }
11082}
11083
11084#[derive(Component)]
11103pub struct Snowball;
11104impl Snowball {
11105 fn apply_metadata(
11106 entity: &mut bevy_ecs::system::EntityCommands,
11107 d: EntityDataItem,
11108 ) -> Result<(), UpdateMetadataError> {
11109 match d.index {
11110 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
11111 _ => {}
11112 }
11113 Ok(())
11114 }
11115}
11116
11117#[derive(Bundle)]
11121pub struct SnowballMetadataBundle {
11122 _marker: Snowball,
11123 parent: AbstractThrownItemProjectileMetadataBundle,
11124}
11125impl Default for SnowballMetadataBundle {
11126 fn default() -> Self {
11127 Self {
11128 _marker: Snowball,
11129 parent: Default::default(),
11130 }
11131 }
11132}
11133
11134#[derive(Component)]
11153pub struct SplashPotion;
11154impl SplashPotion {
11155 fn apply_metadata(
11156 entity: &mut bevy_ecs::system::EntityCommands,
11157 d: EntityDataItem,
11158 ) -> Result<(), UpdateMetadataError> {
11159 match d.index {
11160 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
11161 _ => {}
11162 }
11163 Ok(())
11164 }
11165}
11166
11167#[derive(Bundle)]
11171pub struct SplashPotionMetadataBundle {
11172 _marker: SplashPotion,
11173 parent: AbstractThrownItemProjectileMetadataBundle,
11174}
11175impl Default for SplashPotionMetadataBundle {
11176 fn default() -> Self {
11177 Self {
11178 _marker: SplashPotion,
11179 parent: Default::default(),
11180 }
11181 }
11182}
11183
11184#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11186pub struct Hurt(pub i32);
11187#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11189pub struct Hurtdir(pub i32);
11190#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11192pub struct Damage(pub f32);
11193#[derive(Component)]
11244pub struct AbstractVehicle;
11245impl AbstractVehicle {
11246 fn apply_metadata(
11247 entity: &mut bevy_ecs::system::EntityCommands,
11248 d: EntityDataItem,
11249 ) -> Result<(), UpdateMetadataError> {
11250 match d.index {
11251 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
11252 8 => {
11253 entity.insert(Hurt(d.value.into_int()?));
11254 }
11255 9 => {
11256 entity.insert(Hurtdir(d.value.into_int()?));
11257 }
11258 10 => {
11259 entity.insert(Damage(d.value.into_float()?));
11260 }
11261 _ => {}
11262 }
11263 Ok(())
11264 }
11265}
11266
11267#[derive(Bundle)]
11271pub struct AbstractVehicleMetadataBundle {
11272 _marker: AbstractVehicle,
11273 parent: AbstractEntityMetadataBundle,
11274 hurt: Hurt,
11275 hurtdir: Hurtdir,
11276 damage: Damage,
11277}
11278impl Default for AbstractVehicleMetadataBundle {
11279 fn default() -> Self {
11280 Self {
11281 _marker: AbstractVehicle,
11282 parent: Default::default(),
11283 hurt: Hurt(0),
11284 hurtdir: Hurtdir(1),
11285 damage: Damage(0.0),
11286 }
11287 }
11288}
11289
11290#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11292pub struct PaddleLeft(pub bool);
11293#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11295pub struct PaddleRight(pub bool);
11296#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11298pub struct BubbleTime(pub i32);
11299#[derive(Component)]
11342pub struct AbstractBoat;
11343impl AbstractBoat {
11344 fn apply_metadata(
11345 entity: &mut bevy_ecs::system::EntityCommands,
11346 d: EntityDataItem,
11347 ) -> Result<(), UpdateMetadataError> {
11348 match d.index {
11349 0..=10 => AbstractVehicle::apply_metadata(entity, d)?,
11350 11 => {
11351 entity.insert(PaddleLeft(d.value.into_boolean()?));
11352 }
11353 12 => {
11354 entity.insert(PaddleRight(d.value.into_boolean()?));
11355 }
11356 13 => {
11357 entity.insert(BubbleTime(d.value.into_int()?));
11358 }
11359 _ => {}
11360 }
11361 Ok(())
11362 }
11363}
11364
11365#[derive(Bundle)]
11369pub struct AbstractBoatMetadataBundle {
11370 _marker: AbstractBoat,
11371 parent: AbstractVehicleMetadataBundle,
11372 paddle_left: PaddleLeft,
11373 paddle_right: PaddleRight,
11374 bubble_time: BubbleTime,
11375}
11376impl Default for AbstractBoatMetadataBundle {
11377 fn default() -> Self {
11378 Self {
11379 _marker: AbstractBoat,
11380 parent: Default::default(),
11381 paddle_left: PaddleLeft(false),
11382 paddle_right: PaddleRight(false),
11383 bubble_time: BubbleTime(0),
11384 }
11385 }
11386}
11387
11388#[derive(Component)]
11408pub struct AcaciaBoat;
11409impl AcaciaBoat {
11410 fn apply_metadata(
11411 entity: &mut bevy_ecs::system::EntityCommands,
11412 d: EntityDataItem,
11413 ) -> Result<(), UpdateMetadataError> {
11414 match d.index {
11415 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11416 _ => {}
11417 }
11418 Ok(())
11419 }
11420}
11421
11422#[derive(Bundle)]
11426pub struct AcaciaBoatMetadataBundle {
11427 _marker: AcaciaBoat,
11428 parent: AbstractBoatMetadataBundle,
11429}
11430impl Default for AcaciaBoatMetadataBundle {
11431 fn default() -> Self {
11432 Self {
11433 _marker: AcaciaBoat,
11434 parent: Default::default(),
11435 }
11436 }
11437}
11438
11439#[derive(Component)]
11459pub struct AcaciaChestBoat;
11460impl AcaciaChestBoat {
11461 fn apply_metadata(
11462 entity: &mut bevy_ecs::system::EntityCommands,
11463 d: EntityDataItem,
11464 ) -> Result<(), UpdateMetadataError> {
11465 match d.index {
11466 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11467 _ => {}
11468 }
11469 Ok(())
11470 }
11471}
11472
11473#[derive(Bundle)]
11477pub struct AcaciaChestBoatMetadataBundle {
11478 _marker: AcaciaChestBoat,
11479 parent: AbstractBoatMetadataBundle,
11480}
11481impl Default for AcaciaChestBoatMetadataBundle {
11482 fn default() -> Self {
11483 Self {
11484 _marker: AcaciaChestBoat,
11485 parent: Default::default(),
11486 }
11487 }
11488}
11489
11490#[derive(Component)]
11510pub struct BambooChestRaft;
11511impl BambooChestRaft {
11512 fn apply_metadata(
11513 entity: &mut bevy_ecs::system::EntityCommands,
11514 d: EntityDataItem,
11515 ) -> Result<(), UpdateMetadataError> {
11516 match d.index {
11517 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11518 _ => {}
11519 }
11520 Ok(())
11521 }
11522}
11523
11524#[derive(Bundle)]
11528pub struct BambooChestRaftMetadataBundle {
11529 _marker: BambooChestRaft,
11530 parent: AbstractBoatMetadataBundle,
11531}
11532impl Default for BambooChestRaftMetadataBundle {
11533 fn default() -> Self {
11534 Self {
11535 _marker: BambooChestRaft,
11536 parent: Default::default(),
11537 }
11538 }
11539}
11540
11541#[derive(Component)]
11561pub struct BambooRaft;
11562impl BambooRaft {
11563 fn apply_metadata(
11564 entity: &mut bevy_ecs::system::EntityCommands,
11565 d: EntityDataItem,
11566 ) -> Result<(), UpdateMetadataError> {
11567 match d.index {
11568 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11569 _ => {}
11570 }
11571 Ok(())
11572 }
11573}
11574
11575#[derive(Bundle)]
11579pub struct BambooRaftMetadataBundle {
11580 _marker: BambooRaft,
11581 parent: AbstractBoatMetadataBundle,
11582}
11583impl Default for BambooRaftMetadataBundle {
11584 fn default() -> Self {
11585 Self {
11586 _marker: BambooRaft,
11587 parent: Default::default(),
11588 }
11589 }
11590}
11591
11592#[derive(Component)]
11612pub struct BirchBoat;
11613impl BirchBoat {
11614 fn apply_metadata(
11615 entity: &mut bevy_ecs::system::EntityCommands,
11616 d: EntityDataItem,
11617 ) -> Result<(), UpdateMetadataError> {
11618 match d.index {
11619 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11620 _ => {}
11621 }
11622 Ok(())
11623 }
11624}
11625
11626#[derive(Bundle)]
11630pub struct BirchBoatMetadataBundle {
11631 _marker: BirchBoat,
11632 parent: AbstractBoatMetadataBundle,
11633}
11634impl Default for BirchBoatMetadataBundle {
11635 fn default() -> Self {
11636 Self {
11637 _marker: BirchBoat,
11638 parent: Default::default(),
11639 }
11640 }
11641}
11642
11643#[derive(Component)]
11663pub struct BirchChestBoat;
11664impl BirchChestBoat {
11665 fn apply_metadata(
11666 entity: &mut bevy_ecs::system::EntityCommands,
11667 d: EntityDataItem,
11668 ) -> Result<(), UpdateMetadataError> {
11669 match d.index {
11670 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11671 _ => {}
11672 }
11673 Ok(())
11674 }
11675}
11676
11677#[derive(Bundle)]
11681pub struct BirchChestBoatMetadataBundle {
11682 _marker: BirchChestBoat,
11683 parent: AbstractBoatMetadataBundle,
11684}
11685impl Default for BirchChestBoatMetadataBundle {
11686 fn default() -> Self {
11687 Self {
11688 _marker: BirchChestBoat,
11689 parent: Default::default(),
11690 }
11691 }
11692}
11693
11694#[derive(Component)]
11714pub struct CherryBoat;
11715impl CherryBoat {
11716 fn apply_metadata(
11717 entity: &mut bevy_ecs::system::EntityCommands,
11718 d: EntityDataItem,
11719 ) -> Result<(), UpdateMetadataError> {
11720 match d.index {
11721 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11722 _ => {}
11723 }
11724 Ok(())
11725 }
11726}
11727
11728#[derive(Bundle)]
11732pub struct CherryBoatMetadataBundle {
11733 _marker: CherryBoat,
11734 parent: AbstractBoatMetadataBundle,
11735}
11736impl Default for CherryBoatMetadataBundle {
11737 fn default() -> Self {
11738 Self {
11739 _marker: CherryBoat,
11740 parent: Default::default(),
11741 }
11742 }
11743}
11744
11745#[derive(Component)]
11765pub struct CherryChestBoat;
11766impl CherryChestBoat {
11767 fn apply_metadata(
11768 entity: &mut bevy_ecs::system::EntityCommands,
11769 d: EntityDataItem,
11770 ) -> Result<(), UpdateMetadataError> {
11771 match d.index {
11772 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11773 _ => {}
11774 }
11775 Ok(())
11776 }
11777}
11778
11779#[derive(Bundle)]
11783pub struct CherryChestBoatMetadataBundle {
11784 _marker: CherryChestBoat,
11785 parent: AbstractBoatMetadataBundle,
11786}
11787impl Default for CherryChestBoatMetadataBundle {
11788 fn default() -> Self {
11789 Self {
11790 _marker: CherryChestBoat,
11791 parent: Default::default(),
11792 }
11793 }
11794}
11795
11796#[derive(Component)]
11816pub struct DarkOakBoat;
11817impl DarkOakBoat {
11818 fn apply_metadata(
11819 entity: &mut bevy_ecs::system::EntityCommands,
11820 d: EntityDataItem,
11821 ) -> Result<(), UpdateMetadataError> {
11822 match d.index {
11823 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11824 _ => {}
11825 }
11826 Ok(())
11827 }
11828}
11829
11830#[derive(Bundle)]
11834pub struct DarkOakBoatMetadataBundle {
11835 _marker: DarkOakBoat,
11836 parent: AbstractBoatMetadataBundle,
11837}
11838impl Default for DarkOakBoatMetadataBundle {
11839 fn default() -> Self {
11840 Self {
11841 _marker: DarkOakBoat,
11842 parent: Default::default(),
11843 }
11844 }
11845}
11846
11847#[derive(Component)]
11867pub struct DarkOakChestBoat;
11868impl DarkOakChestBoat {
11869 fn apply_metadata(
11870 entity: &mut bevy_ecs::system::EntityCommands,
11871 d: EntityDataItem,
11872 ) -> Result<(), UpdateMetadataError> {
11873 match d.index {
11874 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11875 _ => {}
11876 }
11877 Ok(())
11878 }
11879}
11880
11881#[derive(Bundle)]
11885pub struct DarkOakChestBoatMetadataBundle {
11886 _marker: DarkOakChestBoat,
11887 parent: AbstractBoatMetadataBundle,
11888}
11889impl Default for DarkOakChestBoatMetadataBundle {
11890 fn default() -> Self {
11891 Self {
11892 _marker: DarkOakChestBoat,
11893 parent: Default::default(),
11894 }
11895 }
11896}
11897
11898#[derive(Component)]
11918pub struct JungleBoat;
11919impl JungleBoat {
11920 fn apply_metadata(
11921 entity: &mut bevy_ecs::system::EntityCommands,
11922 d: EntityDataItem,
11923 ) -> Result<(), UpdateMetadataError> {
11924 match d.index {
11925 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11926 _ => {}
11927 }
11928 Ok(())
11929 }
11930}
11931
11932#[derive(Bundle)]
11936pub struct JungleBoatMetadataBundle {
11937 _marker: JungleBoat,
11938 parent: AbstractBoatMetadataBundle,
11939}
11940impl Default for JungleBoatMetadataBundle {
11941 fn default() -> Self {
11942 Self {
11943 _marker: JungleBoat,
11944 parent: Default::default(),
11945 }
11946 }
11947}
11948
11949#[derive(Component)]
11969pub struct JungleChestBoat;
11970impl JungleChestBoat {
11971 fn apply_metadata(
11972 entity: &mut bevy_ecs::system::EntityCommands,
11973 d: EntityDataItem,
11974 ) -> Result<(), UpdateMetadataError> {
11975 match d.index {
11976 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
11977 _ => {}
11978 }
11979 Ok(())
11980 }
11981}
11982
11983#[derive(Bundle)]
11987pub struct JungleChestBoatMetadataBundle {
11988 _marker: JungleChestBoat,
11989 parent: AbstractBoatMetadataBundle,
11990}
11991impl Default for JungleChestBoatMetadataBundle {
11992 fn default() -> Self {
11993 Self {
11994 _marker: JungleChestBoat,
11995 parent: Default::default(),
11996 }
11997 }
11998}
11999
12000#[derive(Component)]
12020pub struct MangroveBoat;
12021impl MangroveBoat {
12022 fn apply_metadata(
12023 entity: &mut bevy_ecs::system::EntityCommands,
12024 d: EntityDataItem,
12025 ) -> Result<(), UpdateMetadataError> {
12026 match d.index {
12027 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12028 _ => {}
12029 }
12030 Ok(())
12031 }
12032}
12033
12034#[derive(Bundle)]
12038pub struct MangroveBoatMetadataBundle {
12039 _marker: MangroveBoat,
12040 parent: AbstractBoatMetadataBundle,
12041}
12042impl Default for MangroveBoatMetadataBundle {
12043 fn default() -> Self {
12044 Self {
12045 _marker: MangroveBoat,
12046 parent: Default::default(),
12047 }
12048 }
12049}
12050
12051#[derive(Component)]
12071pub struct MangroveChestBoat;
12072impl MangroveChestBoat {
12073 fn apply_metadata(
12074 entity: &mut bevy_ecs::system::EntityCommands,
12075 d: EntityDataItem,
12076 ) -> Result<(), UpdateMetadataError> {
12077 match d.index {
12078 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12079 _ => {}
12080 }
12081 Ok(())
12082 }
12083}
12084
12085#[derive(Bundle)]
12089pub struct MangroveChestBoatMetadataBundle {
12090 _marker: MangroveChestBoat,
12091 parent: AbstractBoatMetadataBundle,
12092}
12093impl Default for MangroveChestBoatMetadataBundle {
12094 fn default() -> Self {
12095 Self {
12096 _marker: MangroveChestBoat,
12097 parent: Default::default(),
12098 }
12099 }
12100}
12101
12102#[derive(Component)]
12122pub struct OakBoat;
12123impl OakBoat {
12124 fn apply_metadata(
12125 entity: &mut bevy_ecs::system::EntityCommands,
12126 d: EntityDataItem,
12127 ) -> Result<(), UpdateMetadataError> {
12128 match d.index {
12129 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12130 _ => {}
12131 }
12132 Ok(())
12133 }
12134}
12135
12136#[derive(Bundle)]
12140pub struct OakBoatMetadataBundle {
12141 _marker: OakBoat,
12142 parent: AbstractBoatMetadataBundle,
12143}
12144impl Default for OakBoatMetadataBundle {
12145 fn default() -> Self {
12146 Self {
12147 _marker: OakBoat,
12148 parent: Default::default(),
12149 }
12150 }
12151}
12152
12153#[derive(Component)]
12173pub struct OakChestBoat;
12174impl OakChestBoat {
12175 fn apply_metadata(
12176 entity: &mut bevy_ecs::system::EntityCommands,
12177 d: EntityDataItem,
12178 ) -> Result<(), UpdateMetadataError> {
12179 match d.index {
12180 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12181 _ => {}
12182 }
12183 Ok(())
12184 }
12185}
12186
12187#[derive(Bundle)]
12191pub struct OakChestBoatMetadataBundle {
12192 _marker: OakChestBoat,
12193 parent: AbstractBoatMetadataBundle,
12194}
12195impl Default for OakChestBoatMetadataBundle {
12196 fn default() -> Self {
12197 Self {
12198 _marker: OakChestBoat,
12199 parent: Default::default(),
12200 }
12201 }
12202}
12203
12204#[derive(Component)]
12224pub struct PaleOakBoat;
12225impl PaleOakBoat {
12226 fn apply_metadata(
12227 entity: &mut bevy_ecs::system::EntityCommands,
12228 d: EntityDataItem,
12229 ) -> Result<(), UpdateMetadataError> {
12230 match d.index {
12231 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12232 _ => {}
12233 }
12234 Ok(())
12235 }
12236}
12237
12238#[derive(Bundle)]
12242pub struct PaleOakBoatMetadataBundle {
12243 _marker: PaleOakBoat,
12244 parent: AbstractBoatMetadataBundle,
12245}
12246impl Default for PaleOakBoatMetadataBundle {
12247 fn default() -> Self {
12248 Self {
12249 _marker: PaleOakBoat,
12250 parent: Default::default(),
12251 }
12252 }
12253}
12254
12255#[derive(Component)]
12275pub struct PaleOakChestBoat;
12276impl PaleOakChestBoat {
12277 fn apply_metadata(
12278 entity: &mut bevy_ecs::system::EntityCommands,
12279 d: EntityDataItem,
12280 ) -> Result<(), UpdateMetadataError> {
12281 match d.index {
12282 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12283 _ => {}
12284 }
12285 Ok(())
12286 }
12287}
12288
12289#[derive(Bundle)]
12293pub struct PaleOakChestBoatMetadataBundle {
12294 _marker: PaleOakChestBoat,
12295 parent: AbstractBoatMetadataBundle,
12296}
12297impl Default for PaleOakChestBoatMetadataBundle {
12298 fn default() -> Self {
12299 Self {
12300 _marker: PaleOakChestBoat,
12301 parent: Default::default(),
12302 }
12303 }
12304}
12305
12306#[derive(Component)]
12326pub struct SpruceBoat;
12327impl SpruceBoat {
12328 fn apply_metadata(
12329 entity: &mut bevy_ecs::system::EntityCommands,
12330 d: EntityDataItem,
12331 ) -> Result<(), UpdateMetadataError> {
12332 match d.index {
12333 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12334 _ => {}
12335 }
12336 Ok(())
12337 }
12338}
12339
12340#[derive(Bundle)]
12344pub struct SpruceBoatMetadataBundle {
12345 _marker: SpruceBoat,
12346 parent: AbstractBoatMetadataBundle,
12347}
12348impl Default for SpruceBoatMetadataBundle {
12349 fn default() -> Self {
12350 Self {
12351 _marker: SpruceBoat,
12352 parent: Default::default(),
12353 }
12354 }
12355}
12356
12357#[derive(Component)]
12377pub struct SpruceChestBoat;
12378impl SpruceChestBoat {
12379 fn apply_metadata(
12380 entity: &mut bevy_ecs::system::EntityCommands,
12381 d: EntityDataItem,
12382 ) -> Result<(), UpdateMetadataError> {
12383 match d.index {
12384 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12385 _ => {}
12386 }
12387 Ok(())
12388 }
12389}
12390
12391#[derive(Bundle)]
12395pub struct SpruceChestBoatMetadataBundle {
12396 _marker: SpruceChestBoat,
12397 parent: AbstractBoatMetadataBundle,
12398}
12399impl Default for SpruceChestBoatMetadataBundle {
12400 fn default() -> Self {
12401 Self {
12402 _marker: SpruceChestBoat,
12403 parent: Default::default(),
12404 }
12405 }
12406}
12407
12408#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12410pub struct CustomDisplayBlock(pub azalea_block::BlockState);
12411#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12413pub struct DisplayOffset(pub i32);
12414#[derive(Component)]
12443pub struct AbstractMinecart;
12444impl AbstractMinecart {
12445 fn apply_metadata(
12446 entity: &mut bevy_ecs::system::EntityCommands,
12447 d: EntityDataItem,
12448 ) -> Result<(), UpdateMetadataError> {
12449 match d.index {
12450 0..=10 => AbstractVehicle::apply_metadata(entity, d)?,
12451 11 => {
12452 entity.insert(CustomDisplayBlock(d.value.into_optional_block_state()?));
12453 }
12454 12 => {
12455 entity.insert(DisplayOffset(d.value.into_int()?));
12456 }
12457 _ => {}
12458 }
12459 Ok(())
12460 }
12461}
12462
12463#[derive(Bundle)]
12467pub struct AbstractMinecartMetadataBundle {
12468 _marker: AbstractMinecart,
12469 parent: AbstractVehicleMetadataBundle,
12470 custom_display_block: CustomDisplayBlock,
12471 display_offset: DisplayOffset,
12472}
12473impl Default for AbstractMinecartMetadataBundle {
12474 fn default() -> Self {
12475 Self {
12476 _marker: AbstractMinecart,
12477 parent: Default::default(),
12478 custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR),
12479 display_offset: DisplayOffset(Default::default()),
12480 }
12481 }
12482}
12483
12484#[derive(Component)]
12504pub struct ChestMinecart;
12505impl ChestMinecart {
12506 fn apply_metadata(
12507 entity: &mut bevy_ecs::system::EntityCommands,
12508 d: EntityDataItem,
12509 ) -> Result<(), UpdateMetadataError> {
12510 match d.index {
12511 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12512 _ => {}
12513 }
12514 Ok(())
12515 }
12516}
12517
12518#[derive(Bundle)]
12522pub struct ChestMinecartMetadataBundle {
12523 _marker: ChestMinecart,
12524 parent: AbstractMinecartMetadataBundle,
12525}
12526impl Default for ChestMinecartMetadataBundle {
12527 fn default() -> Self {
12528 Self {
12529 _marker: ChestMinecart,
12530 parent: Default::default(),
12531 }
12532 }
12533}
12534
12535#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12537pub struct CommandName(pub Box<str>);
12538#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12540pub struct LastOutput(pub Box<FormattedText>);
12541#[derive(Component)]
12566pub struct CommandBlockMinecart;
12567impl CommandBlockMinecart {
12568 fn apply_metadata(
12569 entity: &mut bevy_ecs::system::EntityCommands,
12570 d: EntityDataItem,
12571 ) -> Result<(), UpdateMetadataError> {
12572 match d.index {
12573 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12574 13 => {
12575 entity.insert(CommandName(d.value.into_string()?));
12576 }
12577 14 => {
12578 entity.insert(LastOutput(d.value.into_formatted_text()?));
12579 }
12580 _ => {}
12581 }
12582 Ok(())
12583 }
12584}
12585
12586#[derive(Bundle)]
12590pub struct CommandBlockMinecartMetadataBundle {
12591 _marker: CommandBlockMinecart,
12592 parent: AbstractMinecartMetadataBundle,
12593 command_name: CommandName,
12594 last_output: LastOutput,
12595}
12596impl Default for CommandBlockMinecartMetadataBundle {
12597 fn default() -> Self {
12598 Self {
12599 _marker: CommandBlockMinecart,
12600 parent: Default::default(),
12601 command_name: CommandName("".into()),
12602 last_output: LastOutput(Default::default()),
12603 }
12604 }
12605}
12606
12607#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12609pub struct Fuel(pub bool);
12610#[derive(Component)]
12633pub struct FurnaceMinecart;
12634impl FurnaceMinecart {
12635 fn apply_metadata(
12636 entity: &mut bevy_ecs::system::EntityCommands,
12637 d: EntityDataItem,
12638 ) -> Result<(), UpdateMetadataError> {
12639 match d.index {
12640 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12641 13 => {
12642 entity.insert(Fuel(d.value.into_boolean()?));
12643 }
12644 _ => {}
12645 }
12646 Ok(())
12647 }
12648}
12649
12650#[derive(Bundle)]
12654pub struct FurnaceMinecartMetadataBundle {
12655 _marker: FurnaceMinecart,
12656 parent: AbstractMinecartMetadataBundle,
12657 fuel: Fuel,
12658}
12659impl Default for FurnaceMinecartMetadataBundle {
12660 fn default() -> Self {
12661 Self {
12662 _marker: FurnaceMinecart,
12663 parent: Default::default(),
12664 fuel: Fuel(false),
12665 }
12666 }
12667}
12668
12669#[derive(Component)]
12689pub struct HopperMinecart;
12690impl HopperMinecart {
12691 fn apply_metadata(
12692 entity: &mut bevy_ecs::system::EntityCommands,
12693 d: EntityDataItem,
12694 ) -> Result<(), UpdateMetadataError> {
12695 match d.index {
12696 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12697 _ => {}
12698 }
12699 Ok(())
12700 }
12701}
12702
12703#[derive(Bundle)]
12707pub struct HopperMinecartMetadataBundle {
12708 _marker: HopperMinecart,
12709 parent: AbstractMinecartMetadataBundle,
12710}
12711impl Default for HopperMinecartMetadataBundle {
12712 fn default() -> Self {
12713 Self {
12714 _marker: HopperMinecart,
12715 parent: Default::default(),
12716 }
12717 }
12718}
12719
12720#[derive(Component)]
12740pub struct Minecart;
12741impl Minecart {
12742 fn apply_metadata(
12743 entity: &mut bevy_ecs::system::EntityCommands,
12744 d: EntityDataItem,
12745 ) -> Result<(), UpdateMetadataError> {
12746 match d.index {
12747 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12748 _ => {}
12749 }
12750 Ok(())
12751 }
12752}
12753
12754#[derive(Bundle)]
12758pub struct MinecartMetadataBundle {
12759 _marker: Minecart,
12760 parent: AbstractMinecartMetadataBundle,
12761}
12762impl Default for MinecartMetadataBundle {
12763 fn default() -> Self {
12764 Self {
12765 _marker: Minecart,
12766 parent: Default::default(),
12767 }
12768 }
12769}
12770
12771#[derive(Component)]
12791pub struct SpawnerMinecart;
12792impl SpawnerMinecart {
12793 fn apply_metadata(
12794 entity: &mut bevy_ecs::system::EntityCommands,
12795 d: EntityDataItem,
12796 ) -> Result<(), UpdateMetadataError> {
12797 match d.index {
12798 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12799 _ => {}
12800 }
12801 Ok(())
12802 }
12803}
12804
12805#[derive(Bundle)]
12809pub struct SpawnerMinecartMetadataBundle {
12810 _marker: SpawnerMinecart,
12811 parent: AbstractMinecartMetadataBundle,
12812}
12813impl Default for SpawnerMinecartMetadataBundle {
12814 fn default() -> Self {
12815 Self {
12816 _marker: SpawnerMinecart,
12817 parent: Default::default(),
12818 }
12819 }
12820}
12821
12822#[derive(Component)]
12842pub struct TntMinecart;
12843impl TntMinecart {
12844 fn apply_metadata(
12845 entity: &mut bevy_ecs::system::EntityCommands,
12846 d: EntityDataItem,
12847 ) -> Result<(), UpdateMetadataError> {
12848 match d.index {
12849 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
12850 _ => {}
12851 }
12852 Ok(())
12853 }
12854}
12855
12856#[derive(Bundle)]
12860pub struct TntMinecartMetadataBundle {
12861 _marker: TntMinecart,
12862 parent: AbstractMinecartMetadataBundle,
12863}
12864impl Default for TntMinecartMetadataBundle {
12865 fn default() -> Self {
12866 Self {
12867 _marker: TntMinecart,
12868 parent: Default::default(),
12869 }
12870 }
12871}
12872
12873pub fn apply_metadata(
12874 entity: &mut bevy_ecs::system::EntityCommands,
12875 entity_kind: EntityKind,
12876 items: Vec<EntityDataItem>,
12877) -> Result<(), UpdateMetadataError> {
12878 match entity_kind {
12879 EntityKind::AcaciaBoat => {
12880 for d in items {
12881 AcaciaBoat::apply_metadata(entity, d)?;
12882 }
12883 }
12884 EntityKind::AcaciaChestBoat => {
12885 for d in items {
12886 AcaciaChestBoat::apply_metadata(entity, d)?;
12887 }
12888 }
12889 EntityKind::Allay => {
12890 for d in items {
12891 Allay::apply_metadata(entity, d)?;
12892 }
12893 }
12894 EntityKind::AreaEffectCloud => {
12895 for d in items {
12896 AreaEffectCloud::apply_metadata(entity, d)?;
12897 }
12898 }
12899 EntityKind::Armadillo => {
12900 for d in items {
12901 Armadillo::apply_metadata(entity, d)?;
12902 }
12903 }
12904 EntityKind::ArmorStand => {
12905 for d in items {
12906 ArmorStand::apply_metadata(entity, d)?;
12907 }
12908 }
12909 EntityKind::Arrow => {
12910 for d in items {
12911 Arrow::apply_metadata(entity, d)?;
12912 }
12913 }
12914 EntityKind::Axolotl => {
12915 for d in items {
12916 Axolotl::apply_metadata(entity, d)?;
12917 }
12918 }
12919 EntityKind::BambooChestRaft => {
12920 for d in items {
12921 BambooChestRaft::apply_metadata(entity, d)?;
12922 }
12923 }
12924 EntityKind::BambooRaft => {
12925 for d in items {
12926 BambooRaft::apply_metadata(entity, d)?;
12927 }
12928 }
12929 EntityKind::Bat => {
12930 for d in items {
12931 Bat::apply_metadata(entity, d)?;
12932 }
12933 }
12934 EntityKind::Bee => {
12935 for d in items {
12936 Bee::apply_metadata(entity, d)?;
12937 }
12938 }
12939 EntityKind::BirchBoat => {
12940 for d in items {
12941 BirchBoat::apply_metadata(entity, d)?;
12942 }
12943 }
12944 EntityKind::BirchChestBoat => {
12945 for d in items {
12946 BirchChestBoat::apply_metadata(entity, d)?;
12947 }
12948 }
12949 EntityKind::Blaze => {
12950 for d in items {
12951 Blaze::apply_metadata(entity, d)?;
12952 }
12953 }
12954 EntityKind::BlockDisplay => {
12955 for d in items {
12956 BlockDisplay::apply_metadata(entity, d)?;
12957 }
12958 }
12959 EntityKind::Bogged => {
12960 for d in items {
12961 Bogged::apply_metadata(entity, d)?;
12962 }
12963 }
12964 EntityKind::Breeze => {
12965 for d in items {
12966 Breeze::apply_metadata(entity, d)?;
12967 }
12968 }
12969 EntityKind::BreezeWindCharge => {
12970 for d in items {
12971 BreezeWindCharge::apply_metadata(entity, d)?;
12972 }
12973 }
12974 EntityKind::Camel => {
12975 for d in items {
12976 Camel::apply_metadata(entity, d)?;
12977 }
12978 }
12979 EntityKind::CamelHusk => {
12980 for d in items {
12981 CamelHusk::apply_metadata(entity, d)?;
12982 }
12983 }
12984 EntityKind::Cat => {
12985 for d in items {
12986 Cat::apply_metadata(entity, d)?;
12987 }
12988 }
12989 EntityKind::CaveSpider => {
12990 for d in items {
12991 CaveSpider::apply_metadata(entity, d)?;
12992 }
12993 }
12994 EntityKind::CherryBoat => {
12995 for d in items {
12996 CherryBoat::apply_metadata(entity, d)?;
12997 }
12998 }
12999 EntityKind::CherryChestBoat => {
13000 for d in items {
13001 CherryChestBoat::apply_metadata(entity, d)?;
13002 }
13003 }
13004 EntityKind::ChestMinecart => {
13005 for d in items {
13006 ChestMinecart::apply_metadata(entity, d)?;
13007 }
13008 }
13009 EntityKind::Chicken => {
13010 for d in items {
13011 Chicken::apply_metadata(entity, d)?;
13012 }
13013 }
13014 EntityKind::Cod => {
13015 for d in items {
13016 Cod::apply_metadata(entity, d)?;
13017 }
13018 }
13019 EntityKind::CommandBlockMinecart => {
13020 for d in items {
13021 CommandBlockMinecart::apply_metadata(entity, d)?;
13022 }
13023 }
13024 EntityKind::CopperGolem => {
13025 for d in items {
13026 CopperGolem::apply_metadata(entity, d)?;
13027 }
13028 }
13029 EntityKind::Cow => {
13030 for d in items {
13031 Cow::apply_metadata(entity, d)?;
13032 }
13033 }
13034 EntityKind::Creaking => {
13035 for d in items {
13036 Creaking::apply_metadata(entity, d)?;
13037 }
13038 }
13039 EntityKind::Creeper => {
13040 for d in items {
13041 Creeper::apply_metadata(entity, d)?;
13042 }
13043 }
13044 EntityKind::DarkOakBoat => {
13045 for d in items {
13046 DarkOakBoat::apply_metadata(entity, d)?;
13047 }
13048 }
13049 EntityKind::DarkOakChestBoat => {
13050 for d in items {
13051 DarkOakChestBoat::apply_metadata(entity, d)?;
13052 }
13053 }
13054 EntityKind::Dolphin => {
13055 for d in items {
13056 Dolphin::apply_metadata(entity, d)?;
13057 }
13058 }
13059 EntityKind::Donkey => {
13060 for d in items {
13061 Donkey::apply_metadata(entity, d)?;
13062 }
13063 }
13064 EntityKind::DragonFireball => {
13065 for d in items {
13066 DragonFireball::apply_metadata(entity, d)?;
13067 }
13068 }
13069 EntityKind::Drowned => {
13070 for d in items {
13071 Drowned::apply_metadata(entity, d)?;
13072 }
13073 }
13074 EntityKind::Egg => {
13075 for d in items {
13076 Egg::apply_metadata(entity, d)?;
13077 }
13078 }
13079 EntityKind::ElderGuardian => {
13080 for d in items {
13081 ElderGuardian::apply_metadata(entity, d)?;
13082 }
13083 }
13084 EntityKind::EndCrystal => {
13085 for d in items {
13086 EndCrystal::apply_metadata(entity, d)?;
13087 }
13088 }
13089 EntityKind::EnderDragon => {
13090 for d in items {
13091 EnderDragon::apply_metadata(entity, d)?;
13092 }
13093 }
13094 EntityKind::EnderPearl => {
13095 for d in items {
13096 EnderPearl::apply_metadata(entity, d)?;
13097 }
13098 }
13099 EntityKind::Enderman => {
13100 for d in items {
13101 Enderman::apply_metadata(entity, d)?;
13102 }
13103 }
13104 EntityKind::Endermite => {
13105 for d in items {
13106 Endermite::apply_metadata(entity, d)?;
13107 }
13108 }
13109 EntityKind::Evoker => {
13110 for d in items {
13111 Evoker::apply_metadata(entity, d)?;
13112 }
13113 }
13114 EntityKind::EvokerFangs => {
13115 for d in items {
13116 EvokerFangs::apply_metadata(entity, d)?;
13117 }
13118 }
13119 EntityKind::ExperienceBottle => {
13120 for d in items {
13121 ExperienceBottle::apply_metadata(entity, d)?;
13122 }
13123 }
13124 EntityKind::ExperienceOrb => {
13125 for d in items {
13126 ExperienceOrb::apply_metadata(entity, d)?;
13127 }
13128 }
13129 EntityKind::EyeOfEnder => {
13130 for d in items {
13131 EyeOfEnder::apply_metadata(entity, d)?;
13132 }
13133 }
13134 EntityKind::FallingBlock => {
13135 for d in items {
13136 FallingBlock::apply_metadata(entity, d)?;
13137 }
13138 }
13139 EntityKind::Fireball => {
13140 for d in items {
13141 Fireball::apply_metadata(entity, d)?;
13142 }
13143 }
13144 EntityKind::FireworkRocket => {
13145 for d in items {
13146 FireworkRocket::apply_metadata(entity, d)?;
13147 }
13148 }
13149 EntityKind::FishingBobber => {
13150 for d in items {
13151 FishingBobber::apply_metadata(entity, d)?;
13152 }
13153 }
13154 EntityKind::Fox => {
13155 for d in items {
13156 Fox::apply_metadata(entity, d)?;
13157 }
13158 }
13159 EntityKind::Frog => {
13160 for d in items {
13161 Frog::apply_metadata(entity, d)?;
13162 }
13163 }
13164 EntityKind::FurnaceMinecart => {
13165 for d in items {
13166 FurnaceMinecart::apply_metadata(entity, d)?;
13167 }
13168 }
13169 EntityKind::Ghast => {
13170 for d in items {
13171 Ghast::apply_metadata(entity, d)?;
13172 }
13173 }
13174 EntityKind::Giant => {
13175 for d in items {
13176 Giant::apply_metadata(entity, d)?;
13177 }
13178 }
13179 EntityKind::GlowItemFrame => {
13180 for d in items {
13181 GlowItemFrame::apply_metadata(entity, d)?;
13182 }
13183 }
13184 EntityKind::GlowSquid => {
13185 for d in items {
13186 GlowSquid::apply_metadata(entity, d)?;
13187 }
13188 }
13189 EntityKind::Goat => {
13190 for d in items {
13191 Goat::apply_metadata(entity, d)?;
13192 }
13193 }
13194 EntityKind::Guardian => {
13195 for d in items {
13196 Guardian::apply_metadata(entity, d)?;
13197 }
13198 }
13199 EntityKind::HappyGhast => {
13200 for d in items {
13201 HappyGhast::apply_metadata(entity, d)?;
13202 }
13203 }
13204 EntityKind::Hoglin => {
13205 for d in items {
13206 Hoglin::apply_metadata(entity, d)?;
13207 }
13208 }
13209 EntityKind::HopperMinecart => {
13210 for d in items {
13211 HopperMinecart::apply_metadata(entity, d)?;
13212 }
13213 }
13214 EntityKind::Horse => {
13215 for d in items {
13216 Horse::apply_metadata(entity, d)?;
13217 }
13218 }
13219 EntityKind::Husk => {
13220 for d in items {
13221 Husk::apply_metadata(entity, d)?;
13222 }
13223 }
13224 EntityKind::Illusioner => {
13225 for d in items {
13226 Illusioner::apply_metadata(entity, d)?;
13227 }
13228 }
13229 EntityKind::Interaction => {
13230 for d in items {
13231 Interaction::apply_metadata(entity, d)?;
13232 }
13233 }
13234 EntityKind::IronGolem => {
13235 for d in items {
13236 IronGolem::apply_metadata(entity, d)?;
13237 }
13238 }
13239 EntityKind::Item => {
13240 for d in items {
13241 Item::apply_metadata(entity, d)?;
13242 }
13243 }
13244 EntityKind::ItemDisplay => {
13245 for d in items {
13246 ItemDisplay::apply_metadata(entity, d)?;
13247 }
13248 }
13249 EntityKind::ItemFrame => {
13250 for d in items {
13251 ItemFrame::apply_metadata(entity, d)?;
13252 }
13253 }
13254 EntityKind::JungleBoat => {
13255 for d in items {
13256 JungleBoat::apply_metadata(entity, d)?;
13257 }
13258 }
13259 EntityKind::JungleChestBoat => {
13260 for d in items {
13261 JungleChestBoat::apply_metadata(entity, d)?;
13262 }
13263 }
13264 EntityKind::LeashKnot => {
13265 for d in items {
13266 LeashKnot::apply_metadata(entity, d)?;
13267 }
13268 }
13269 EntityKind::LightningBolt => {
13270 for d in items {
13271 LightningBolt::apply_metadata(entity, d)?;
13272 }
13273 }
13274 EntityKind::LingeringPotion => {
13275 for d in items {
13276 LingeringPotion::apply_metadata(entity, d)?;
13277 }
13278 }
13279 EntityKind::Llama => {
13280 for d in items {
13281 Llama::apply_metadata(entity, d)?;
13282 }
13283 }
13284 EntityKind::LlamaSpit => {
13285 for d in items {
13286 LlamaSpit::apply_metadata(entity, d)?;
13287 }
13288 }
13289 EntityKind::MagmaCube => {
13290 for d in items {
13291 MagmaCube::apply_metadata(entity, d)?;
13292 }
13293 }
13294 EntityKind::MangroveBoat => {
13295 for d in items {
13296 MangroveBoat::apply_metadata(entity, d)?;
13297 }
13298 }
13299 EntityKind::MangroveChestBoat => {
13300 for d in items {
13301 MangroveChestBoat::apply_metadata(entity, d)?;
13302 }
13303 }
13304 EntityKind::Mannequin => {
13305 for d in items {
13306 Mannequin::apply_metadata(entity, d)?;
13307 }
13308 }
13309 EntityKind::Marker => {
13310 for d in items {
13311 Marker::apply_metadata(entity, d)?;
13312 }
13313 }
13314 EntityKind::Minecart => {
13315 for d in items {
13316 Minecart::apply_metadata(entity, d)?;
13317 }
13318 }
13319 EntityKind::Mooshroom => {
13320 for d in items {
13321 Mooshroom::apply_metadata(entity, d)?;
13322 }
13323 }
13324 EntityKind::Mule => {
13325 for d in items {
13326 Mule::apply_metadata(entity, d)?;
13327 }
13328 }
13329 EntityKind::Nautilus => {
13330 for d in items {
13331 Nautilus::apply_metadata(entity, d)?;
13332 }
13333 }
13334 EntityKind::OakBoat => {
13335 for d in items {
13336 OakBoat::apply_metadata(entity, d)?;
13337 }
13338 }
13339 EntityKind::OakChestBoat => {
13340 for d in items {
13341 OakChestBoat::apply_metadata(entity, d)?;
13342 }
13343 }
13344 EntityKind::Ocelot => {
13345 for d in items {
13346 Ocelot::apply_metadata(entity, d)?;
13347 }
13348 }
13349 EntityKind::OminousItemSpawner => {
13350 for d in items {
13351 OminousItemSpawner::apply_metadata(entity, d)?;
13352 }
13353 }
13354 EntityKind::Painting => {
13355 for d in items {
13356 Painting::apply_metadata(entity, d)?;
13357 }
13358 }
13359 EntityKind::PaleOakBoat => {
13360 for d in items {
13361 PaleOakBoat::apply_metadata(entity, d)?;
13362 }
13363 }
13364 EntityKind::PaleOakChestBoat => {
13365 for d in items {
13366 PaleOakChestBoat::apply_metadata(entity, d)?;
13367 }
13368 }
13369 EntityKind::Panda => {
13370 for d in items {
13371 Panda::apply_metadata(entity, d)?;
13372 }
13373 }
13374 EntityKind::Parched => {
13375 for d in items {
13376 Parched::apply_metadata(entity, d)?;
13377 }
13378 }
13379 EntityKind::Parrot => {
13380 for d in items {
13381 Parrot::apply_metadata(entity, d)?;
13382 }
13383 }
13384 EntityKind::Phantom => {
13385 for d in items {
13386 Phantom::apply_metadata(entity, d)?;
13387 }
13388 }
13389 EntityKind::Pig => {
13390 for d in items {
13391 Pig::apply_metadata(entity, d)?;
13392 }
13393 }
13394 EntityKind::Piglin => {
13395 for d in items {
13396 Piglin::apply_metadata(entity, d)?;
13397 }
13398 }
13399 EntityKind::PiglinBrute => {
13400 for d in items {
13401 PiglinBrute::apply_metadata(entity, d)?;
13402 }
13403 }
13404 EntityKind::Pillager => {
13405 for d in items {
13406 Pillager::apply_metadata(entity, d)?;
13407 }
13408 }
13409 EntityKind::Player => {
13410 for d in items {
13411 Player::apply_metadata(entity, d)?;
13412 }
13413 }
13414 EntityKind::PolarBear => {
13415 for d in items {
13416 PolarBear::apply_metadata(entity, d)?;
13417 }
13418 }
13419 EntityKind::Pufferfish => {
13420 for d in items {
13421 Pufferfish::apply_metadata(entity, d)?;
13422 }
13423 }
13424 EntityKind::Rabbit => {
13425 for d in items {
13426 Rabbit::apply_metadata(entity, d)?;
13427 }
13428 }
13429 EntityKind::Ravager => {
13430 for d in items {
13431 Ravager::apply_metadata(entity, d)?;
13432 }
13433 }
13434 EntityKind::Salmon => {
13435 for d in items {
13436 Salmon::apply_metadata(entity, d)?;
13437 }
13438 }
13439 EntityKind::Sheep => {
13440 for d in items {
13441 Sheep::apply_metadata(entity, d)?;
13442 }
13443 }
13444 EntityKind::Shulker => {
13445 for d in items {
13446 Shulker::apply_metadata(entity, d)?;
13447 }
13448 }
13449 EntityKind::ShulkerBullet => {
13450 for d in items {
13451 ShulkerBullet::apply_metadata(entity, d)?;
13452 }
13453 }
13454 EntityKind::Silverfish => {
13455 for d in items {
13456 Silverfish::apply_metadata(entity, d)?;
13457 }
13458 }
13459 EntityKind::Skeleton => {
13460 for d in items {
13461 Skeleton::apply_metadata(entity, d)?;
13462 }
13463 }
13464 EntityKind::SkeletonHorse => {
13465 for d in items {
13466 SkeletonHorse::apply_metadata(entity, d)?;
13467 }
13468 }
13469 EntityKind::Slime => {
13470 for d in items {
13471 Slime::apply_metadata(entity, d)?;
13472 }
13473 }
13474 EntityKind::SmallFireball => {
13475 for d in items {
13476 SmallFireball::apply_metadata(entity, d)?;
13477 }
13478 }
13479 EntityKind::Sniffer => {
13480 for d in items {
13481 Sniffer::apply_metadata(entity, d)?;
13482 }
13483 }
13484 EntityKind::SnowGolem => {
13485 for d in items {
13486 SnowGolem::apply_metadata(entity, d)?;
13487 }
13488 }
13489 EntityKind::Snowball => {
13490 for d in items {
13491 Snowball::apply_metadata(entity, d)?;
13492 }
13493 }
13494 EntityKind::SpawnerMinecart => {
13495 for d in items {
13496 SpawnerMinecart::apply_metadata(entity, d)?;
13497 }
13498 }
13499 EntityKind::SpectralArrow => {
13500 for d in items {
13501 SpectralArrow::apply_metadata(entity, d)?;
13502 }
13503 }
13504 EntityKind::Spider => {
13505 for d in items {
13506 Spider::apply_metadata(entity, d)?;
13507 }
13508 }
13509 EntityKind::SplashPotion => {
13510 for d in items {
13511 SplashPotion::apply_metadata(entity, d)?;
13512 }
13513 }
13514 EntityKind::SpruceBoat => {
13515 for d in items {
13516 SpruceBoat::apply_metadata(entity, d)?;
13517 }
13518 }
13519 EntityKind::SpruceChestBoat => {
13520 for d in items {
13521 SpruceChestBoat::apply_metadata(entity, d)?;
13522 }
13523 }
13524 EntityKind::Squid => {
13525 for d in items {
13526 Squid::apply_metadata(entity, d)?;
13527 }
13528 }
13529 EntityKind::Stray => {
13530 for d in items {
13531 Stray::apply_metadata(entity, d)?;
13532 }
13533 }
13534 EntityKind::Strider => {
13535 for d in items {
13536 Strider::apply_metadata(entity, d)?;
13537 }
13538 }
13539 EntityKind::SulfurCube => {
13540 for d in items {
13541 SulfurCube::apply_metadata(entity, d)?;
13542 }
13543 }
13544 EntityKind::Tadpole => {
13545 for d in items {
13546 Tadpole::apply_metadata(entity, d)?;
13547 }
13548 }
13549 EntityKind::TextDisplay => {
13550 for d in items {
13551 TextDisplay::apply_metadata(entity, d)?;
13552 }
13553 }
13554 EntityKind::Tnt => {
13555 for d in items {
13556 Tnt::apply_metadata(entity, d)?;
13557 }
13558 }
13559 EntityKind::TntMinecart => {
13560 for d in items {
13561 TntMinecart::apply_metadata(entity, d)?;
13562 }
13563 }
13564 EntityKind::TraderLlama => {
13565 for d in items {
13566 TraderLlama::apply_metadata(entity, d)?;
13567 }
13568 }
13569 EntityKind::Trident => {
13570 for d in items {
13571 Trident::apply_metadata(entity, d)?;
13572 }
13573 }
13574 EntityKind::TropicalFish => {
13575 for d in items {
13576 TropicalFish::apply_metadata(entity, d)?;
13577 }
13578 }
13579 EntityKind::Turtle => {
13580 for d in items {
13581 Turtle::apply_metadata(entity, d)?;
13582 }
13583 }
13584 EntityKind::Vex => {
13585 for d in items {
13586 Vex::apply_metadata(entity, d)?;
13587 }
13588 }
13589 EntityKind::Villager => {
13590 for d in items {
13591 Villager::apply_metadata(entity, d)?;
13592 }
13593 }
13594 EntityKind::Vindicator => {
13595 for d in items {
13596 Vindicator::apply_metadata(entity, d)?;
13597 }
13598 }
13599 EntityKind::WanderingTrader => {
13600 for d in items {
13601 WanderingTrader::apply_metadata(entity, d)?;
13602 }
13603 }
13604 EntityKind::Warden => {
13605 for d in items {
13606 Warden::apply_metadata(entity, d)?;
13607 }
13608 }
13609 EntityKind::WindCharge => {
13610 for d in items {
13611 WindCharge::apply_metadata(entity, d)?;
13612 }
13613 }
13614 EntityKind::Witch => {
13615 for d in items {
13616 Witch::apply_metadata(entity, d)?;
13617 }
13618 }
13619 EntityKind::Wither => {
13620 for d in items {
13621 Wither::apply_metadata(entity, d)?;
13622 }
13623 }
13624 EntityKind::WitherSkeleton => {
13625 for d in items {
13626 WitherSkeleton::apply_metadata(entity, d)?;
13627 }
13628 }
13629 EntityKind::WitherSkull => {
13630 for d in items {
13631 WitherSkull::apply_metadata(entity, d)?;
13632 }
13633 }
13634 EntityKind::Wolf => {
13635 for d in items {
13636 Wolf::apply_metadata(entity, d)?;
13637 }
13638 }
13639 EntityKind::Zoglin => {
13640 for d in items {
13641 Zoglin::apply_metadata(entity, d)?;
13642 }
13643 }
13644 EntityKind::Zombie => {
13645 for d in items {
13646 Zombie::apply_metadata(entity, d)?;
13647 }
13648 }
13649 EntityKind::ZombieHorse => {
13650 for d in items {
13651 ZombieHorse::apply_metadata(entity, d)?;
13652 }
13653 }
13654 EntityKind::ZombieNautilus => {
13655 for d in items {
13656 ZombieNautilus::apply_metadata(entity, d)?;
13657 }
13658 }
13659 EntityKind::ZombieVillager => {
13660 for d in items {
13661 ZombieVillager::apply_metadata(entity, d)?;
13662 }
13663 }
13664 EntityKind::ZombifiedPiglin => {
13665 for d in items {
13666 ZombifiedPiglin::apply_metadata(entity, d)?;
13667 }
13668 }
13669 }
13670 Ok(())
13671}
13672
13673pub fn apply_default_metadata(entity: &mut bevy_ecs::system::EntityCommands, kind: EntityKind) {
13674 match kind {
13675 EntityKind::AcaciaBoat => {
13676 entity.insert(AcaciaBoatMetadataBundle::default());
13677 }
13678 EntityKind::AcaciaChestBoat => {
13679 entity.insert(AcaciaChestBoatMetadataBundle::default());
13680 }
13681 EntityKind::Allay => {
13682 entity.insert(AllayMetadataBundle::default());
13683 }
13684 EntityKind::AreaEffectCloud => {
13685 entity.insert(AreaEffectCloudMetadataBundle::default());
13686 }
13687 EntityKind::Armadillo => {
13688 entity.insert(ArmadilloMetadataBundle::default());
13689 }
13690 EntityKind::ArmorStand => {
13691 entity.insert(ArmorStandMetadataBundle::default());
13692 }
13693 EntityKind::Arrow => {
13694 entity.insert(ArrowMetadataBundle::default());
13695 }
13696 EntityKind::Axolotl => {
13697 entity.insert(AxolotlMetadataBundle::default());
13698 }
13699 EntityKind::BambooChestRaft => {
13700 entity.insert(BambooChestRaftMetadataBundle::default());
13701 }
13702 EntityKind::BambooRaft => {
13703 entity.insert(BambooRaftMetadataBundle::default());
13704 }
13705 EntityKind::Bat => {
13706 entity.insert(BatMetadataBundle::default());
13707 }
13708 EntityKind::Bee => {
13709 entity.insert(BeeMetadataBundle::default());
13710 }
13711 EntityKind::BirchBoat => {
13712 entity.insert(BirchBoatMetadataBundle::default());
13713 }
13714 EntityKind::BirchChestBoat => {
13715 entity.insert(BirchChestBoatMetadataBundle::default());
13716 }
13717 EntityKind::Blaze => {
13718 entity.insert(BlazeMetadataBundle::default());
13719 }
13720 EntityKind::BlockDisplay => {
13721 entity.insert(BlockDisplayMetadataBundle::default());
13722 }
13723 EntityKind::Bogged => {
13724 entity.insert(BoggedMetadataBundle::default());
13725 }
13726 EntityKind::Breeze => {
13727 entity.insert(BreezeMetadataBundle::default());
13728 }
13729 EntityKind::BreezeWindCharge => {
13730 entity.insert(BreezeWindChargeMetadataBundle::default());
13731 }
13732 EntityKind::Camel => {
13733 entity.insert(CamelMetadataBundle::default());
13734 }
13735 EntityKind::CamelHusk => {
13736 entity.insert(CamelHuskMetadataBundle::default());
13737 }
13738 EntityKind::Cat => {
13739 entity.insert(CatMetadataBundle::default());
13740 }
13741 EntityKind::CaveSpider => {
13742 entity.insert(CaveSpiderMetadataBundle::default());
13743 }
13744 EntityKind::CherryBoat => {
13745 entity.insert(CherryBoatMetadataBundle::default());
13746 }
13747 EntityKind::CherryChestBoat => {
13748 entity.insert(CherryChestBoatMetadataBundle::default());
13749 }
13750 EntityKind::ChestMinecart => {
13751 entity.insert(ChestMinecartMetadataBundle::default());
13752 }
13753 EntityKind::Chicken => {
13754 entity.insert(ChickenMetadataBundle::default());
13755 }
13756 EntityKind::Cod => {
13757 entity.insert(CodMetadataBundle::default());
13758 }
13759 EntityKind::CommandBlockMinecart => {
13760 entity.insert(CommandBlockMinecartMetadataBundle::default());
13761 }
13762 EntityKind::CopperGolem => {
13763 entity.insert(CopperGolemMetadataBundle::default());
13764 }
13765 EntityKind::Cow => {
13766 entity.insert(CowMetadataBundle::default());
13767 }
13768 EntityKind::Creaking => {
13769 entity.insert(CreakingMetadataBundle::default());
13770 }
13771 EntityKind::Creeper => {
13772 entity.insert(CreeperMetadataBundle::default());
13773 }
13774 EntityKind::DarkOakBoat => {
13775 entity.insert(DarkOakBoatMetadataBundle::default());
13776 }
13777 EntityKind::DarkOakChestBoat => {
13778 entity.insert(DarkOakChestBoatMetadataBundle::default());
13779 }
13780 EntityKind::Dolphin => {
13781 entity.insert(DolphinMetadataBundle::default());
13782 }
13783 EntityKind::Donkey => {
13784 entity.insert(DonkeyMetadataBundle::default());
13785 }
13786 EntityKind::DragonFireball => {
13787 entity.insert(DragonFireballMetadataBundle::default());
13788 }
13789 EntityKind::Drowned => {
13790 entity.insert(DrownedMetadataBundle::default());
13791 }
13792 EntityKind::Egg => {
13793 entity.insert(EggMetadataBundle::default());
13794 }
13795 EntityKind::ElderGuardian => {
13796 entity.insert(ElderGuardianMetadataBundle::default());
13797 }
13798 EntityKind::EndCrystal => {
13799 entity.insert(EndCrystalMetadataBundle::default());
13800 }
13801 EntityKind::EnderDragon => {
13802 entity.insert(EnderDragonMetadataBundle::default());
13803 }
13804 EntityKind::EnderPearl => {
13805 entity.insert(EnderPearlMetadataBundle::default());
13806 }
13807 EntityKind::Enderman => {
13808 entity.insert(EndermanMetadataBundle::default());
13809 }
13810 EntityKind::Endermite => {
13811 entity.insert(EndermiteMetadataBundle::default());
13812 }
13813 EntityKind::Evoker => {
13814 entity.insert(EvokerMetadataBundle::default());
13815 }
13816 EntityKind::EvokerFangs => {
13817 entity.insert(EvokerFangsMetadataBundle::default());
13818 }
13819 EntityKind::ExperienceBottle => {
13820 entity.insert(ExperienceBottleMetadataBundle::default());
13821 }
13822 EntityKind::ExperienceOrb => {
13823 entity.insert(ExperienceOrbMetadataBundle::default());
13824 }
13825 EntityKind::EyeOfEnder => {
13826 entity.insert(EyeOfEnderMetadataBundle::default());
13827 }
13828 EntityKind::FallingBlock => {
13829 entity.insert(FallingBlockMetadataBundle::default());
13830 }
13831 EntityKind::Fireball => {
13832 entity.insert(FireballMetadataBundle::default());
13833 }
13834 EntityKind::FireworkRocket => {
13835 entity.insert(FireworkRocketMetadataBundle::default());
13836 }
13837 EntityKind::FishingBobber => {
13838 entity.insert(FishingBobberMetadataBundle::default());
13839 }
13840 EntityKind::Fox => {
13841 entity.insert(FoxMetadataBundle::default());
13842 }
13843 EntityKind::Frog => {
13844 entity.insert(FrogMetadataBundle::default());
13845 }
13846 EntityKind::FurnaceMinecart => {
13847 entity.insert(FurnaceMinecartMetadataBundle::default());
13848 }
13849 EntityKind::Ghast => {
13850 entity.insert(GhastMetadataBundle::default());
13851 }
13852 EntityKind::Giant => {
13853 entity.insert(GiantMetadataBundle::default());
13854 }
13855 EntityKind::GlowItemFrame => {
13856 entity.insert(GlowItemFrameMetadataBundle::default());
13857 }
13858 EntityKind::GlowSquid => {
13859 entity.insert(GlowSquidMetadataBundle::default());
13860 }
13861 EntityKind::Goat => {
13862 entity.insert(GoatMetadataBundle::default());
13863 }
13864 EntityKind::Guardian => {
13865 entity.insert(GuardianMetadataBundle::default());
13866 }
13867 EntityKind::HappyGhast => {
13868 entity.insert(HappyGhastMetadataBundle::default());
13869 }
13870 EntityKind::Hoglin => {
13871 entity.insert(HoglinMetadataBundle::default());
13872 }
13873 EntityKind::HopperMinecart => {
13874 entity.insert(HopperMinecartMetadataBundle::default());
13875 }
13876 EntityKind::Horse => {
13877 entity.insert(HorseMetadataBundle::default());
13878 }
13879 EntityKind::Husk => {
13880 entity.insert(HuskMetadataBundle::default());
13881 }
13882 EntityKind::Illusioner => {
13883 entity.insert(IllusionerMetadataBundle::default());
13884 }
13885 EntityKind::Interaction => {
13886 entity.insert(InteractionMetadataBundle::default());
13887 }
13888 EntityKind::IronGolem => {
13889 entity.insert(IronGolemMetadataBundle::default());
13890 }
13891 EntityKind::Item => {
13892 entity.insert(ItemMetadataBundle::default());
13893 }
13894 EntityKind::ItemDisplay => {
13895 entity.insert(ItemDisplayMetadataBundle::default());
13896 }
13897 EntityKind::ItemFrame => {
13898 entity.insert(ItemFrameMetadataBundle::default());
13899 }
13900 EntityKind::JungleBoat => {
13901 entity.insert(JungleBoatMetadataBundle::default());
13902 }
13903 EntityKind::JungleChestBoat => {
13904 entity.insert(JungleChestBoatMetadataBundle::default());
13905 }
13906 EntityKind::LeashKnot => {
13907 entity.insert(LeashKnotMetadataBundle::default());
13908 }
13909 EntityKind::LightningBolt => {
13910 entity.insert(LightningBoltMetadataBundle::default());
13911 }
13912 EntityKind::LingeringPotion => {
13913 entity.insert(LingeringPotionMetadataBundle::default());
13914 }
13915 EntityKind::Llama => {
13916 entity.insert(LlamaMetadataBundle::default());
13917 }
13918 EntityKind::LlamaSpit => {
13919 entity.insert(LlamaSpitMetadataBundle::default());
13920 }
13921 EntityKind::MagmaCube => {
13922 entity.insert(MagmaCubeMetadataBundle::default());
13923 }
13924 EntityKind::MangroveBoat => {
13925 entity.insert(MangroveBoatMetadataBundle::default());
13926 }
13927 EntityKind::MangroveChestBoat => {
13928 entity.insert(MangroveChestBoatMetadataBundle::default());
13929 }
13930 EntityKind::Mannequin => {
13931 entity.insert(MannequinMetadataBundle::default());
13932 }
13933 EntityKind::Marker => {
13934 entity.insert(MarkerMetadataBundle::default());
13935 }
13936 EntityKind::Minecart => {
13937 entity.insert(MinecartMetadataBundle::default());
13938 }
13939 EntityKind::Mooshroom => {
13940 entity.insert(MooshroomMetadataBundle::default());
13941 }
13942 EntityKind::Mule => {
13943 entity.insert(MuleMetadataBundle::default());
13944 }
13945 EntityKind::Nautilus => {
13946 entity.insert(NautilusMetadataBundle::default());
13947 }
13948 EntityKind::OakBoat => {
13949 entity.insert(OakBoatMetadataBundle::default());
13950 }
13951 EntityKind::OakChestBoat => {
13952 entity.insert(OakChestBoatMetadataBundle::default());
13953 }
13954 EntityKind::Ocelot => {
13955 entity.insert(OcelotMetadataBundle::default());
13956 }
13957 EntityKind::OminousItemSpawner => {
13958 entity.insert(OminousItemSpawnerMetadataBundle::default());
13959 }
13960 EntityKind::Painting => {
13961 entity.insert(PaintingMetadataBundle::default());
13962 }
13963 EntityKind::PaleOakBoat => {
13964 entity.insert(PaleOakBoatMetadataBundle::default());
13965 }
13966 EntityKind::PaleOakChestBoat => {
13967 entity.insert(PaleOakChestBoatMetadataBundle::default());
13968 }
13969 EntityKind::Panda => {
13970 entity.insert(PandaMetadataBundle::default());
13971 }
13972 EntityKind::Parched => {
13973 entity.insert(ParchedMetadataBundle::default());
13974 }
13975 EntityKind::Parrot => {
13976 entity.insert(ParrotMetadataBundle::default());
13977 }
13978 EntityKind::Phantom => {
13979 entity.insert(PhantomMetadataBundle::default());
13980 }
13981 EntityKind::Pig => {
13982 entity.insert(PigMetadataBundle::default());
13983 }
13984 EntityKind::Piglin => {
13985 entity.insert(PiglinMetadataBundle::default());
13986 }
13987 EntityKind::PiglinBrute => {
13988 entity.insert(PiglinBruteMetadataBundle::default());
13989 }
13990 EntityKind::Pillager => {
13991 entity.insert(PillagerMetadataBundle::default());
13992 }
13993 EntityKind::Player => {
13994 entity.insert(PlayerMetadataBundle::default());
13995 }
13996 EntityKind::PolarBear => {
13997 entity.insert(PolarBearMetadataBundle::default());
13998 }
13999 EntityKind::Pufferfish => {
14000 entity.insert(PufferfishMetadataBundle::default());
14001 }
14002 EntityKind::Rabbit => {
14003 entity.insert(RabbitMetadataBundle::default());
14004 }
14005 EntityKind::Ravager => {
14006 entity.insert(RavagerMetadataBundle::default());
14007 }
14008 EntityKind::Salmon => {
14009 entity.insert(SalmonMetadataBundle::default());
14010 }
14011 EntityKind::Sheep => {
14012 entity.insert(SheepMetadataBundle::default());
14013 }
14014 EntityKind::Shulker => {
14015 entity.insert(ShulkerMetadataBundle::default());
14016 }
14017 EntityKind::ShulkerBullet => {
14018 entity.insert(ShulkerBulletMetadataBundle::default());
14019 }
14020 EntityKind::Silverfish => {
14021 entity.insert(SilverfishMetadataBundle::default());
14022 }
14023 EntityKind::Skeleton => {
14024 entity.insert(SkeletonMetadataBundle::default());
14025 }
14026 EntityKind::SkeletonHorse => {
14027 entity.insert(SkeletonHorseMetadataBundle::default());
14028 }
14029 EntityKind::Slime => {
14030 entity.insert(SlimeMetadataBundle::default());
14031 }
14032 EntityKind::SmallFireball => {
14033 entity.insert(SmallFireballMetadataBundle::default());
14034 }
14035 EntityKind::Sniffer => {
14036 entity.insert(SnifferMetadataBundle::default());
14037 }
14038 EntityKind::SnowGolem => {
14039 entity.insert(SnowGolemMetadataBundle::default());
14040 }
14041 EntityKind::Snowball => {
14042 entity.insert(SnowballMetadataBundle::default());
14043 }
14044 EntityKind::SpawnerMinecart => {
14045 entity.insert(SpawnerMinecartMetadataBundle::default());
14046 }
14047 EntityKind::SpectralArrow => {
14048 entity.insert(SpectralArrowMetadataBundle::default());
14049 }
14050 EntityKind::Spider => {
14051 entity.insert(SpiderMetadataBundle::default());
14052 }
14053 EntityKind::SplashPotion => {
14054 entity.insert(SplashPotionMetadataBundle::default());
14055 }
14056 EntityKind::SpruceBoat => {
14057 entity.insert(SpruceBoatMetadataBundle::default());
14058 }
14059 EntityKind::SpruceChestBoat => {
14060 entity.insert(SpruceChestBoatMetadataBundle::default());
14061 }
14062 EntityKind::Squid => {
14063 entity.insert(SquidMetadataBundle::default());
14064 }
14065 EntityKind::Stray => {
14066 entity.insert(StrayMetadataBundle::default());
14067 }
14068 EntityKind::Strider => {
14069 entity.insert(StriderMetadataBundle::default());
14070 }
14071 EntityKind::SulfurCube => {
14072 entity.insert(SulfurCubeMetadataBundle::default());
14073 }
14074 EntityKind::Tadpole => {
14075 entity.insert(TadpoleMetadataBundle::default());
14076 }
14077 EntityKind::TextDisplay => {
14078 entity.insert(TextDisplayMetadataBundle::default());
14079 }
14080 EntityKind::Tnt => {
14081 entity.insert(TntMetadataBundle::default());
14082 }
14083 EntityKind::TntMinecart => {
14084 entity.insert(TntMinecartMetadataBundle::default());
14085 }
14086 EntityKind::TraderLlama => {
14087 entity.insert(TraderLlamaMetadataBundle::default());
14088 }
14089 EntityKind::Trident => {
14090 entity.insert(TridentMetadataBundle::default());
14091 }
14092 EntityKind::TropicalFish => {
14093 entity.insert(TropicalFishMetadataBundle::default());
14094 }
14095 EntityKind::Turtle => {
14096 entity.insert(TurtleMetadataBundle::default());
14097 }
14098 EntityKind::Vex => {
14099 entity.insert(VexMetadataBundle::default());
14100 }
14101 EntityKind::Villager => {
14102 entity.insert(VillagerMetadataBundle::default());
14103 }
14104 EntityKind::Vindicator => {
14105 entity.insert(VindicatorMetadataBundle::default());
14106 }
14107 EntityKind::WanderingTrader => {
14108 entity.insert(WanderingTraderMetadataBundle::default());
14109 }
14110 EntityKind::Warden => {
14111 entity.insert(WardenMetadataBundle::default());
14112 }
14113 EntityKind::WindCharge => {
14114 entity.insert(WindChargeMetadataBundle::default());
14115 }
14116 EntityKind::Witch => {
14117 entity.insert(WitchMetadataBundle::default());
14118 }
14119 EntityKind::Wither => {
14120 entity.insert(WitherMetadataBundle::default());
14121 }
14122 EntityKind::WitherSkeleton => {
14123 entity.insert(WitherSkeletonMetadataBundle::default());
14124 }
14125 EntityKind::WitherSkull => {
14126 entity.insert(WitherSkullMetadataBundle::default());
14127 }
14128 EntityKind::Wolf => {
14129 entity.insert(WolfMetadataBundle::default());
14130 }
14131 EntityKind::Zoglin => {
14132 entity.insert(ZoglinMetadataBundle::default());
14133 }
14134 EntityKind::Zombie => {
14135 entity.insert(ZombieMetadataBundle::default());
14136 }
14137 EntityKind::ZombieHorse => {
14138 entity.insert(ZombieHorseMetadataBundle::default());
14139 }
14140 EntityKind::ZombieNautilus => {
14141 entity.insert(ZombieNautilusMetadataBundle::default());
14142 }
14143 EntityKind::ZombieVillager => {
14144 entity.insert(ZombieVillagerMetadataBundle::default());
14145 }
14146 EntityKind::ZombifiedPiglin => {
14147 entity.insert(ZombifiedPiglinMetadataBundle::default());
14148 }
14149 }
14150}