1#![allow(clippy::single_match, non_snake_case)]
203
204use azalea_chat::FormattedText;
205use azalea_core::{
206 direction::Direction,
207 position::{BlockPos, Vec3f32},
208};
209use azalea_registry::{
210 builtin::EntityKind,
211 item::{
212 ItemStack,
213 components::{self, DyeColor},
214 },
215};
216use bevy_ecs::{bundle::Bundle, component::Component};
217use derive_more::{Deref, DerefMut};
218use thiserror::Error;
219use uuid::Uuid;
220
221use super::{
222 ArmadilloStateKind, CopperGolemStateKind, EntityDataItem, EntityDataValue, OptionalUnsignedInt,
223 Pose, Quaternion, Rotations, SnifferStateKind, VillagerData, WeatheringCopperStateKind,
224};
225use crate::{EntityParticle, HumanoidArm};
226
227#[derive(Error, Debug)]
228pub enum UpdateMetadataError {
229 #[error("Wrong type ({0:?})")]
230 WrongType(Box<WrongTypeError>),
231}
232#[derive(Debug)]
233pub struct WrongTypeError {
234 pub v: EntityDataValue,
235 pub id: u8,
236 pub struct_name: String,
237}
238fn e(v: EntityDataValue, id: u8, struct_name: &str) -> UpdateMetadataError {
239 UpdateMetadataError::WrongType(Box::new(WrongTypeError {
240 v,
241 id,
242 struct_name: struct_name.to_owned(),
243 }))
244}
245
246#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
247pub struct OnFire(pub bool);
249#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
250pub struct AbstractEntityShiftKeyDown(pub bool);
252#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
253pub struct Sprinting(pub bool);
255#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
256pub struct Swimming(pub bool);
258#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
259pub struct CurrentlyGlowing(pub bool);
261#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
262pub struct Invisible(pub bool);
264#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
265pub struct FallFlying(pub bool);
267#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
269pub struct AirSupply(pub i32);
270#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
272pub struct CustomName(pub Option<Box<FormattedText>>);
273#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
275pub struct CustomNameVisible(pub bool);
276#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
278pub struct Silent(pub bool);
279#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
281pub struct NoGravity(pub bool);
282#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
284pub struct TicksFrozen(pub i32);
285#[derive(Component)]
497pub struct AbstractEntity;
498impl AbstractEntity {
499 fn apply_metadata(
500 entity: &mut bevy_ecs::system::EntityCommands,
501 d: EntityDataItem,
502 ) -> Result<(), UpdateMetadataError> {
503 match d.index {
504 0 => {
505 let bitfield = d
506 .value
507 .into_byte()
508 .map_err(|v| e(v, d.index, "<bitfield>"))?;
509 entity.insert(OnFire(bitfield & 0x1 != 0));
510 entity.insert(AbstractEntityShiftKeyDown(bitfield & 0x2 != 0));
511 entity.insert(Sprinting(bitfield & 0x8 != 0));
512 entity.insert(Swimming(bitfield & 0x10 != 0));
513 entity.insert(CurrentlyGlowing(bitfield & 0x40 != 0));
514 entity.insert(Invisible(bitfield & 0x20 != 0));
515 entity.insert(FallFlying(bitfield & 0x80 != 0));
516 }
517 1 => {
518 entity.insert(AirSupply(
519 d.value.into_int().map_err(|v| e(v, d.index, "AirSupply"))?,
520 ));
521 }
522 2 => {
523 entity.insert(CustomName(
524 d.value
525 .into_optional_formatted_text()
526 .map_err(|v| e(v, d.index, "CustomName"))?,
527 ));
528 }
529 3 => {
530 entity.insert(CustomNameVisible(
531 d.value
532 .into_boolean()
533 .map_err(|v| e(v, d.index, "CustomNameVisible"))?,
534 ));
535 }
536 4 => {
537 entity.insert(Silent(
538 d.value
539 .into_boolean()
540 .map_err(|v| e(v, d.index, "Silent"))?,
541 ));
542 }
543 5 => {
544 entity.insert(NoGravity(
545 d.value
546 .into_boolean()
547 .map_err(|v| e(v, d.index, "NoGravity"))?,
548 ));
549 }
550 6 => {
551 entity.insert(d.value.into_pose().map_err(|v| e(v, d.index, ""))?);
552 }
553 7 => {
554 entity.insert(TicksFrozen(
555 d.value
556 .into_int()
557 .map_err(|v| e(v, d.index, "TicksFrozen"))?,
558 ));
559 }
560 _ => {}
561 }
562 Ok(())
563 }
564}
565
566#[derive(Bundle)]
570pub struct AbstractEntityMetadataBundle {
571 _marker: AbstractEntity,
572 on_fire: OnFire,
573 abstract_entity_shift_key_down: AbstractEntityShiftKeyDown,
574 sprinting: Sprinting,
575 swimming: Swimming,
576 currently_glowing: CurrentlyGlowing,
577 invisible: Invisible,
578 fall_flying: FallFlying,
579 air_supply: AirSupply,
580 custom_name: CustomName,
581 custom_name_visible: CustomNameVisible,
582 silent: Silent,
583 no_gravity: NoGravity,
584 pose: Pose,
585 ticks_frozen: TicksFrozen,
586}
587impl Default for AbstractEntityMetadataBundle {
588 fn default() -> Self {
589 Self {
590 _marker: AbstractEntity,
591 on_fire: OnFire(false),
592 abstract_entity_shift_key_down: AbstractEntityShiftKeyDown(false),
593 sprinting: Sprinting(false),
594 swimming: Swimming(false),
595 currently_glowing: CurrentlyGlowing(false),
596 invisible: Invisible(false),
597 fall_flying: FallFlying(false),
598 air_supply: AirSupply(300),
599 custom_name: CustomName(None),
600 custom_name_visible: CustomNameVisible(false),
601 silent: Silent(false),
602 no_gravity: NoGravity(false),
603 pose: Pose::default(),
604 ticks_frozen: TicksFrozen(0),
605 }
606 }
607}
608
609#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
611pub struct Radius(pub f32);
612#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
614pub struct Waiting(pub bool);
615#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
617pub struct Particle(pub EntityParticle);
618#[derive(Component)]
641pub struct AreaEffectCloud;
642impl AreaEffectCloud {
643 fn apply_metadata(
644 entity: &mut bevy_ecs::system::EntityCommands,
645 d: EntityDataItem,
646 ) -> Result<(), UpdateMetadataError> {
647 match d.index {
648 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
649 8 => {
650 entity.insert(Radius(
651 d.value.into_float().map_err(|v| e(v, d.index, "Radius"))?,
652 ));
653 }
654 9 => {
655 entity.insert(Waiting(
656 d.value
657 .into_boolean()
658 .map_err(|v| e(v, d.index, "Waiting"))?,
659 ));
660 }
661 10 => {
662 entity.insert(Particle(
663 d.value
664 .into_particle()
665 .map_err(|v| e(v, d.index, "Particle"))?,
666 ));
667 }
668 _ => {}
669 }
670 Ok(())
671 }
672}
673
674#[derive(Bundle)]
678pub struct AreaEffectCloudMetadataBundle {
679 _marker: AreaEffectCloud,
680 parent: AbstractEntityMetadataBundle,
681 radius: Radius,
682 waiting: Waiting,
683 particle: Particle,
684}
685impl Default for AreaEffectCloudMetadataBundle {
686 fn default() -> Self {
687 Self {
688 _marker: AreaEffectCloud,
689 parent: Default::default(),
690 radius: Radius(3.0),
691 waiting: Waiting(false),
692 particle: Particle(Default::default()),
693 }
694 }
695}
696
697#[derive(Component)]
715pub struct BreezeWindCharge;
716impl BreezeWindCharge {
717 fn apply_metadata(
718 entity: &mut bevy_ecs::system::EntityCommands,
719 d: EntityDataItem,
720 ) -> Result<(), UpdateMetadataError> {
721 match d.index {
722 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
723 _ => {}
724 }
725 Ok(())
726 }
727}
728
729#[derive(Bundle)]
733pub struct BreezeWindChargeMetadataBundle {
734 _marker: BreezeWindCharge,
735 parent: AbstractEntityMetadataBundle,
736}
737impl Default for BreezeWindChargeMetadataBundle {
738 fn default() -> Self {
739 Self {
740 _marker: BreezeWindCharge,
741 parent: Default::default(),
742 }
743 }
744}
745
746#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
748pub struct CushionColor(pub DyeColor);
749#[derive(Component)]
769pub struct Cushion;
770impl Cushion {
771 fn apply_metadata(
772 entity: &mut bevy_ecs::system::EntityCommands,
773 d: EntityDataItem,
774 ) -> Result<(), UpdateMetadataError> {
775 match d.index {
776 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
777 8 => {
778 entity.insert(CushionColor(
779 d.value
780 .into_dye_color()
781 .map_err(|v| e(v, d.index, "CushionColor"))?,
782 ));
783 }
784 _ => {}
785 }
786 Ok(())
787 }
788}
789
790#[derive(Bundle)]
794pub struct CushionMetadataBundle {
795 _marker: Cushion,
796 parent: AbstractEntityMetadataBundle,
797 cushion_color: CushionColor,
798}
799impl Default for CushionMetadataBundle {
800 fn default() -> Self {
801 Self {
802 _marker: Cushion,
803 parent: Default::default(),
804 cushion_color: CushionColor(Default::default()),
805 }
806 }
807}
808
809#[derive(Component)]
827pub struct DragonFireball;
828impl DragonFireball {
829 fn apply_metadata(
830 entity: &mut bevy_ecs::system::EntityCommands,
831 d: EntityDataItem,
832 ) -> Result<(), UpdateMetadataError> {
833 match d.index {
834 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
835 _ => {}
836 }
837 Ok(())
838 }
839}
840
841#[derive(Bundle)]
845pub struct DragonFireballMetadataBundle {
846 _marker: DragonFireball,
847 parent: AbstractEntityMetadataBundle,
848}
849impl Default for DragonFireballMetadataBundle {
850 fn default() -> Self {
851 Self {
852 _marker: DragonFireball,
853 parent: Default::default(),
854 }
855 }
856}
857
858#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
860pub struct BeamTarget(pub Option<BlockPos>);
861#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
863pub struct ShowBottom(pub bool);
864#[derive(Component)]
886pub struct EndCrystal;
887impl EndCrystal {
888 fn apply_metadata(
889 entity: &mut bevy_ecs::system::EntityCommands,
890 d: EntityDataItem,
891 ) -> Result<(), UpdateMetadataError> {
892 match d.index {
893 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
894 8 => {
895 entity.insert(BeamTarget(
896 d.value
897 .into_optional_block_pos()
898 .map_err(|v| e(v, d.index, "BeamTarget"))?,
899 ));
900 }
901 9 => {
902 entity.insert(ShowBottom(
903 d.value
904 .into_boolean()
905 .map_err(|v| e(v, d.index, "ShowBottom"))?,
906 ));
907 }
908 _ => {}
909 }
910 Ok(())
911 }
912}
913
914#[derive(Bundle)]
918pub struct EndCrystalMetadataBundle {
919 _marker: EndCrystal,
920 parent: AbstractEntityMetadataBundle,
921 beam_target: BeamTarget,
922 show_bottom: ShowBottom,
923}
924impl Default for EndCrystalMetadataBundle {
925 fn default() -> Self {
926 Self {
927 _marker: EndCrystal,
928 parent: Default::default(),
929 beam_target: BeamTarget(None),
930 show_bottom: ShowBottom(true),
931 }
932 }
933}
934
935#[derive(Component)]
953pub struct EvokerFangs;
954impl EvokerFangs {
955 fn apply_metadata(
956 entity: &mut bevy_ecs::system::EntityCommands,
957 d: EntityDataItem,
958 ) -> Result<(), UpdateMetadataError> {
959 match d.index {
960 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
961 _ => {}
962 }
963 Ok(())
964 }
965}
966
967#[derive(Bundle)]
971pub struct EvokerFangsMetadataBundle {
972 _marker: EvokerFangs,
973 parent: AbstractEntityMetadataBundle,
974}
975impl Default for EvokerFangsMetadataBundle {
976 fn default() -> Self {
977 Self {
978 _marker: EvokerFangs,
979 parent: Default::default(),
980 }
981 }
982}
983
984#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
986pub struct Value(pub i32);
987#[derive(Component)]
1008pub struct ExperienceOrb;
1009impl ExperienceOrb {
1010 fn apply_metadata(
1011 entity: &mut bevy_ecs::system::EntityCommands,
1012 d: EntityDataItem,
1013 ) -> Result<(), UpdateMetadataError> {
1014 match d.index {
1015 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1016 8 => {
1017 entity.insert(Value(
1018 d.value.into_int().map_err(|v| e(v, d.index, "Value"))?,
1019 ));
1020 }
1021 _ => {}
1022 }
1023 Ok(())
1024 }
1025}
1026
1027#[derive(Bundle)]
1031pub struct ExperienceOrbMetadataBundle {
1032 _marker: ExperienceOrb,
1033 parent: AbstractEntityMetadataBundle,
1034 value: Value,
1035}
1036impl Default for ExperienceOrbMetadataBundle {
1037 fn default() -> Self {
1038 Self {
1039 _marker: ExperienceOrb,
1040 parent: Default::default(),
1041 value: Value(0),
1042 }
1043 }
1044}
1045
1046#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1048pub struct EyeOfEnderItemStack(pub ItemStack);
1049#[derive(Component)]
1070pub struct EyeOfEnder;
1071impl EyeOfEnder {
1072 fn apply_metadata(
1073 entity: &mut bevy_ecs::system::EntityCommands,
1074 d: EntityDataItem,
1075 ) -> Result<(), UpdateMetadataError> {
1076 match d.index {
1077 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1078 8 => {
1079 entity.insert(EyeOfEnderItemStack(
1080 d.value
1081 .into_item_stack()
1082 .map_err(|v| e(v, d.index, "EyeOfEnderItemStack"))?,
1083 ));
1084 }
1085 _ => {}
1086 }
1087 Ok(())
1088 }
1089}
1090
1091#[derive(Bundle)]
1095pub struct EyeOfEnderMetadataBundle {
1096 _marker: EyeOfEnder,
1097 parent: AbstractEntityMetadataBundle,
1098 eye_of_ender_item_stack: EyeOfEnderItemStack,
1099}
1100impl Default for EyeOfEnderMetadataBundle {
1101 fn default() -> Self {
1102 Self {
1103 _marker: EyeOfEnder,
1104 parent: Default::default(),
1105 eye_of_ender_item_stack: EyeOfEnderItemStack(Default::default()),
1106 }
1107 }
1108}
1109
1110#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1112pub struct StartPos(pub BlockPos);
1113#[derive(Component)]
1134pub struct FallingBlock;
1135impl FallingBlock {
1136 fn apply_metadata(
1137 entity: &mut bevy_ecs::system::EntityCommands,
1138 d: EntityDataItem,
1139 ) -> Result<(), UpdateMetadataError> {
1140 match d.index {
1141 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1142 8 => {
1143 entity.insert(StartPos(
1144 d.value
1145 .into_block_pos()
1146 .map_err(|v| e(v, d.index, "StartPos"))?,
1147 ));
1148 }
1149 _ => {}
1150 }
1151 Ok(())
1152 }
1153}
1154
1155#[derive(Bundle)]
1159pub struct FallingBlockMetadataBundle {
1160 _marker: FallingBlock,
1161 parent: AbstractEntityMetadataBundle,
1162 start_pos: StartPos,
1163}
1164impl Default for FallingBlockMetadataBundle {
1165 fn default() -> Self {
1166 Self {
1167 _marker: FallingBlock,
1168 parent: Default::default(),
1169 start_pos: StartPos(BlockPos::new(0, 0, 0)),
1170 }
1171 }
1172}
1173
1174#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1176pub struct FireballItemStack(pub ItemStack);
1177#[derive(Component)]
1198pub struct Fireball;
1199impl Fireball {
1200 fn apply_metadata(
1201 entity: &mut bevy_ecs::system::EntityCommands,
1202 d: EntityDataItem,
1203 ) -> Result<(), UpdateMetadataError> {
1204 match d.index {
1205 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1206 8 => {
1207 entity.insert(FireballItemStack(
1208 d.value
1209 .into_item_stack()
1210 .map_err(|v| e(v, d.index, "FireballItemStack"))?,
1211 ));
1212 }
1213 _ => {}
1214 }
1215 Ok(())
1216 }
1217}
1218
1219#[derive(Bundle)]
1223pub struct FireballMetadataBundle {
1224 _marker: Fireball,
1225 parent: AbstractEntityMetadataBundle,
1226 fireball_item_stack: FireballItemStack,
1227}
1228impl Default for FireballMetadataBundle {
1229 fn default() -> Self {
1230 Self {
1231 _marker: Fireball,
1232 parent: Default::default(),
1233 fireball_item_stack: FireballItemStack(Default::default()),
1234 }
1235 }
1236}
1237
1238#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1240pub struct FireworksItem(pub ItemStack);
1241#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1243pub struct AttachedToTarget(pub OptionalUnsignedInt);
1244#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1246pub struct ShotAtAngle(pub bool);
1247#[derive(Component)]
1270pub struct FireworkRocket;
1271impl FireworkRocket {
1272 fn apply_metadata(
1273 entity: &mut bevy_ecs::system::EntityCommands,
1274 d: EntityDataItem,
1275 ) -> Result<(), UpdateMetadataError> {
1276 match d.index {
1277 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1278 8 => {
1279 entity.insert(FireworksItem(
1280 d.value
1281 .into_item_stack()
1282 .map_err(|v| e(v, d.index, "FireworksItem"))?,
1283 ));
1284 }
1285 9 => {
1286 entity.insert(AttachedToTarget(
1287 d.value
1288 .into_optional_unsigned_int()
1289 .map_err(|v| e(v, d.index, "AttachedToTarget"))?,
1290 ));
1291 }
1292 10 => {
1293 entity.insert(ShotAtAngle(
1294 d.value
1295 .into_boolean()
1296 .map_err(|v| e(v, d.index, "ShotAtAngle"))?,
1297 ));
1298 }
1299 _ => {}
1300 }
1301 Ok(())
1302 }
1303}
1304
1305#[derive(Bundle)]
1309pub struct FireworkRocketMetadataBundle {
1310 _marker: FireworkRocket,
1311 parent: AbstractEntityMetadataBundle,
1312 fireworks_item: FireworksItem,
1313 attached_to_target: AttachedToTarget,
1314 shot_at_angle: ShotAtAngle,
1315}
1316impl Default for FireworkRocketMetadataBundle {
1317 fn default() -> Self {
1318 Self {
1319 _marker: FireworkRocket,
1320 parent: Default::default(),
1321 fireworks_item: FireworksItem(Default::default()),
1322 attached_to_target: AttachedToTarget(OptionalUnsignedInt(None)),
1323 shot_at_angle: ShotAtAngle(false),
1324 }
1325 }
1326}
1327
1328#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1330pub struct HookedEntity(pub i32);
1331#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1333pub struct Biting(pub bool);
1334#[derive(Component)]
1356pub struct FishingBobber;
1357impl FishingBobber {
1358 fn apply_metadata(
1359 entity: &mut bevy_ecs::system::EntityCommands,
1360 d: EntityDataItem,
1361 ) -> Result<(), UpdateMetadataError> {
1362 match d.index {
1363 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1364 8 => {
1365 entity.insert(HookedEntity(
1366 d.value
1367 .into_int()
1368 .map_err(|v| e(v, d.index, "HookedEntity"))?,
1369 ));
1370 }
1371 9 => {
1372 entity.insert(Biting(
1373 d.value
1374 .into_boolean()
1375 .map_err(|v| e(v, d.index, "Biting"))?,
1376 ));
1377 }
1378 _ => {}
1379 }
1380 Ok(())
1381 }
1382}
1383
1384#[derive(Bundle)]
1388pub struct FishingBobberMetadataBundle {
1389 _marker: FishingBobber,
1390 parent: AbstractEntityMetadataBundle,
1391 hooked_entity: HookedEntity,
1392 biting: Biting,
1393}
1394impl Default for FishingBobberMetadataBundle {
1395 fn default() -> Self {
1396 Self {
1397 _marker: FishingBobber,
1398 parent: Default::default(),
1399 hooked_entity: HookedEntity(0),
1400 biting: Biting(false),
1401 }
1402 }
1403}
1404
1405#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1407pub struct InteractionWidth(pub f32);
1408#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1410pub struct InteractionHeight(pub f32);
1411#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1413pub struct Response(pub bool);
1414#[derive(Component)]
1437pub struct Interaction;
1438impl Interaction {
1439 fn apply_metadata(
1440 entity: &mut bevy_ecs::system::EntityCommands,
1441 d: EntityDataItem,
1442 ) -> Result<(), UpdateMetadataError> {
1443 match d.index {
1444 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1445 8 => {
1446 entity.insert(InteractionWidth(
1447 d.value
1448 .into_float()
1449 .map_err(|v| e(v, d.index, "InteractionWidth"))?,
1450 ));
1451 }
1452 9 => {
1453 entity.insert(InteractionHeight(
1454 d.value
1455 .into_float()
1456 .map_err(|v| e(v, d.index, "InteractionHeight"))?,
1457 ));
1458 }
1459 10 => {
1460 entity.insert(Response(
1461 d.value
1462 .into_boolean()
1463 .map_err(|v| e(v, d.index, "Response"))?,
1464 ));
1465 }
1466 _ => {}
1467 }
1468 Ok(())
1469 }
1470}
1471
1472#[derive(Bundle)]
1476pub struct InteractionMetadataBundle {
1477 _marker: Interaction,
1478 parent: AbstractEntityMetadataBundle,
1479 interaction_width: InteractionWidth,
1480 interaction_height: InteractionHeight,
1481 response: Response,
1482}
1483impl Default for InteractionMetadataBundle {
1484 fn default() -> Self {
1485 Self {
1486 _marker: Interaction,
1487 parent: Default::default(),
1488 interaction_width: InteractionWidth(1.0),
1489 interaction_height: InteractionHeight(1.0),
1490 response: Response(false),
1491 }
1492 }
1493}
1494
1495#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1497pub struct ItemItem(pub ItemStack);
1498#[derive(Component)]
1518pub struct Item;
1519impl Item {
1520 fn apply_metadata(
1521 entity: &mut bevy_ecs::system::EntityCommands,
1522 d: EntityDataItem,
1523 ) -> Result<(), UpdateMetadataError> {
1524 match d.index {
1525 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1526 8 => {
1527 entity.insert(ItemItem(
1528 d.value
1529 .into_item_stack()
1530 .map_err(|v| e(v, d.index, "ItemItem"))?,
1531 ));
1532 }
1533 _ => {}
1534 }
1535 Ok(())
1536 }
1537}
1538
1539#[derive(Bundle)]
1543pub struct ItemMetadataBundle {
1544 _marker: Item,
1545 parent: AbstractEntityMetadataBundle,
1546 item_item: ItemItem,
1547}
1548impl Default for ItemMetadataBundle {
1549 fn default() -> Self {
1550 Self {
1551 _marker: Item,
1552 parent: Default::default(),
1553 item_item: ItemItem(Default::default()),
1554 }
1555 }
1556}
1557
1558#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1560pub struct ItemFrameDirection(pub Direction);
1561#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1563pub struct ItemFrameItem(pub ItemStack);
1564#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1566pub struct Rotation(pub i32);
1567#[derive(Component)]
1590pub struct ItemFrame;
1591impl ItemFrame {
1592 fn apply_metadata(
1593 entity: &mut bevy_ecs::system::EntityCommands,
1594 d: EntityDataItem,
1595 ) -> Result<(), UpdateMetadataError> {
1596 match d.index {
1597 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1598 8 => {
1599 entity.insert(ItemFrameDirection(
1600 d.value
1601 .into_direction()
1602 .map_err(|v| e(v, d.index, "ItemFrameDirection"))?,
1603 ));
1604 }
1605 9 => {
1606 entity.insert(ItemFrameItem(
1607 d.value
1608 .into_item_stack()
1609 .map_err(|v| e(v, d.index, "ItemFrameItem"))?,
1610 ));
1611 }
1612 10 => {
1613 entity.insert(Rotation(
1614 d.value.into_int().map_err(|v| e(v, d.index, "Rotation"))?,
1615 ));
1616 }
1617 _ => {}
1618 }
1619 Ok(())
1620 }
1621}
1622
1623#[derive(Bundle)]
1627pub struct ItemFrameMetadataBundle {
1628 _marker: ItemFrame,
1629 parent: AbstractEntityMetadataBundle,
1630 item_frame_direction: ItemFrameDirection,
1631 item_frame_item: ItemFrameItem,
1632 rotation: Rotation,
1633}
1634impl Default for ItemFrameMetadataBundle {
1635 fn default() -> Self {
1636 Self {
1637 _marker: ItemFrame,
1638 parent: Default::default(),
1639 item_frame_direction: ItemFrameDirection(Default::default()),
1640 item_frame_item: ItemFrameItem(Default::default()),
1641 rotation: Rotation(0),
1642 }
1643 }
1644}
1645
1646#[derive(Component)]
1665pub struct GlowItemFrame;
1666impl GlowItemFrame {
1667 fn apply_metadata(
1668 entity: &mut bevy_ecs::system::EntityCommands,
1669 d: EntityDataItem,
1670 ) -> Result<(), UpdateMetadataError> {
1671 match d.index {
1672 0..=10 => ItemFrame::apply_metadata(entity, d)?,
1673 _ => {}
1674 }
1675 Ok(())
1676 }
1677}
1678
1679#[derive(Bundle)]
1683pub struct GlowItemFrameMetadataBundle {
1684 _marker: GlowItemFrame,
1685 parent: ItemFrameMetadataBundle,
1686}
1687impl Default for GlowItemFrameMetadataBundle {
1688 fn default() -> Self {
1689 Self {
1690 _marker: GlowItemFrame,
1691 parent: Default::default(),
1692 }
1693 }
1694}
1695
1696#[derive(Component)]
1714pub struct LeashKnot;
1715impl LeashKnot {
1716 fn apply_metadata(
1717 entity: &mut bevy_ecs::system::EntityCommands,
1718 d: EntityDataItem,
1719 ) -> Result<(), UpdateMetadataError> {
1720 match d.index {
1721 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1722 _ => {}
1723 }
1724 Ok(())
1725 }
1726}
1727
1728#[derive(Bundle)]
1732pub struct LeashKnotMetadataBundle {
1733 _marker: LeashKnot,
1734 parent: AbstractEntityMetadataBundle,
1735}
1736impl Default for LeashKnotMetadataBundle {
1737 fn default() -> Self {
1738 Self {
1739 _marker: LeashKnot,
1740 parent: Default::default(),
1741 }
1742 }
1743}
1744
1745#[derive(Component)]
1763pub struct LightningBolt;
1764impl LightningBolt {
1765 fn apply_metadata(
1766 entity: &mut bevy_ecs::system::EntityCommands,
1767 d: EntityDataItem,
1768 ) -> Result<(), UpdateMetadataError> {
1769 match d.index {
1770 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1771 _ => {}
1772 }
1773 Ok(())
1774 }
1775}
1776
1777#[derive(Bundle)]
1781pub struct LightningBoltMetadataBundle {
1782 _marker: LightningBolt,
1783 parent: AbstractEntityMetadataBundle,
1784}
1785impl Default for LightningBoltMetadataBundle {
1786 fn default() -> Self {
1787 Self {
1788 _marker: LightningBolt,
1789 parent: Default::default(),
1790 }
1791 }
1792}
1793
1794#[derive(Component)]
1812pub struct LlamaSpit;
1813impl LlamaSpit {
1814 fn apply_metadata(
1815 entity: &mut bevy_ecs::system::EntityCommands,
1816 d: EntityDataItem,
1817 ) -> Result<(), UpdateMetadataError> {
1818 match d.index {
1819 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1820 _ => {}
1821 }
1822 Ok(())
1823 }
1824}
1825
1826#[derive(Bundle)]
1830pub struct LlamaSpitMetadataBundle {
1831 _marker: LlamaSpit,
1832 parent: AbstractEntityMetadataBundle,
1833}
1834impl Default for LlamaSpitMetadataBundle {
1835 fn default() -> Self {
1836 Self {
1837 _marker: LlamaSpit,
1838 parent: Default::default(),
1839 }
1840 }
1841}
1842
1843#[derive(Component)]
1861pub struct Marker;
1862impl Marker {
1863 fn apply_metadata(
1864 entity: &mut bevy_ecs::system::EntityCommands,
1865 d: EntityDataItem,
1866 ) -> Result<(), UpdateMetadataError> {
1867 match d.index {
1868 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1869 _ => {}
1870 }
1871 Ok(())
1872 }
1873}
1874
1875#[derive(Bundle)]
1879pub struct MarkerMetadataBundle {
1880 _marker: Marker,
1881 parent: AbstractEntityMetadataBundle,
1882}
1883impl Default for MarkerMetadataBundle {
1884 fn default() -> Self {
1885 Self {
1886 _marker: Marker,
1887 parent: Default::default(),
1888 }
1889 }
1890}
1891
1892#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1894pub struct OminousItemSpawnerItem(pub ItemStack);
1895#[derive(Component)]
1916pub struct OminousItemSpawner;
1917impl OminousItemSpawner {
1918 fn apply_metadata(
1919 entity: &mut bevy_ecs::system::EntityCommands,
1920 d: EntityDataItem,
1921 ) -> Result<(), UpdateMetadataError> {
1922 match d.index {
1923 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1924 8 => {
1925 entity.insert(OminousItemSpawnerItem(
1926 d.value
1927 .into_item_stack()
1928 .map_err(|v| e(v, d.index, "OminousItemSpawnerItem"))?,
1929 ));
1930 }
1931 _ => {}
1932 }
1933 Ok(())
1934 }
1935}
1936
1937#[derive(Bundle)]
1941pub struct OminousItemSpawnerMetadataBundle {
1942 _marker: OminousItemSpawner,
1943 parent: AbstractEntityMetadataBundle,
1944 ominous_item_spawner_item: OminousItemSpawnerItem,
1945}
1946impl Default for OminousItemSpawnerMetadataBundle {
1947 fn default() -> Self {
1948 Self {
1949 _marker: OminousItemSpawner,
1950 parent: Default::default(),
1951 ominous_item_spawner_item: OminousItemSpawnerItem(Default::default()),
1952 }
1953 }
1954}
1955
1956#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1958pub struct PaintingDirection(pub Direction);
1959#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
1961pub struct PaintingVariant(pub azalea_registry::data::PaintingVariant);
1962#[derive(Component)]
1984pub struct Painting;
1985impl Painting {
1986 fn apply_metadata(
1987 entity: &mut bevy_ecs::system::EntityCommands,
1988 d: EntityDataItem,
1989 ) -> Result<(), UpdateMetadataError> {
1990 match d.index {
1991 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
1992 8 => {
1993 entity.insert(PaintingDirection(
1994 d.value
1995 .into_direction()
1996 .map_err(|v| e(v, d.index, "PaintingDirection"))?,
1997 ));
1998 }
1999 9 => {
2000 entity.insert(PaintingVariant(
2001 d.value
2002 .into_painting_variant()
2003 .map_err(|v| e(v, d.index, "PaintingVariant"))?,
2004 ));
2005 }
2006 _ => {}
2007 }
2008 Ok(())
2009 }
2010}
2011
2012#[derive(Bundle)]
2016pub struct PaintingMetadataBundle {
2017 _marker: Painting,
2018 parent: AbstractEntityMetadataBundle,
2019 painting_direction: PaintingDirection,
2020 painting_variant: PaintingVariant,
2021}
2022impl Default for PaintingMetadataBundle {
2023 fn default() -> Self {
2024 Self {
2025 _marker: Painting,
2026 parent: Default::default(),
2027 painting_direction: PaintingDirection(Default::default()),
2028 painting_variant: PaintingVariant(azalea_registry::data::PaintingVariant::default()),
2029 }
2030 }
2031}
2032
2033#[derive(Component)]
2051pub struct ShulkerBullet;
2052impl ShulkerBullet {
2053 fn apply_metadata(
2054 entity: &mut bevy_ecs::system::EntityCommands,
2055 d: EntityDataItem,
2056 ) -> Result<(), UpdateMetadataError> {
2057 match d.index {
2058 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2059 _ => {}
2060 }
2061 Ok(())
2062 }
2063}
2064
2065#[derive(Bundle)]
2069pub struct ShulkerBulletMetadataBundle {
2070 _marker: ShulkerBullet,
2071 parent: AbstractEntityMetadataBundle,
2072}
2073impl Default for ShulkerBulletMetadataBundle {
2074 fn default() -> Self {
2075 Self {
2076 _marker: ShulkerBullet,
2077 parent: Default::default(),
2078 }
2079 }
2080}
2081
2082#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2084pub struct SmallFireballItemStack(pub ItemStack);
2085#[derive(Component)]
2106pub struct SmallFireball;
2107impl SmallFireball {
2108 fn apply_metadata(
2109 entity: &mut bevy_ecs::system::EntityCommands,
2110 d: EntityDataItem,
2111 ) -> Result<(), UpdateMetadataError> {
2112 match d.index {
2113 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2114 8 => {
2115 entity.insert(SmallFireballItemStack(
2116 d.value
2117 .into_item_stack()
2118 .map_err(|v| e(v, d.index, "SmallFireballItemStack"))?,
2119 ));
2120 }
2121 _ => {}
2122 }
2123 Ok(())
2124 }
2125}
2126
2127#[derive(Bundle)]
2131pub struct SmallFireballMetadataBundle {
2132 _marker: SmallFireball,
2133 parent: AbstractEntityMetadataBundle,
2134 small_fireball_item_stack: SmallFireballItemStack,
2135}
2136impl Default for SmallFireballMetadataBundle {
2137 fn default() -> Self {
2138 Self {
2139 _marker: SmallFireball,
2140 parent: Default::default(),
2141 small_fireball_item_stack: SmallFireballItemStack(Default::default()),
2142 }
2143 }
2144}
2145
2146#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2148pub struct Fuse(pub i32);
2149#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2151pub struct TntBlockState(pub azalea_block::BlockState);
2152#[derive(Component)]
2173pub struct Tnt;
2174impl Tnt {
2175 fn apply_metadata(
2176 entity: &mut bevy_ecs::system::EntityCommands,
2177 d: EntityDataItem,
2178 ) -> Result<(), UpdateMetadataError> {
2179 match d.index {
2180 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2181 8 => {
2182 entity.insert(Fuse(d.value.into_int().map_err(|v| e(v, d.index, "Fuse"))?));
2183 }
2184 9 => {
2185 entity.insert(TntBlockState(
2186 d.value
2187 .into_block_state()
2188 .map_err(|v| e(v, d.index, "TntBlockState"))?,
2189 ));
2190 }
2191 _ => {}
2192 }
2193 Ok(())
2194 }
2195}
2196
2197#[derive(Bundle)]
2201pub struct TntMetadataBundle {
2202 _marker: Tnt,
2203 parent: AbstractEntityMetadataBundle,
2204 fuse: Fuse,
2205 tnt_block_state: TntBlockState,
2206}
2207impl Default for TntMetadataBundle {
2208 fn default() -> Self {
2209 Self {
2210 _marker: Tnt,
2211 parent: Default::default(),
2212 fuse: Fuse(80),
2213 tnt_block_state: TntBlockState(Default::default()),
2214 }
2215 }
2216}
2217
2218#[derive(Component)]
2236pub struct WindCharge;
2237impl WindCharge {
2238 fn apply_metadata(
2239 entity: &mut bevy_ecs::system::EntityCommands,
2240 d: EntityDataItem,
2241 ) -> Result<(), UpdateMetadataError> {
2242 match d.index {
2243 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2244 _ => {}
2245 }
2246 Ok(())
2247 }
2248}
2249
2250#[derive(Bundle)]
2254pub struct WindChargeMetadataBundle {
2255 _marker: WindCharge,
2256 parent: AbstractEntityMetadataBundle,
2257}
2258impl Default for WindChargeMetadataBundle {
2259 fn default() -> Self {
2260 Self {
2261 _marker: WindCharge,
2262 parent: Default::default(),
2263 }
2264 }
2265}
2266
2267#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2269pub struct Dangerous(pub bool);
2270#[derive(Component)]
2291pub struct WitherSkull;
2292impl WitherSkull {
2293 fn apply_metadata(
2294 entity: &mut bevy_ecs::system::EntityCommands,
2295 d: EntityDataItem,
2296 ) -> Result<(), UpdateMetadataError> {
2297 match d.index {
2298 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2299 8 => {
2300 entity.insert(Dangerous(
2301 d.value
2302 .into_boolean()
2303 .map_err(|v| e(v, d.index, "Dangerous"))?,
2304 ));
2305 }
2306 _ => {}
2307 }
2308 Ok(())
2309 }
2310}
2311
2312#[derive(Bundle)]
2316pub struct WitherSkullMetadataBundle {
2317 _marker: WitherSkull,
2318 parent: AbstractEntityMetadataBundle,
2319 dangerous: Dangerous,
2320}
2321impl Default for WitherSkullMetadataBundle {
2322 fn default() -> Self {
2323 Self {
2324 _marker: WitherSkull,
2325 parent: Default::default(),
2326 dangerous: Dangerous(false),
2327 }
2328 }
2329}
2330
2331#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
2332pub struct CritArrow(pub bool);
2334#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
2335pub struct NoPhysics(pub bool);
2337#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2339pub struct PierceLevel(pub u8);
2340#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2342pub struct InGround(pub bool);
2343#[derive(Component)]
2369pub struct AbstractArrow;
2370impl AbstractArrow {
2371 fn apply_metadata(
2372 entity: &mut bevy_ecs::system::EntityCommands,
2373 d: EntityDataItem,
2374 ) -> Result<(), UpdateMetadataError> {
2375 match d.index {
2376 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2377 8 => {
2378 let bitfield = d
2379 .value
2380 .into_byte()
2381 .map_err(|v| e(v, d.index, "<bitfield>"))?;
2382 entity.insert(CritArrow(bitfield & 0x1 != 0));
2383 entity.insert(NoPhysics(bitfield & 0x2 != 0));
2384 }
2385 9 => {
2386 entity.insert(PierceLevel(
2387 d.value
2388 .into_byte()
2389 .map_err(|v| e(v, d.index, "PierceLevel"))?,
2390 ));
2391 }
2392 10 => {
2393 entity.insert(InGround(
2394 d.value
2395 .into_boolean()
2396 .map_err(|v| e(v, d.index, "InGround"))?,
2397 ));
2398 }
2399 _ => {}
2400 }
2401 Ok(())
2402 }
2403}
2404
2405#[derive(Bundle)]
2409pub struct AbstractArrowMetadataBundle {
2410 _marker: AbstractArrow,
2411 parent: AbstractEntityMetadataBundle,
2412 crit_arrow: CritArrow,
2413 no_physics: NoPhysics,
2414 pierce_level: PierceLevel,
2415 in_ground: InGround,
2416}
2417impl Default for AbstractArrowMetadataBundle {
2418 fn default() -> Self {
2419 Self {
2420 _marker: AbstractArrow,
2421 parent: Default::default(),
2422 crit_arrow: CritArrow(false),
2423 no_physics: NoPhysics(false),
2424 pierce_level: PierceLevel(0),
2425 in_ground: InGround(false),
2426 }
2427 }
2428}
2429
2430#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2432pub struct EffectColor(pub i32);
2433#[derive(Component)]
2454pub struct Arrow;
2455impl Arrow {
2456 fn apply_metadata(
2457 entity: &mut bevy_ecs::system::EntityCommands,
2458 d: EntityDataItem,
2459 ) -> Result<(), UpdateMetadataError> {
2460 match d.index {
2461 0..=10 => AbstractArrow::apply_metadata(entity, d)?,
2462 11 => {
2463 entity.insert(EffectColor(
2464 d.value
2465 .into_int()
2466 .map_err(|v| e(v, d.index, "EffectColor"))?,
2467 ));
2468 }
2469 _ => {}
2470 }
2471 Ok(())
2472 }
2473}
2474
2475#[derive(Bundle)]
2479pub struct ArrowMetadataBundle {
2480 _marker: Arrow,
2481 parent: AbstractArrowMetadataBundle,
2482 effect_color: EffectColor,
2483}
2484impl Default for ArrowMetadataBundle {
2485 fn default() -> Self {
2486 Self {
2487 _marker: Arrow,
2488 parent: Default::default(),
2489 effect_color: EffectColor(-1),
2490 }
2491 }
2492}
2493
2494#[derive(Component)]
2513pub struct SpectralArrow;
2514impl SpectralArrow {
2515 fn apply_metadata(
2516 entity: &mut bevy_ecs::system::EntityCommands,
2517 d: EntityDataItem,
2518 ) -> Result<(), UpdateMetadataError> {
2519 match d.index {
2520 0..=10 => AbstractArrow::apply_metadata(entity, d)?,
2521 _ => {}
2522 }
2523 Ok(())
2524 }
2525}
2526
2527#[derive(Bundle)]
2531pub struct SpectralArrowMetadataBundle {
2532 _marker: SpectralArrow,
2533 parent: AbstractArrowMetadataBundle,
2534}
2535impl Default for SpectralArrowMetadataBundle {
2536 fn default() -> Self {
2537 Self {
2538 _marker: SpectralArrow,
2539 parent: Default::default(),
2540 }
2541 }
2542}
2543
2544#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2546pub struct Loyalty(pub u8);
2547#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2549pub struct Foil(pub bool);
2550#[derive(Component)]
2572pub struct Trident;
2573impl Trident {
2574 fn apply_metadata(
2575 entity: &mut bevy_ecs::system::EntityCommands,
2576 d: EntityDataItem,
2577 ) -> Result<(), UpdateMetadataError> {
2578 match d.index {
2579 0..=10 => AbstractArrow::apply_metadata(entity, d)?,
2580 11 => {
2581 entity.insert(Loyalty(
2582 d.value.into_byte().map_err(|v| e(v, d.index, "Loyalty"))?,
2583 ));
2584 }
2585 12 => {
2586 entity.insert(Foil(
2587 d.value.into_boolean().map_err(|v| e(v, d.index, "Foil"))?,
2588 ));
2589 }
2590 _ => {}
2591 }
2592 Ok(())
2593 }
2594}
2595
2596#[derive(Bundle)]
2600pub struct TridentMetadataBundle {
2601 _marker: Trident,
2602 parent: AbstractArrowMetadataBundle,
2603 loyalty: Loyalty,
2604 foil: Foil,
2605}
2606impl Default for TridentMetadataBundle {
2607 fn default() -> Self {
2608 Self {
2609 _marker: Trident,
2610 parent: Default::default(),
2611 loyalty: Loyalty(0),
2612 foil: Foil(false),
2613 }
2614 }
2615}
2616
2617#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2619pub struct TransformationInterpolationStartDeltaTicks(pub i32);
2620#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2622pub struct TransformationInterpolationDuration(pub i32);
2623#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2625pub struct PosRotInterpolationDuration(pub i32);
2626#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2628pub struct Translation(pub Vec3f32);
2629#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2631pub struct Scale(pub Vec3f32);
2632#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2634pub struct LeftRotation(pub Quaternion);
2635#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2637pub struct RightRotation(pub Quaternion);
2638#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2640pub struct BillboardRenderConstraints(pub u8);
2641#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2643pub struct BrightnessOverride(pub i32);
2644#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2646pub struct ViewRange(pub f32);
2647#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2649pub struct ShadowRadius(pub f32);
2650#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2652pub struct ShadowStrength(pub f32);
2653#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2655pub struct AbstractDisplayWidth(pub f32);
2656#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2658pub struct AbstractDisplayHeight(pub f32);
2659#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2661pub struct GlowColorOverride(pub i32);
2662#[derive(Component)]
2699pub struct AbstractDisplay;
2700impl AbstractDisplay {
2701 fn apply_metadata(
2702 entity: &mut bevy_ecs::system::EntityCommands,
2703 d: EntityDataItem,
2704 ) -> Result<(), UpdateMetadataError> {
2705 match d.index {
2706 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
2707 8 => {
2708 entity.insert(TransformationInterpolationStartDeltaTicks(
2709 d.value
2710 .into_int()
2711 .map_err(|v| e(v, d.index, "TransformationInterpolationStartDeltaTicks"))?,
2712 ));
2713 }
2714 9 => {
2715 entity.insert(TransformationInterpolationDuration(
2716 d.value
2717 .into_int()
2718 .map_err(|v| e(v, d.index, "TransformationInterpolationDuration"))?,
2719 ));
2720 }
2721 10 => {
2722 entity.insert(PosRotInterpolationDuration(
2723 d.value
2724 .into_int()
2725 .map_err(|v| e(v, d.index, "PosRotInterpolationDuration"))?,
2726 ));
2727 }
2728 11 => {
2729 entity.insert(Translation(
2730 d.value
2731 .into_vector3()
2732 .map_err(|v| e(v, d.index, "Translation"))?,
2733 ));
2734 }
2735 12 => {
2736 entity.insert(Scale(
2737 d.value.into_vector3().map_err(|v| e(v, d.index, "Scale"))?,
2738 ));
2739 }
2740 13 => {
2741 entity.insert(LeftRotation(
2742 d.value
2743 .into_quaternion()
2744 .map_err(|v| e(v, d.index, "LeftRotation"))?,
2745 ));
2746 }
2747 14 => {
2748 entity.insert(RightRotation(
2749 d.value
2750 .into_quaternion()
2751 .map_err(|v| e(v, d.index, "RightRotation"))?,
2752 ));
2753 }
2754 15 => {
2755 entity.insert(BillboardRenderConstraints(
2756 d.value
2757 .into_byte()
2758 .map_err(|v| e(v, d.index, "BillboardRenderConstraints"))?,
2759 ));
2760 }
2761 16 => {
2762 entity.insert(BrightnessOverride(
2763 d.value
2764 .into_int()
2765 .map_err(|v| e(v, d.index, "BrightnessOverride"))?,
2766 ));
2767 }
2768 17 => {
2769 entity.insert(ViewRange(
2770 d.value
2771 .into_float()
2772 .map_err(|v| e(v, d.index, "ViewRange"))?,
2773 ));
2774 }
2775 18 => {
2776 entity.insert(ShadowRadius(
2777 d.value
2778 .into_float()
2779 .map_err(|v| e(v, d.index, "ShadowRadius"))?,
2780 ));
2781 }
2782 19 => {
2783 entity.insert(ShadowStrength(
2784 d.value
2785 .into_float()
2786 .map_err(|v| e(v, d.index, "ShadowStrength"))?,
2787 ));
2788 }
2789 20 => {
2790 entity.insert(AbstractDisplayWidth(
2791 d.value
2792 .into_float()
2793 .map_err(|v| e(v, d.index, "AbstractDisplayWidth"))?,
2794 ));
2795 }
2796 21 => {
2797 entity.insert(AbstractDisplayHeight(
2798 d.value
2799 .into_float()
2800 .map_err(|v| e(v, d.index, "AbstractDisplayHeight"))?,
2801 ));
2802 }
2803 22 => {
2804 entity.insert(GlowColorOverride(
2805 d.value
2806 .into_int()
2807 .map_err(|v| e(v, d.index, "GlowColorOverride"))?,
2808 ));
2809 }
2810 _ => {}
2811 }
2812 Ok(())
2813 }
2814}
2815
2816#[derive(Bundle)]
2820pub struct AbstractDisplayMetadataBundle {
2821 _marker: AbstractDisplay,
2822 parent: AbstractEntityMetadataBundle,
2823 transformation_interpolation_start_delta_ticks: TransformationInterpolationStartDeltaTicks,
2824 transformation_interpolation_duration: TransformationInterpolationDuration,
2825 pos_rot_interpolation_duration: PosRotInterpolationDuration,
2826 translation: Translation,
2827 scale: Scale,
2828 left_rotation: LeftRotation,
2829 right_rotation: RightRotation,
2830 billboard_render_constraints: BillboardRenderConstraints,
2831 brightness_override: BrightnessOverride,
2832 view_range: ViewRange,
2833 shadow_radius: ShadowRadius,
2834 shadow_strength: ShadowStrength,
2835 abstract_display_width: AbstractDisplayWidth,
2836 abstract_display_height: AbstractDisplayHeight,
2837 glow_color_override: GlowColorOverride,
2838}
2839impl Default for AbstractDisplayMetadataBundle {
2840 fn default() -> Self {
2841 Self {
2842 _marker: AbstractDisplay,
2843 parent: Default::default(),
2844 transformation_interpolation_start_delta_ticks:
2845 TransformationInterpolationStartDeltaTicks(0),
2846 transformation_interpolation_duration: TransformationInterpolationDuration(0),
2847 pos_rot_interpolation_duration: PosRotInterpolationDuration(0),
2848 translation: Translation(Vec3f32 {
2849 x: 0.0,
2850 y: 0.0,
2851 z: 0.0,
2852 }),
2853 scale: Scale(Vec3f32 {
2854 x: 1.0,
2855 y: 1.0,
2856 z: 1.0,
2857 }),
2858 left_rotation: LeftRotation(Quaternion {
2859 x: 0.0,
2860 y: 0.0,
2861 z: 0.0,
2862 w: 1.0,
2863 }),
2864 right_rotation: RightRotation(Quaternion {
2865 x: 0.0,
2866 y: 0.0,
2867 z: 0.0,
2868 w: 1.0,
2869 }),
2870 billboard_render_constraints: BillboardRenderConstraints(Default::default()),
2871 brightness_override: BrightnessOverride(-1),
2872 view_range: ViewRange(1.0),
2873 shadow_radius: ShadowRadius(0.0),
2874 shadow_strength: ShadowStrength(1.0),
2875 abstract_display_width: AbstractDisplayWidth(0.0),
2876 abstract_display_height: AbstractDisplayHeight(0.0),
2877 glow_color_override: GlowColorOverride(-1),
2878 }
2879 }
2880}
2881
2882#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2884pub struct BlockDisplayBlockState(pub azalea_block::BlockState);
2885#[derive(Component)]
2907pub struct BlockDisplay;
2908impl BlockDisplay {
2909 fn apply_metadata(
2910 entity: &mut bevy_ecs::system::EntityCommands,
2911 d: EntityDataItem,
2912 ) -> Result<(), UpdateMetadataError> {
2913 match d.index {
2914 0..=22 => AbstractDisplay::apply_metadata(entity, d)?,
2915 23 => {
2916 entity.insert(BlockDisplayBlockState(
2917 d.value
2918 .into_block_state()
2919 .map_err(|v| e(v, d.index, "BlockDisplayBlockState"))?,
2920 ));
2921 }
2922 _ => {}
2923 }
2924 Ok(())
2925 }
2926}
2927
2928#[derive(Bundle)]
2932pub struct BlockDisplayMetadataBundle {
2933 _marker: BlockDisplay,
2934 parent: AbstractDisplayMetadataBundle,
2935 block_display_block_state: BlockDisplayBlockState,
2936}
2937impl Default for BlockDisplayMetadataBundle {
2938 fn default() -> Self {
2939 Self {
2940 _marker: BlockDisplay,
2941 parent: Default::default(),
2942 block_display_block_state: BlockDisplayBlockState(Default::default()),
2943 }
2944 }
2945}
2946
2947#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2949pub struct ItemDisplayItemStack(pub ItemStack);
2950#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
2952pub struct ItemDisplayItemDisplay(pub u8);
2953#[derive(Component)]
2976pub struct ItemDisplay;
2977impl ItemDisplay {
2978 fn apply_metadata(
2979 entity: &mut bevy_ecs::system::EntityCommands,
2980 d: EntityDataItem,
2981 ) -> Result<(), UpdateMetadataError> {
2982 match d.index {
2983 0..=22 => AbstractDisplay::apply_metadata(entity, d)?,
2984 23 => {
2985 entity.insert(ItemDisplayItemStack(
2986 d.value
2987 .into_item_stack()
2988 .map_err(|v| e(v, d.index, "ItemDisplayItemStack"))?,
2989 ));
2990 }
2991 24 => {
2992 entity.insert(ItemDisplayItemDisplay(
2993 d.value
2994 .into_byte()
2995 .map_err(|v| e(v, d.index, "ItemDisplayItemDisplay"))?,
2996 ));
2997 }
2998 _ => {}
2999 }
3000 Ok(())
3001 }
3002}
3003
3004#[derive(Bundle)]
3008pub struct ItemDisplayMetadataBundle {
3009 _marker: ItemDisplay,
3010 parent: AbstractDisplayMetadataBundle,
3011 item_display_item_stack: ItemDisplayItemStack,
3012 item_display_item_display: ItemDisplayItemDisplay,
3013}
3014impl Default for ItemDisplayMetadataBundle {
3015 fn default() -> Self {
3016 Self {
3017 _marker: ItemDisplay,
3018 parent: Default::default(),
3019 item_display_item_stack: ItemDisplayItemStack(Default::default()),
3020 item_display_item_display: ItemDisplayItemDisplay(Default::default()),
3021 }
3022 }
3023}
3024
3025#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3027pub struct Text(pub Box<FormattedText>);
3028#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3030pub struct LineWidth(pub i32);
3031#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3033pub struct BackgroundColor(pub i32);
3034#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3036pub struct TextOpacity(pub u8);
3037#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3039pub struct StyleFlags(pub u8);
3040#[derive(Component)]
3066pub struct TextDisplay;
3067impl TextDisplay {
3068 fn apply_metadata(
3069 entity: &mut bevy_ecs::system::EntityCommands,
3070 d: EntityDataItem,
3071 ) -> Result<(), UpdateMetadataError> {
3072 match d.index {
3073 0..=22 => AbstractDisplay::apply_metadata(entity, d)?,
3074 23 => {
3075 entity.insert(Text(
3076 d.value
3077 .into_formatted_text()
3078 .map_err(|v| e(v, d.index, "Text"))?,
3079 ));
3080 }
3081 24 => {
3082 entity.insert(LineWidth(
3083 d.value.into_int().map_err(|v| e(v, d.index, "LineWidth"))?,
3084 ));
3085 }
3086 25 => {
3087 entity.insert(BackgroundColor(
3088 d.value
3089 .into_int()
3090 .map_err(|v| e(v, d.index, "BackgroundColor"))?,
3091 ));
3092 }
3093 26 => {
3094 entity.insert(TextOpacity(
3095 d.value
3096 .into_byte()
3097 .map_err(|v| e(v, d.index, "TextOpacity"))?,
3098 ));
3099 }
3100 27 => {
3101 entity.insert(StyleFlags(
3102 d.value
3103 .into_byte()
3104 .map_err(|v| e(v, d.index, "StyleFlags"))?,
3105 ));
3106 }
3107 _ => {}
3108 }
3109 Ok(())
3110 }
3111}
3112
3113#[derive(Bundle)]
3117pub struct TextDisplayMetadataBundle {
3118 _marker: TextDisplay,
3119 parent: AbstractDisplayMetadataBundle,
3120 text: Text,
3121 line_width: LineWidth,
3122 background_color: BackgroundColor,
3123 text_opacity: TextOpacity,
3124 style_flags: StyleFlags,
3125}
3126impl Default for TextDisplayMetadataBundle {
3127 fn default() -> Self {
3128 Self {
3129 _marker: TextDisplay,
3130 parent: Default::default(),
3131 text: Text(Default::default()),
3132 line_width: LineWidth(200),
3133 background_color: BackgroundColor(1073741824),
3134 text_opacity: TextOpacity(127),
3135 style_flags: StyleFlags(0),
3136 }
3137 }
3138}
3139
3140#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3141pub struct AutoSpinAttack(pub bool);
3143#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3144pub struct AbstractLivingUsingItem(pub bool);
3146#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3148pub struct Health(pub f32);
3149#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3151pub struct EffectParticles(pub Box<[EntityParticle]>);
3152#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3154pub struct EffectAmbience(pub bool);
3155#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3157pub struct ArrowCount(pub i32);
3158#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3160pub struct StingerCount(pub i32);
3161#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3163pub struct SleepingPos(pub Option<BlockPos>);
3164#[derive(Component)]
3300pub struct AbstractLiving;
3301impl AbstractLiving {
3302 fn apply_metadata(
3303 entity: &mut bevy_ecs::system::EntityCommands,
3304 d: EntityDataItem,
3305 ) -> Result<(), UpdateMetadataError> {
3306 match d.index {
3307 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
3308 8 => {
3309 let bitfield = d
3310 .value
3311 .into_byte()
3312 .map_err(|v| e(v, d.index, "<bitfield>"))?;
3313 entity.insert(AutoSpinAttack(bitfield & 0x4 != 0));
3314 entity.insert(AbstractLivingUsingItem(bitfield & 0x1 != 0));
3315 }
3316 9 => {
3317 entity.insert(Health(
3318 d.value.into_float().map_err(|v| e(v, d.index, "Health"))?,
3319 ));
3320 }
3321 10 => {
3322 entity.insert(EffectParticles(
3323 d.value
3324 .into_particles()
3325 .map_err(|v| e(v, d.index, "EffectParticles"))?,
3326 ));
3327 }
3328 11 => {
3329 entity.insert(EffectAmbience(
3330 d.value
3331 .into_boolean()
3332 .map_err(|v| e(v, d.index, "EffectAmbience"))?,
3333 ));
3334 }
3335 12 => {
3336 entity.insert(ArrowCount(
3337 d.value
3338 .into_int()
3339 .map_err(|v| e(v, d.index, "ArrowCount"))?,
3340 ));
3341 }
3342 13 => {
3343 entity.insert(StingerCount(
3344 d.value
3345 .into_int()
3346 .map_err(|v| e(v, d.index, "StingerCount"))?,
3347 ));
3348 }
3349 14 => {
3350 entity.insert(SleepingPos(
3351 d.value
3352 .into_optional_block_pos()
3353 .map_err(|v| e(v, d.index, "SleepingPos"))?,
3354 ));
3355 }
3356 _ => {}
3357 }
3358 Ok(())
3359 }
3360}
3361
3362#[derive(Bundle)]
3366pub struct AbstractLivingMetadataBundle {
3367 _marker: AbstractLiving,
3368 parent: AbstractEntityMetadataBundle,
3369 auto_spin_attack: AutoSpinAttack,
3370 abstract_living_using_item: AbstractLivingUsingItem,
3371 health: Health,
3372 effect_particles: EffectParticles,
3373 effect_ambience: EffectAmbience,
3374 arrow_count: ArrowCount,
3375 stinger_count: StingerCount,
3376 sleeping_pos: SleepingPos,
3377}
3378impl Default for AbstractLivingMetadataBundle {
3379 fn default() -> Self {
3380 Self {
3381 _marker: AbstractLiving,
3382 parent: Default::default(),
3383 auto_spin_attack: AutoSpinAttack(false),
3384 abstract_living_using_item: AbstractLivingUsingItem(false),
3385 health: Health(1.0),
3386 effect_particles: EffectParticles(Default::default()),
3387 effect_ambience: EffectAmbience(false),
3388 arrow_count: ArrowCount(0),
3389 stinger_count: StingerCount(0),
3390 sleeping_pos: SleepingPos(None),
3391 }
3392 }
3393}
3394
3395#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3396pub struct Small(pub bool);
3398#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3399pub struct ShowArms(pub bool);
3401#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3402pub struct ShowBasePlate(pub bool);
3404#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3405pub struct ArmorStandMarker(pub bool);
3407#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3409pub struct HeadPose(pub Rotations);
3410#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3412pub struct BodyPose(pub Rotations);
3413#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3415pub struct LeftArmPose(pub Rotations);
3416#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3418pub struct RightArmPose(pub Rotations);
3419#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3421pub struct LeftLegPose(pub Rotations);
3422#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3424pub struct RightLegPose(pub Rotations);
3425#[derive(Component)]
3456pub struct ArmorStand;
3457impl ArmorStand {
3458 fn apply_metadata(
3459 entity: &mut bevy_ecs::system::EntityCommands,
3460 d: EntityDataItem,
3461 ) -> Result<(), UpdateMetadataError> {
3462 match d.index {
3463 0..=14 => AbstractLiving::apply_metadata(entity, d)?,
3464 15 => {
3465 let bitfield = d
3466 .value
3467 .into_byte()
3468 .map_err(|v| e(v, d.index, "<bitfield>"))?;
3469 entity.insert(Small(bitfield & 0x1 != 0));
3470 entity.insert(ShowArms(bitfield & 0x4 != 0));
3471 entity.insert(ShowBasePlate(bitfield & 0x8 != 0));
3472 entity.insert(ArmorStandMarker(bitfield & 0x10 != 0));
3473 }
3474 16 => {
3475 entity.insert(HeadPose(
3476 d.value
3477 .into_rotations()
3478 .map_err(|v| e(v, d.index, "HeadPose"))?,
3479 ));
3480 }
3481 17 => {
3482 entity.insert(BodyPose(
3483 d.value
3484 .into_rotations()
3485 .map_err(|v| e(v, d.index, "BodyPose"))?,
3486 ));
3487 }
3488 18 => {
3489 entity.insert(LeftArmPose(
3490 d.value
3491 .into_rotations()
3492 .map_err(|v| e(v, d.index, "LeftArmPose"))?,
3493 ));
3494 }
3495 19 => {
3496 entity.insert(RightArmPose(
3497 d.value
3498 .into_rotations()
3499 .map_err(|v| e(v, d.index, "RightArmPose"))?,
3500 ));
3501 }
3502 20 => {
3503 entity.insert(LeftLegPose(
3504 d.value
3505 .into_rotations()
3506 .map_err(|v| e(v, d.index, "LeftLegPose"))?,
3507 ));
3508 }
3509 21 => {
3510 entity.insert(RightLegPose(
3511 d.value
3512 .into_rotations()
3513 .map_err(|v| e(v, d.index, "RightLegPose"))?,
3514 ));
3515 }
3516 _ => {}
3517 }
3518 Ok(())
3519 }
3520}
3521
3522#[derive(Bundle)]
3526pub struct ArmorStandMetadataBundle {
3527 _marker: ArmorStand,
3528 parent: AbstractLivingMetadataBundle,
3529 small: Small,
3530 show_arms: ShowArms,
3531 show_base_plate: ShowBasePlate,
3532 armor_stand_marker: ArmorStandMarker,
3533 head_pose: HeadPose,
3534 body_pose: BodyPose,
3535 left_arm_pose: LeftArmPose,
3536 right_arm_pose: RightArmPose,
3537 left_leg_pose: LeftLegPose,
3538 right_leg_pose: RightLegPose,
3539}
3540impl Default for ArmorStandMetadataBundle {
3541 fn default() -> Self {
3542 Self {
3543 _marker: ArmorStand,
3544 parent: Default::default(),
3545 small: Small(false),
3546 show_arms: ShowArms(false),
3547 show_base_plate: ShowBasePlate(false),
3548 armor_stand_marker: ArmorStandMarker(false),
3549 head_pose: HeadPose(Default::default()),
3550 body_pose: BodyPose(Default::default()),
3551 left_arm_pose: LeftArmPose(Default::default()),
3552 right_arm_pose: RightArmPose(Default::default()),
3553 left_leg_pose: LeftLegPose(Default::default()),
3554 right_leg_pose: RightLegPose(Default::default()),
3555 }
3556 }
3557}
3558
3559#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3561pub struct PlayerMainHand(pub HumanoidArm);
3562#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3564pub struct PlayerModeCustomisation(pub u8);
3565#[derive(Component)]
3589pub struct AbstractAvatar;
3590impl AbstractAvatar {
3591 fn apply_metadata(
3592 entity: &mut bevy_ecs::system::EntityCommands,
3593 d: EntityDataItem,
3594 ) -> Result<(), UpdateMetadataError> {
3595 match d.index {
3596 0..=14 => AbstractLiving::apply_metadata(entity, d)?,
3597 15 => {
3598 entity.insert(PlayerMainHand(
3599 d.value
3600 .into_humanoid_arm()
3601 .map_err(|v| e(v, d.index, "PlayerMainHand"))?,
3602 ));
3603 }
3604 16 => {
3605 entity.insert(PlayerModeCustomisation(
3606 d.value
3607 .into_byte()
3608 .map_err(|v| e(v, d.index, "PlayerModeCustomisation"))?,
3609 ));
3610 }
3611 _ => {}
3612 }
3613 Ok(())
3614 }
3615}
3616
3617#[derive(Bundle)]
3621pub struct AbstractAvatarMetadataBundle {
3622 _marker: AbstractAvatar,
3623 parent: AbstractLivingMetadataBundle,
3624 player_main_hand: PlayerMainHand,
3625 player_mode_customisation: PlayerModeCustomisation,
3626}
3627impl Default for AbstractAvatarMetadataBundle {
3628 fn default() -> Self {
3629 Self {
3630 _marker: AbstractAvatar,
3631 parent: Default::default(),
3632 player_main_hand: PlayerMainHand(Default::default()),
3633 player_mode_customisation: PlayerModeCustomisation(0),
3634 }
3635 }
3636}
3637
3638#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3640pub struct Profile(pub components::Profile);
3641#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3643pub struct Immovable(pub bool);
3644#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3646pub struct Description(pub Option<Box<FormattedText>>);
3647#[derive(Component)]
3672pub struct Mannequin;
3673impl Mannequin {
3674 fn apply_metadata(
3675 entity: &mut bevy_ecs::system::EntityCommands,
3676 d: EntityDataItem,
3677 ) -> Result<(), UpdateMetadataError> {
3678 match d.index {
3679 0..=16 => AbstractAvatar::apply_metadata(entity, d)?,
3680 17 => {
3681 entity.insert(Profile(
3682 d.value
3683 .into_resolvable_profile()
3684 .map_err(|v| e(v, d.index, "Profile"))?,
3685 ));
3686 }
3687 18 => {
3688 entity.insert(Immovable(
3689 d.value
3690 .into_boolean()
3691 .map_err(|v| e(v, d.index, "Immovable"))?,
3692 ));
3693 }
3694 19 => {
3695 entity.insert(Description(
3696 d.value
3697 .into_optional_formatted_text()
3698 .map_err(|v| e(v, d.index, "Description"))?,
3699 ));
3700 }
3701 _ => {}
3702 }
3703 Ok(())
3704 }
3705}
3706
3707#[derive(Bundle)]
3711pub struct MannequinMetadataBundle {
3712 _marker: Mannequin,
3713 parent: AbstractAvatarMetadataBundle,
3714 profile: Profile,
3715 immovable: Immovable,
3716 description: Description,
3717}
3718impl Default for MannequinMetadataBundle {
3719 fn default() -> Self {
3720 Self {
3721 _marker: Mannequin,
3722 parent: Default::default(),
3723 profile: Profile(Default::default()),
3724 immovable: Immovable(false),
3725 description: Description(Default::default()),
3726 }
3727 }
3728}
3729
3730#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3732pub struct PlayerAbsorption(pub f32);
3733#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3735pub struct Score(pub i32);
3736#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3738pub struct ShoulderParrotLeft(pub OptionalUnsignedInt);
3739#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
3741pub struct ShoulderParrotRight(pub OptionalUnsignedInt);
3742#[derive(Component)]
3767pub struct Player;
3768impl Player {
3769 fn apply_metadata(
3770 entity: &mut bevy_ecs::system::EntityCommands,
3771 d: EntityDataItem,
3772 ) -> Result<(), UpdateMetadataError> {
3773 match d.index {
3774 0..=16 => AbstractAvatar::apply_metadata(entity, d)?,
3775 17 => {
3776 entity.insert(PlayerAbsorption(
3777 d.value
3778 .into_float()
3779 .map_err(|v| e(v, d.index, "PlayerAbsorption"))?,
3780 ));
3781 }
3782 18 => {
3783 entity.insert(Score(
3784 d.value.into_int().map_err(|v| e(v, d.index, "Score"))?,
3785 ));
3786 }
3787 19 => {
3788 entity.insert(ShoulderParrotLeft(
3789 d.value
3790 .into_optional_unsigned_int()
3791 .map_err(|v| e(v, d.index, "ShoulderParrotLeft"))?,
3792 ));
3793 }
3794 20 => {
3795 entity.insert(ShoulderParrotRight(
3796 d.value
3797 .into_optional_unsigned_int()
3798 .map_err(|v| e(v, d.index, "ShoulderParrotRight"))?,
3799 ));
3800 }
3801 _ => {}
3802 }
3803 Ok(())
3804 }
3805}
3806
3807#[derive(Bundle)]
3811pub struct PlayerMetadataBundle {
3812 _marker: Player,
3813 parent: AbstractAvatarMetadataBundle,
3814 player_absorption: PlayerAbsorption,
3815 score: Score,
3816 shoulder_parrot_left: ShoulderParrotLeft,
3817 shoulder_parrot_right: ShoulderParrotRight,
3818}
3819impl Default for PlayerMetadataBundle {
3820 fn default() -> Self {
3821 Self {
3822 _marker: Player,
3823 parent: Default::default(),
3824 player_absorption: PlayerAbsorption(0.0),
3825 score: Score(0),
3826 shoulder_parrot_left: ShoulderParrotLeft(OptionalUnsignedInt(None)),
3827 shoulder_parrot_right: ShoulderParrotRight(OptionalUnsignedInt(None)),
3828 }
3829 }
3830}
3831
3832#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3833pub struct NoAi(pub bool);
3835#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3836pub struct LeftHanded(pub bool);
3838#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
3839pub struct Aggressive(pub bool);
3841#[derive(Component)]
3968pub struct AbstractInsentient;
3969impl AbstractInsentient {
3970 fn apply_metadata(
3971 entity: &mut bevy_ecs::system::EntityCommands,
3972 d: EntityDataItem,
3973 ) -> Result<(), UpdateMetadataError> {
3974 match d.index {
3975 0..=14 => AbstractLiving::apply_metadata(entity, d)?,
3976 15 => {
3977 let bitfield = d
3978 .value
3979 .into_byte()
3980 .map_err(|v| e(v, d.index, "<bitfield>"))?;
3981 entity.insert(NoAi(bitfield & 0x1 != 0));
3982 entity.insert(LeftHanded(bitfield & 0x2 != 0));
3983 entity.insert(Aggressive(bitfield & 0x4 != 0));
3984 }
3985 _ => {}
3986 }
3987 Ok(())
3988 }
3989}
3990
3991#[derive(Bundle)]
3995pub struct AbstractInsentientMetadataBundle {
3996 _marker: AbstractInsentient,
3997 parent: AbstractLivingMetadataBundle,
3998 no_ai: NoAi,
3999 left_handed: LeftHanded,
4000 aggressive: Aggressive,
4001}
4002impl Default for AbstractInsentientMetadataBundle {
4003 fn default() -> Self {
4004 Self {
4005 _marker: AbstractInsentient,
4006 parent: Default::default(),
4007 no_ai: NoAi(false),
4008 left_handed: LeftHanded(false),
4009 aggressive: Aggressive(false),
4010 }
4011 }
4012}
4013
4014#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
4015pub struct Resting(pub bool);
4017#[derive(Component)]
4039pub struct Bat;
4040impl Bat {
4041 fn apply_metadata(
4042 entity: &mut bevy_ecs::system::EntityCommands,
4043 d: EntityDataItem,
4044 ) -> Result<(), UpdateMetadataError> {
4045 match d.index {
4046 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
4047 16 => {
4048 let bitfield = d
4049 .value
4050 .into_byte()
4051 .map_err(|v| e(v, d.index, "<bitfield>"))?;
4052 entity.insert(Resting(bitfield & 0x1 != 0));
4053 }
4054 _ => {}
4055 }
4056 Ok(())
4057 }
4058}
4059
4060#[derive(Bundle)]
4064pub struct BatMetadataBundle {
4065 _marker: Bat,
4066 parent: AbstractInsentientMetadataBundle,
4067 resting: Resting,
4068}
4069impl Default for BatMetadataBundle {
4070 fn default() -> Self {
4071 Self {
4072 _marker: Bat,
4073 parent: Default::default(),
4074 resting: Resting(false),
4075 }
4076 }
4077}
4078
4079#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4081pub struct Phase(pub i32);
4082#[derive(Component)]
4105pub struct EnderDragon;
4106impl EnderDragon {
4107 fn apply_metadata(
4108 entity: &mut bevy_ecs::system::EntityCommands,
4109 d: EntityDataItem,
4110 ) -> Result<(), UpdateMetadataError> {
4111 match d.index {
4112 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
4113 16 => {
4114 entity.insert(Phase(
4115 d.value.into_int().map_err(|v| e(v, d.index, "Phase"))?,
4116 ));
4117 }
4118 _ => {}
4119 }
4120 Ok(())
4121 }
4122}
4123
4124#[derive(Bundle)]
4128pub struct EnderDragonMetadataBundle {
4129 _marker: EnderDragon,
4130 parent: AbstractInsentientMetadataBundle,
4131 phase: Phase,
4132}
4133impl Default for EnderDragonMetadataBundle {
4134 fn default() -> Self {
4135 Self {
4136 _marker: EnderDragon,
4137 parent: Default::default(),
4138 phase: Phase(Default::default()),
4139 }
4140 }
4141}
4142
4143#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4145pub struct IsCharging(pub bool);
4146#[derive(Component)]
4168pub struct Ghast;
4169impl Ghast {
4170 fn apply_metadata(
4171 entity: &mut bevy_ecs::system::EntityCommands,
4172 d: EntityDataItem,
4173 ) -> Result<(), UpdateMetadataError> {
4174 match d.index {
4175 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
4176 16 => {
4177 entity.insert(IsCharging(
4178 d.value
4179 .into_boolean()
4180 .map_err(|v| e(v, d.index, "IsCharging"))?,
4181 ));
4182 }
4183 _ => {}
4184 }
4185 Ok(())
4186 }
4187}
4188
4189#[derive(Bundle)]
4193pub struct GhastMetadataBundle {
4194 _marker: Ghast,
4195 parent: AbstractInsentientMetadataBundle,
4196 is_charging: IsCharging,
4197}
4198impl Default for GhastMetadataBundle {
4199 fn default() -> Self {
4200 Self {
4201 _marker: Ghast,
4202 parent: Default::default(),
4203 is_charging: IsCharging(false),
4204 }
4205 }
4206}
4207
4208#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4210pub struct PhantomSize(pub i32);
4211#[derive(Component)]
4233pub struct Phantom;
4234impl Phantom {
4235 fn apply_metadata(
4236 entity: &mut bevy_ecs::system::EntityCommands,
4237 d: EntityDataItem,
4238 ) -> Result<(), UpdateMetadataError> {
4239 match d.index {
4240 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
4241 16 => {
4242 entity.insert(PhantomSize(
4243 d.value
4244 .into_int()
4245 .map_err(|v| e(v, d.index, "PhantomSize"))?,
4246 ));
4247 }
4248 _ => {}
4249 }
4250 Ok(())
4251 }
4252}
4253
4254#[derive(Bundle)]
4258pub struct PhantomMetadataBundle {
4259 _marker: Phantom,
4260 parent: AbstractInsentientMetadataBundle,
4261 phantom_size: PhantomSize,
4262}
4263impl Default for PhantomMetadataBundle {
4264 fn default() -> Self {
4265 Self {
4266 _marker: Phantom,
4267 parent: Default::default(),
4268 phantom_size: PhantomSize(0),
4269 }
4270 }
4271}
4272
4273#[derive(Component)]
4391pub struct AbstractCreature;
4392impl AbstractCreature {
4393 fn apply_metadata(
4394 entity: &mut bevy_ecs::system::EntityCommands,
4395 d: EntityDataItem,
4396 ) -> Result<(), UpdateMetadataError> {
4397 match d.index {
4398 0..=15 => AbstractInsentient::apply_metadata(entity, d)?,
4399 _ => {}
4400 }
4401 Ok(())
4402 }
4403}
4404
4405#[derive(Bundle)]
4409pub struct AbstractCreatureMetadataBundle {
4410 _marker: AbstractCreature,
4411 parent: AbstractInsentientMetadataBundle,
4412}
4413impl Default for AbstractCreatureMetadataBundle {
4414 fn default() -> Self {
4415 Self {
4416 _marker: AbstractCreature,
4417 parent: Default::default(),
4418 }
4419 }
4420}
4421
4422#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4424pub struct Dancing(pub bool);
4425#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4427pub struct CanDuplicate(pub bool);
4428#[derive(Component)]
4452pub struct Allay;
4453impl Allay {
4454 fn apply_metadata(
4455 entity: &mut bevy_ecs::system::EntityCommands,
4456 d: EntityDataItem,
4457 ) -> Result<(), UpdateMetadataError> {
4458 match d.index {
4459 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4460 16 => {
4461 entity.insert(Dancing(
4462 d.value
4463 .into_boolean()
4464 .map_err(|v| e(v, d.index, "Dancing"))?,
4465 ));
4466 }
4467 17 => {
4468 entity.insert(CanDuplicate(
4469 d.value
4470 .into_boolean()
4471 .map_err(|v| e(v, d.index, "CanDuplicate"))?,
4472 ));
4473 }
4474 _ => {}
4475 }
4476 Ok(())
4477 }
4478}
4479
4480#[derive(Bundle)]
4484pub struct AllayMetadataBundle {
4485 _marker: Allay,
4486 parent: AbstractCreatureMetadataBundle,
4487 dancing: Dancing,
4488 can_duplicate: CanDuplicate,
4489}
4490impl Default for AllayMetadataBundle {
4491 fn default() -> Self {
4492 Self {
4493 _marker: Allay,
4494 parent: Default::default(),
4495 dancing: Dancing(false),
4496 can_duplicate: CanDuplicate(true),
4497 }
4498 }
4499}
4500
4501#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4503pub struct WeatherState(pub WeatheringCopperStateKind);
4504#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4506pub struct CopperGolemState(pub CopperGolemStateKind);
4507#[derive(Component)]
4532pub struct CopperGolem;
4533impl CopperGolem {
4534 fn apply_metadata(
4535 entity: &mut bevy_ecs::system::EntityCommands,
4536 d: EntityDataItem,
4537 ) -> Result<(), UpdateMetadataError> {
4538 match d.index {
4539 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4540 16 => {
4541 entity.insert(WeatherState(
4542 d.value
4543 .into_weathering_copper_state()
4544 .map_err(|v| e(v, d.index, "WeatherState"))?,
4545 ));
4546 }
4547 17 => {
4548 entity.insert(CopperGolemState(
4549 d.value
4550 .into_copper_golem_state()
4551 .map_err(|v| e(v, d.index, "CopperGolemState"))?,
4552 ));
4553 }
4554 _ => {}
4555 }
4556 Ok(())
4557 }
4558}
4559
4560#[derive(Bundle)]
4564pub struct CopperGolemMetadataBundle {
4565 _marker: CopperGolem,
4566 parent: AbstractCreatureMetadataBundle,
4567 weather_state: WeatherState,
4568 copper_golem_state: CopperGolemState,
4569}
4570impl Default for CopperGolemMetadataBundle {
4571 fn default() -> Self {
4572 Self {
4573 _marker: CopperGolem,
4574 parent: Default::default(),
4575 weather_state: WeatherState(Default::default()),
4576 copper_golem_state: CopperGolemState(Default::default()),
4577 }
4578 }
4579}
4580
4581#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
4582pub struct PlayerCreated(pub bool);
4584#[derive(Component)]
4608pub struct IronGolem;
4609impl IronGolem {
4610 fn apply_metadata(
4611 entity: &mut bevy_ecs::system::EntityCommands,
4612 d: EntityDataItem,
4613 ) -> Result<(), UpdateMetadataError> {
4614 match d.index {
4615 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4616 16 => {
4617 let bitfield = d
4618 .value
4619 .into_byte()
4620 .map_err(|v| e(v, d.index, "<bitfield>"))?;
4621 entity.insert(PlayerCreated(bitfield & 0x1 != 0));
4622 }
4623 _ => {}
4624 }
4625 Ok(())
4626 }
4627}
4628
4629#[derive(Bundle)]
4633pub struct IronGolemMetadataBundle {
4634 _marker: IronGolem,
4635 parent: AbstractCreatureMetadataBundle,
4636 player_created: PlayerCreated,
4637}
4638impl Default for IronGolemMetadataBundle {
4639 fn default() -> Self {
4640 Self {
4641 _marker: IronGolem,
4642 parent: Default::default(),
4643 player_created: PlayerCreated(false),
4644 }
4645 }
4646}
4647
4648#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4650pub struct PufferfishFromBucket(pub bool);
4651#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4653pub struct PuffState(pub i32);
4654#[derive(Component)]
4679pub struct Pufferfish;
4680impl Pufferfish {
4681 fn apply_metadata(
4682 entity: &mut bevy_ecs::system::EntityCommands,
4683 d: EntityDataItem,
4684 ) -> Result<(), UpdateMetadataError> {
4685 match d.index {
4686 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4687 16 => {
4688 entity.insert(PufferfishFromBucket(
4689 d.value
4690 .into_boolean()
4691 .map_err(|v| e(v, d.index, "PufferfishFromBucket"))?,
4692 ));
4693 }
4694 17 => {
4695 entity.insert(PuffState(
4696 d.value.into_int().map_err(|v| e(v, d.index, "PuffState"))?,
4697 ));
4698 }
4699 _ => {}
4700 }
4701 Ok(())
4702 }
4703}
4704
4705#[derive(Bundle)]
4709pub struct PufferfishMetadataBundle {
4710 _marker: Pufferfish,
4711 parent: AbstractCreatureMetadataBundle,
4712 pufferfish_from_bucket: PufferfishFromBucket,
4713 puff_state: PuffState,
4714}
4715impl Default for PufferfishMetadataBundle {
4716 fn default() -> Self {
4717 Self {
4718 _marker: Pufferfish,
4719 parent: Default::default(),
4720 pufferfish_from_bucket: PufferfishFromBucket(false),
4721 puff_state: PuffState(0),
4722 }
4723 }
4724}
4725
4726#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4728pub struct AttachFace(pub Direction);
4729#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4731pub struct Peek(pub u8);
4732#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4734pub struct ShulkerColor(pub u8);
4735#[derive(Component)]
4760pub struct Shulker;
4761impl Shulker {
4762 fn apply_metadata(
4763 entity: &mut bevy_ecs::system::EntityCommands,
4764 d: EntityDataItem,
4765 ) -> Result<(), UpdateMetadataError> {
4766 match d.index {
4767 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4768 16 => {
4769 entity.insert(AttachFace(
4770 d.value
4771 .into_direction()
4772 .map_err(|v| e(v, d.index, "AttachFace"))?,
4773 ));
4774 }
4775 17 => {
4776 entity.insert(Peek(
4777 d.value.into_byte().map_err(|v| e(v, d.index, "Peek"))?,
4778 ));
4779 }
4780 18 => {
4781 entity.insert(ShulkerColor(
4782 d.value
4783 .into_byte()
4784 .map_err(|v| e(v, d.index, "ShulkerColor"))?,
4785 ));
4786 }
4787 _ => {}
4788 }
4789 Ok(())
4790 }
4791}
4792
4793#[derive(Bundle)]
4797pub struct ShulkerMetadataBundle {
4798 _marker: Shulker,
4799 parent: AbstractCreatureMetadataBundle,
4800 attach_face: AttachFace,
4801 peek: Peek,
4802 shulker_color: ShulkerColor,
4803}
4804impl Default for ShulkerMetadataBundle {
4805 fn default() -> Self {
4806 Self {
4807 _marker: Shulker,
4808 parent: Default::default(),
4809 attach_face: AttachFace(Default::default()),
4810 peek: Peek(0),
4811 shulker_color: ShulkerColor(16),
4812 }
4813 }
4814}
4815
4816#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
4817pub struct HasPumpkin(pub bool);
4819#[derive(Component)]
4843pub struct SnowGolem;
4844impl SnowGolem {
4845 fn apply_metadata(
4846 entity: &mut bevy_ecs::system::EntityCommands,
4847 d: EntityDataItem,
4848 ) -> Result<(), UpdateMetadataError> {
4849 match d.index {
4850 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4851 16 => {
4852 let bitfield = d
4853 .value
4854 .into_byte()
4855 .map_err(|v| e(v, d.index, "<bitfield>"))?;
4856 entity.insert(HasPumpkin(bitfield & 0x10 != 0));
4857 }
4858 _ => {}
4859 }
4860 Ok(())
4861 }
4862}
4863
4864#[derive(Bundle)]
4868pub struct SnowGolemMetadataBundle {
4869 _marker: SnowGolem,
4870 parent: AbstractCreatureMetadataBundle,
4871 has_pumpkin: HasPumpkin,
4872}
4873impl Default for SnowGolemMetadataBundle {
4874 fn default() -> Self {
4875 Self {
4876 _marker: SnowGolem,
4877 parent: Default::default(),
4878 has_pumpkin: HasPumpkin(true),
4879 }
4880 }
4881}
4882
4883#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4885pub struct TadpoleFromBucket(pub bool);
4886#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4888pub struct TadpoleAgeLocked(pub bool);
4889#[derive(Component)]
4913pub struct Tadpole;
4914impl Tadpole {
4915 fn apply_metadata(
4916 entity: &mut bevy_ecs::system::EntityCommands,
4917 d: EntityDataItem,
4918 ) -> Result<(), UpdateMetadataError> {
4919 match d.index {
4920 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
4921 16 => {
4922 entity.insert(TadpoleFromBucket(
4923 d.value
4924 .into_boolean()
4925 .map_err(|v| e(v, d.index, "TadpoleFromBucket"))?,
4926 ));
4927 }
4928 17 => {
4929 entity.insert(TadpoleAgeLocked(
4930 d.value
4931 .into_boolean()
4932 .map_err(|v| e(v, d.index, "TadpoleAgeLocked"))?,
4933 ));
4934 }
4935 _ => {}
4936 }
4937 Ok(())
4938 }
4939}
4940
4941#[derive(Bundle)]
4945pub struct TadpoleMetadataBundle {
4946 _marker: Tadpole,
4947 parent: AbstractCreatureMetadataBundle,
4948 tadpole_from_bucket: TadpoleFromBucket,
4949 tadpole_age_locked: TadpoleAgeLocked,
4950}
4951impl Default for TadpoleMetadataBundle {
4952 fn default() -> Self {
4953 Self {
4954 _marker: Tadpole,
4955 parent: Default::default(),
4956 tadpole_from_bucket: TadpoleFromBucket(false),
4957 tadpole_age_locked: TadpoleAgeLocked(false),
4958 }
4959 }
4960}
4961
4962#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4964pub struct AbstractAgeableBaby(pub bool);
4965#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
4967pub struct AbstractAgeableAgeLocked(pub bool);
4968#[derive(Component)]
5041pub struct AbstractAgeable;
5042impl AbstractAgeable {
5043 fn apply_metadata(
5044 entity: &mut bevy_ecs::system::EntityCommands,
5045 d: EntityDataItem,
5046 ) -> Result<(), UpdateMetadataError> {
5047 match d.index {
5048 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
5049 16 => {
5050 entity.insert(AbstractAgeableBaby(
5051 d.value
5052 .into_boolean()
5053 .map_err(|v| e(v, d.index, "AbstractAgeableBaby"))?,
5054 ));
5055 }
5056 17 => {
5057 entity.insert(AbstractAgeableAgeLocked(
5058 d.value
5059 .into_boolean()
5060 .map_err(|v| e(v, d.index, "AbstractAgeableAgeLocked"))?,
5061 ));
5062 }
5063 _ => {}
5064 }
5065 Ok(())
5066 }
5067}
5068
5069#[derive(Bundle)]
5073pub struct AbstractAgeableMetadataBundle {
5074 _marker: AbstractAgeable,
5075 parent: AbstractCreatureMetadataBundle,
5076 abstract_ageable_baby: AbstractAgeableBaby,
5077 abstract_ageable_age_locked: AbstractAgeableAgeLocked,
5078}
5079impl Default for AbstractAgeableMetadataBundle {
5080 fn default() -> Self {
5081 Self {
5082 _marker: AbstractAgeable,
5083 parent: Default::default(),
5084 abstract_ageable_baby: AbstractAgeableBaby(false),
5085 abstract_ageable_age_locked: AbstractAgeableAgeLocked(false),
5086 }
5087 }
5088}
5089
5090#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5092pub struct GotFish(pub bool);
5093#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5095pub struct MoistnessLevel(pub i32);
5096#[derive(Component)]
5121pub struct Dolphin;
5122impl Dolphin {
5123 fn apply_metadata(
5124 entity: &mut bevy_ecs::system::EntityCommands,
5125 d: EntityDataItem,
5126 ) -> Result<(), UpdateMetadataError> {
5127 match d.index {
5128 0..=17 => AbstractAgeable::apply_metadata(entity, d)?,
5129 18 => {
5130 entity.insert(GotFish(
5131 d.value
5132 .into_boolean()
5133 .map_err(|v| e(v, d.index, "GotFish"))?,
5134 ));
5135 }
5136 19 => {
5137 entity.insert(MoistnessLevel(
5138 d.value
5139 .into_int()
5140 .map_err(|v| e(v, d.index, "MoistnessLevel"))?,
5141 ));
5142 }
5143 _ => {}
5144 }
5145 Ok(())
5146 }
5147}
5148
5149#[derive(Bundle)]
5153pub struct DolphinMetadataBundle {
5154 _marker: Dolphin,
5155 parent: AbstractAgeableMetadataBundle,
5156 got_fish: GotFish,
5157 moistness_level: MoistnessLevel,
5158}
5159impl Default for DolphinMetadataBundle {
5160 fn default() -> Self {
5161 Self {
5162 _marker: Dolphin,
5163 parent: Default::default(),
5164 got_fish: GotFish(false),
5165 moistness_level: MoistnessLevel(2400),
5166 }
5167 }
5168}
5169
5170#[derive(Component)]
5192pub struct Squid;
5193impl Squid {
5194 fn apply_metadata(
5195 entity: &mut bevy_ecs::system::EntityCommands,
5196 d: EntityDataItem,
5197 ) -> Result<(), UpdateMetadataError> {
5198 match d.index {
5199 0..=17 => AbstractAgeable::apply_metadata(entity, d)?,
5200 _ => {}
5201 }
5202 Ok(())
5203 }
5204}
5205
5206#[derive(Bundle)]
5210pub struct SquidMetadataBundle {
5211 _marker: Squid,
5212 parent: AbstractAgeableMetadataBundle,
5213}
5214impl Default for SquidMetadataBundle {
5215 fn default() -> Self {
5216 Self {
5217 _marker: Squid,
5218 parent: Default::default(),
5219 }
5220 }
5221}
5222
5223#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5225pub struct DarkTicksRemaining(pub i32);
5226#[derive(Component)]
5252pub struct GlowSquid;
5253impl GlowSquid {
5254 fn apply_metadata(
5255 entity: &mut bevy_ecs::system::EntityCommands,
5256 d: EntityDataItem,
5257 ) -> Result<(), UpdateMetadataError> {
5258 match d.index {
5259 0..=17 => Squid::apply_metadata(entity, d)?,
5260 18 => {
5261 entity.insert(DarkTicksRemaining(
5262 d.value
5263 .into_int()
5264 .map_err(|v| e(v, d.index, "DarkTicksRemaining"))?,
5265 ));
5266 }
5267 _ => {}
5268 }
5269 Ok(())
5270 }
5271}
5272
5273#[derive(Bundle)]
5277pub struct GlowSquidMetadataBundle {
5278 _marker: GlowSquid,
5279 parent: SquidMetadataBundle,
5280 dark_ticks_remaining: DarkTicksRemaining,
5281}
5282impl Default for GlowSquidMetadataBundle {
5283 fn default() -> Self {
5284 Self {
5285 _marker: GlowSquid,
5286 parent: Default::default(),
5287 dark_ticks_remaining: DarkTicksRemaining(0),
5288 }
5289 }
5290}
5291
5292#[derive(Component)]
5351pub struct AbstractAnimal;
5352impl AbstractAnimal {
5353 fn apply_metadata(
5354 entity: &mut bevy_ecs::system::EntityCommands,
5355 d: EntityDataItem,
5356 ) -> Result<(), UpdateMetadataError> {
5357 match d.index {
5358 0..=17 => AbstractAgeable::apply_metadata(entity, d)?,
5359 _ => {}
5360 }
5361 Ok(())
5362 }
5363}
5364
5365#[derive(Bundle)]
5369pub struct AbstractAnimalMetadataBundle {
5370 _marker: AbstractAnimal,
5371 parent: AbstractAgeableMetadataBundle,
5372}
5373impl Default for AbstractAnimalMetadataBundle {
5374 fn default() -> Self {
5375 Self {
5376 _marker: AbstractAnimal,
5377 parent: Default::default(),
5378 }
5379 }
5380}
5381
5382#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5384pub struct ArmadilloState(pub ArmadilloStateKind);
5385#[derive(Component)]
5411pub struct Armadillo;
5412impl Armadillo {
5413 fn apply_metadata(
5414 entity: &mut bevy_ecs::system::EntityCommands,
5415 d: EntityDataItem,
5416 ) -> Result<(), UpdateMetadataError> {
5417 match d.index {
5418 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5419 18 => {
5420 entity.insert(ArmadilloState(
5421 d.value
5422 .into_armadillo_state()
5423 .map_err(|v| e(v, d.index, "ArmadilloState"))?,
5424 ));
5425 }
5426 _ => {}
5427 }
5428 Ok(())
5429 }
5430}
5431
5432#[derive(Bundle)]
5436pub struct ArmadilloMetadataBundle {
5437 _marker: Armadillo,
5438 parent: AbstractAnimalMetadataBundle,
5439 armadillo_state: ArmadilloState,
5440}
5441impl Default for ArmadilloMetadataBundle {
5442 fn default() -> Self {
5443 Self {
5444 _marker: Armadillo,
5445 parent: Default::default(),
5446 armadillo_state: ArmadilloState(Default::default()),
5447 }
5448 }
5449}
5450
5451#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5453pub struct AxolotlVariant(pub i32);
5454#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5456pub struct PlayingDead(pub bool);
5457#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5459pub struct AxolotlFromBucket(pub bool);
5460#[derive(Component)]
5487pub struct Axolotl;
5488impl Axolotl {
5489 fn apply_metadata(
5490 entity: &mut bevy_ecs::system::EntityCommands,
5491 d: EntityDataItem,
5492 ) -> Result<(), UpdateMetadataError> {
5493 match d.index {
5494 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5495 18 => {
5496 entity.insert(AxolotlVariant(
5497 d.value
5498 .into_int()
5499 .map_err(|v| e(v, d.index, "AxolotlVariant"))?,
5500 ));
5501 }
5502 19 => {
5503 entity.insert(PlayingDead(
5504 d.value
5505 .into_boolean()
5506 .map_err(|v| e(v, d.index, "PlayingDead"))?,
5507 ));
5508 }
5509 20 => {
5510 entity.insert(AxolotlFromBucket(
5511 d.value
5512 .into_boolean()
5513 .map_err(|v| e(v, d.index, "AxolotlFromBucket"))?,
5514 ));
5515 }
5516 _ => {}
5517 }
5518 Ok(())
5519 }
5520}
5521
5522#[derive(Bundle)]
5526pub struct AxolotlMetadataBundle {
5527 _marker: Axolotl,
5528 parent: AbstractAnimalMetadataBundle,
5529 axolotl_variant: AxolotlVariant,
5530 playing_dead: PlayingDead,
5531 axolotl_from_bucket: AxolotlFromBucket,
5532}
5533impl Default for AxolotlMetadataBundle {
5534 fn default() -> Self {
5535 Self {
5536 _marker: Axolotl,
5537 parent: Default::default(),
5538 axolotl_variant: AxolotlVariant(0),
5539 playing_dead: PlayingDead(false),
5540 axolotl_from_bucket: AxolotlFromBucket(false),
5541 }
5542 }
5543}
5544
5545#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5546pub struct HasNectar(pub bool);
5548#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5549pub struct HasStung(pub bool);
5551#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5552pub struct BeeRolling(pub bool);
5554#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5556pub struct BeeAngerEndTime(pub i64);
5557#[derive(Component)]
5585pub struct Bee;
5586impl Bee {
5587 fn apply_metadata(
5588 entity: &mut bevy_ecs::system::EntityCommands,
5589 d: EntityDataItem,
5590 ) -> Result<(), UpdateMetadataError> {
5591 match d.index {
5592 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5593 18 => {
5594 let bitfield = d
5595 .value
5596 .into_byte()
5597 .map_err(|v| e(v, d.index, "<bitfield>"))?;
5598 entity.insert(HasNectar(bitfield & 0x8 != 0));
5599 entity.insert(HasStung(bitfield & 0x4 != 0));
5600 entity.insert(BeeRolling(bitfield & 0x2 != 0));
5601 }
5602 19 => {
5603 entity.insert(BeeAngerEndTime(
5604 d.value
5605 .into_long()
5606 .map_err(|v| e(v, d.index, "BeeAngerEndTime"))?,
5607 ));
5608 }
5609 _ => {}
5610 }
5611 Ok(())
5612 }
5613}
5614
5615#[derive(Bundle)]
5619pub struct BeeMetadataBundle {
5620 _marker: Bee,
5621 parent: AbstractAnimalMetadataBundle,
5622 has_nectar: HasNectar,
5623 has_stung: HasStung,
5624 bee_rolling: BeeRolling,
5625 bee_anger_end_time: BeeAngerEndTime,
5626}
5627impl Default for BeeMetadataBundle {
5628 fn default() -> Self {
5629 Self {
5630 _marker: Bee,
5631 parent: Default::default(),
5632 has_nectar: HasNectar(false),
5633 has_stung: HasStung(false),
5634 bee_rolling: BeeRolling(false),
5635 bee_anger_end_time: BeeAngerEndTime(-1),
5636 }
5637 }
5638}
5639
5640#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5642pub struct ChickenVariant(pub azalea_registry::data::ChickenVariant);
5643#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5645pub struct ChickenSoundVariant(pub azalea_registry::data::ChickenSoundVariant);
5646#[derive(Component)]
5672pub struct Chicken;
5673impl Chicken {
5674 fn apply_metadata(
5675 entity: &mut bevy_ecs::system::EntityCommands,
5676 d: EntityDataItem,
5677 ) -> Result<(), UpdateMetadataError> {
5678 match d.index {
5679 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5680 18 => {
5681 entity.insert(ChickenVariant(
5682 d.value
5683 .into_chicken_variant()
5684 .map_err(|v| e(v, d.index, "ChickenVariant"))?,
5685 ));
5686 }
5687 19 => {
5688 entity.insert(ChickenSoundVariant(
5689 d.value
5690 .into_chicken_sound_variant()
5691 .map_err(|v| e(v, d.index, "ChickenSoundVariant"))?,
5692 ));
5693 }
5694 _ => {}
5695 }
5696 Ok(())
5697 }
5698}
5699
5700#[derive(Bundle)]
5704pub struct ChickenMetadataBundle {
5705 _marker: Chicken,
5706 parent: AbstractAnimalMetadataBundle,
5707 chicken_variant: ChickenVariant,
5708 chicken_sound_variant: ChickenSoundVariant,
5709}
5710impl Default for ChickenMetadataBundle {
5711 fn default() -> Self {
5712 Self {
5713 _marker: Chicken,
5714 parent: Default::default(),
5715 chicken_variant: ChickenVariant(azalea_registry::data::ChickenVariant::default()),
5716 chicken_sound_variant: ChickenSoundVariant(
5717 azalea_registry::data::ChickenSoundVariant::default(),
5718 ),
5719 }
5720 }
5721}
5722
5723#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5725pub struct CowVariant(pub azalea_registry::data::CowVariant);
5726#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5728pub struct CowSoundVariant(pub azalea_registry::data::CowSoundVariant);
5729#[derive(Component)]
5755pub struct Cow;
5756impl Cow {
5757 fn apply_metadata(
5758 entity: &mut bevy_ecs::system::EntityCommands,
5759 d: EntityDataItem,
5760 ) -> Result<(), UpdateMetadataError> {
5761 match d.index {
5762 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5763 18 => {
5764 entity.insert(CowVariant(
5765 d.value
5766 .into_cow_variant()
5767 .map_err(|v| e(v, d.index, "CowVariant"))?,
5768 ));
5769 }
5770 19 => {
5771 entity.insert(CowSoundVariant(
5772 d.value
5773 .into_cow_sound_variant()
5774 .map_err(|v| e(v, d.index, "CowSoundVariant"))?,
5775 ));
5776 }
5777 _ => {}
5778 }
5779 Ok(())
5780 }
5781}
5782
5783#[derive(Bundle)]
5787pub struct CowMetadataBundle {
5788 _marker: Cow,
5789 parent: AbstractAnimalMetadataBundle,
5790 cow_variant: CowVariant,
5791 cow_sound_variant: CowSoundVariant,
5792}
5793impl Default for CowMetadataBundle {
5794 fn default() -> Self {
5795 Self {
5796 _marker: Cow,
5797 parent: Default::default(),
5798 cow_variant: CowVariant(azalea_registry::data::CowVariant::default()),
5799 cow_sound_variant: CowSoundVariant(azalea_registry::data::CowSoundVariant::default()),
5800 }
5801 }
5802}
5803
5804#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5806pub struct FoxKind(pub i32);
5807#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5808pub struct FoxSitting(pub bool);
5810#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5811pub struct Faceplanted(pub bool);
5813#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5814pub struct Defending(pub bool);
5816#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5817pub struct Sleeping(pub bool);
5819#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5820pub struct Pouncing(pub bool);
5822#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5823pub struct FoxCrouching(pub bool);
5825#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
5826pub struct FoxInterested(pub bool);
5828#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5830pub struct TrustedId0(pub Option<Uuid>);
5831#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5833pub struct TrustedId1(pub Option<Uuid>);
5834#[derive(Component)]
5868pub struct Fox;
5869impl Fox {
5870 fn apply_metadata(
5871 entity: &mut bevy_ecs::system::EntityCommands,
5872 d: EntityDataItem,
5873 ) -> Result<(), UpdateMetadataError> {
5874 match d.index {
5875 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5876 18 => {
5877 entity.insert(FoxKind(
5878 d.value.into_int().map_err(|v| e(v, d.index, "FoxKind"))?,
5879 ));
5880 }
5881 19 => {
5882 let bitfield = d
5883 .value
5884 .into_byte()
5885 .map_err(|v| e(v, d.index, "<bitfield>"))?;
5886 entity.insert(FoxSitting(bitfield & 0x1 != 0));
5887 entity.insert(Faceplanted(bitfield & 0x40 != 0));
5888 entity.insert(Defending(bitfield & 0x80 != 0));
5889 entity.insert(Sleeping(bitfield & 0x20 != 0));
5890 entity.insert(Pouncing(bitfield & 0x10 != 0));
5891 entity.insert(FoxCrouching(bitfield & 0x4 != 0));
5892 entity.insert(FoxInterested(bitfield & 0x8 != 0));
5893 }
5894 20 => {
5895 entity.insert(TrustedId0(
5896 d.value
5897 .into_optional_living_entity_reference()
5898 .map_err(|v| e(v, d.index, "TrustedId0"))?,
5899 ));
5900 }
5901 21 => {
5902 entity.insert(TrustedId1(
5903 d.value
5904 .into_optional_living_entity_reference()
5905 .map_err(|v| e(v, d.index, "TrustedId1"))?,
5906 ));
5907 }
5908 _ => {}
5909 }
5910 Ok(())
5911 }
5912}
5913
5914#[derive(Bundle)]
5918pub struct FoxMetadataBundle {
5919 _marker: Fox,
5920 parent: AbstractAnimalMetadataBundle,
5921 fox_kind: FoxKind,
5922 fox_sitting: FoxSitting,
5923 faceplanted: Faceplanted,
5924 defending: Defending,
5925 sleeping: Sleeping,
5926 pouncing: Pouncing,
5927 fox_crouching: FoxCrouching,
5928 fox_interested: FoxInterested,
5929 trusted_id_0: TrustedId0,
5930 trusted_id_1: TrustedId1,
5931}
5932impl Default for FoxMetadataBundle {
5933 fn default() -> Self {
5934 Self {
5935 _marker: Fox,
5936 parent: Default::default(),
5937 fox_kind: FoxKind(Default::default()),
5938 fox_sitting: FoxSitting(false),
5939 faceplanted: Faceplanted(false),
5940 defending: Defending(false),
5941 sleeping: Sleeping(false),
5942 pouncing: Pouncing(false),
5943 fox_crouching: FoxCrouching(false),
5944 fox_interested: FoxInterested(false),
5945 trusted_id_0: TrustedId0(None),
5946 trusted_id_1: TrustedId1(None),
5947 }
5948 }
5949}
5950
5951#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5953pub struct FrogVariant(pub azalea_registry::data::FrogVariant);
5954#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
5956pub struct TongueTarget(pub OptionalUnsignedInt);
5957#[derive(Component)]
5983pub struct Frog;
5984impl Frog {
5985 fn apply_metadata(
5986 entity: &mut bevy_ecs::system::EntityCommands,
5987 d: EntityDataItem,
5988 ) -> Result<(), UpdateMetadataError> {
5989 match d.index {
5990 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
5991 18 => {
5992 entity.insert(FrogVariant(
5993 d.value
5994 .into_frog_variant()
5995 .map_err(|v| e(v, d.index, "FrogVariant"))?,
5996 ));
5997 }
5998 19 => {
5999 entity.insert(TongueTarget(
6000 d.value
6001 .into_optional_unsigned_int()
6002 .map_err(|v| e(v, d.index, "TongueTarget"))?,
6003 ));
6004 }
6005 _ => {}
6006 }
6007 Ok(())
6008 }
6009}
6010
6011#[derive(Bundle)]
6015pub struct FrogMetadataBundle {
6016 _marker: Frog,
6017 parent: AbstractAnimalMetadataBundle,
6018 frog_variant: FrogVariant,
6019 tongue_target: TongueTarget,
6020}
6021impl Default for FrogMetadataBundle {
6022 fn default() -> Self {
6023 Self {
6024 _marker: Frog,
6025 parent: Default::default(),
6026 frog_variant: FrogVariant(azalea_registry::data::FrogVariant::default()),
6027 tongue_target: TongueTarget(OptionalUnsignedInt(None)),
6028 }
6029 }
6030}
6031
6032#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6034pub struct IsScreamingGoat(pub bool);
6035#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6037pub struct HasLeftHorn(pub bool);
6038#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6040pub struct HasRightHorn(pub bool);
6041#[derive(Component)]
6068pub struct Goat;
6069impl Goat {
6070 fn apply_metadata(
6071 entity: &mut bevy_ecs::system::EntityCommands,
6072 d: EntityDataItem,
6073 ) -> Result<(), UpdateMetadataError> {
6074 match d.index {
6075 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6076 18 => {
6077 entity.insert(IsScreamingGoat(
6078 d.value
6079 .into_boolean()
6080 .map_err(|v| e(v, d.index, "IsScreamingGoat"))?,
6081 ));
6082 }
6083 19 => {
6084 entity.insert(HasLeftHorn(
6085 d.value
6086 .into_boolean()
6087 .map_err(|v| e(v, d.index, "HasLeftHorn"))?,
6088 ));
6089 }
6090 20 => {
6091 entity.insert(HasRightHorn(
6092 d.value
6093 .into_boolean()
6094 .map_err(|v| e(v, d.index, "HasRightHorn"))?,
6095 ));
6096 }
6097 _ => {}
6098 }
6099 Ok(())
6100 }
6101}
6102
6103#[derive(Bundle)]
6107pub struct GoatMetadataBundle {
6108 _marker: Goat,
6109 parent: AbstractAnimalMetadataBundle,
6110 is_screaming_goat: IsScreamingGoat,
6111 has_left_horn: HasLeftHorn,
6112 has_right_horn: HasRightHorn,
6113}
6114impl Default for GoatMetadataBundle {
6115 fn default() -> Self {
6116 Self {
6117 _marker: Goat,
6118 parent: Default::default(),
6119 is_screaming_goat: IsScreamingGoat(false),
6120 has_left_horn: HasLeftHorn(true),
6121 has_right_horn: HasRightHorn(true),
6122 }
6123 }
6124}
6125
6126#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6128pub struct IsLeashHolder(pub bool);
6129#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6131pub struct StaysStill(pub bool);
6132#[derive(Component)]
6159pub struct HappyGhast;
6160impl HappyGhast {
6161 fn apply_metadata(
6162 entity: &mut bevy_ecs::system::EntityCommands,
6163 d: EntityDataItem,
6164 ) -> Result<(), UpdateMetadataError> {
6165 match d.index {
6166 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6167 18 => {
6168 entity.insert(IsLeashHolder(
6169 d.value
6170 .into_boolean()
6171 .map_err(|v| e(v, d.index, "IsLeashHolder"))?,
6172 ));
6173 }
6174 19 => {
6175 entity.insert(StaysStill(
6176 d.value
6177 .into_boolean()
6178 .map_err(|v| e(v, d.index, "StaysStill"))?,
6179 ));
6180 }
6181 _ => {}
6182 }
6183 Ok(())
6184 }
6185}
6186
6187#[derive(Bundle)]
6191pub struct HappyGhastMetadataBundle {
6192 _marker: HappyGhast,
6193 parent: AbstractAnimalMetadataBundle,
6194 is_leash_holder: IsLeashHolder,
6195 stays_still: StaysStill,
6196}
6197impl Default for HappyGhastMetadataBundle {
6198 fn default() -> Self {
6199 Self {
6200 _marker: HappyGhast,
6201 parent: Default::default(),
6202 is_leash_holder: IsLeashHolder(false),
6203 stays_still: StaysStill(false),
6204 }
6205 }
6206}
6207
6208#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6210pub struct HoglinImmuneToZombification(pub bool);
6211#[derive(Component)]
6236pub struct Hoglin;
6237impl Hoglin {
6238 fn apply_metadata(
6239 entity: &mut bevy_ecs::system::EntityCommands,
6240 d: EntityDataItem,
6241 ) -> Result<(), UpdateMetadataError> {
6242 match d.index {
6243 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6244 18 => {
6245 entity.insert(HoglinImmuneToZombification(
6246 d.value
6247 .into_boolean()
6248 .map_err(|v| e(v, d.index, "HoglinImmuneToZombification"))?,
6249 ));
6250 }
6251 _ => {}
6252 }
6253 Ok(())
6254 }
6255}
6256
6257#[derive(Bundle)]
6261pub struct HoglinMetadataBundle {
6262 _marker: Hoglin,
6263 parent: AbstractAnimalMetadataBundle,
6264 hoglin_immune_to_zombification: HoglinImmuneToZombification,
6265}
6266impl Default for HoglinMetadataBundle {
6267 fn default() -> Self {
6268 Self {
6269 _marker: Hoglin,
6270 parent: Default::default(),
6271 hoglin_immune_to_zombification: HoglinImmuneToZombification(false),
6272 }
6273 }
6274}
6275
6276#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6278pub struct MooshroomKind(pub i32);
6279#[derive(Component)]
6305pub struct Mooshroom;
6306impl Mooshroom {
6307 fn apply_metadata(
6308 entity: &mut bevy_ecs::system::EntityCommands,
6309 d: EntityDataItem,
6310 ) -> Result<(), UpdateMetadataError> {
6311 match d.index {
6312 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6313 18 => {
6314 entity.insert(MooshroomKind(
6315 d.value
6316 .into_int()
6317 .map_err(|v| e(v, d.index, "MooshroomKind"))?,
6318 ));
6319 }
6320 _ => {}
6321 }
6322 Ok(())
6323 }
6324}
6325
6326#[derive(Bundle)]
6330pub struct MooshroomMetadataBundle {
6331 _marker: Mooshroom,
6332 parent: AbstractAnimalMetadataBundle,
6333 mooshroom_kind: MooshroomKind,
6334}
6335impl Default for MooshroomMetadataBundle {
6336 fn default() -> Self {
6337 Self {
6338 _marker: Mooshroom,
6339 parent: Default::default(),
6340 mooshroom_kind: MooshroomKind(Default::default()),
6341 }
6342 }
6343}
6344
6345#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6347pub struct Trusting(pub bool);
6348#[derive(Component)]
6373pub struct Ocelot;
6374impl Ocelot {
6375 fn apply_metadata(
6376 entity: &mut bevy_ecs::system::EntityCommands,
6377 d: EntityDataItem,
6378 ) -> Result<(), UpdateMetadataError> {
6379 match d.index {
6380 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6381 18 => {
6382 entity.insert(Trusting(
6383 d.value
6384 .into_boolean()
6385 .map_err(|v| e(v, d.index, "Trusting"))?,
6386 ));
6387 }
6388 _ => {}
6389 }
6390 Ok(())
6391 }
6392}
6393
6394#[derive(Bundle)]
6398pub struct OcelotMetadataBundle {
6399 _marker: Ocelot,
6400 parent: AbstractAnimalMetadataBundle,
6401 trusting: Trusting,
6402}
6403impl Default for OcelotMetadataBundle {
6404 fn default() -> Self {
6405 Self {
6406 _marker: Ocelot,
6407 parent: Default::default(),
6408 trusting: Trusting(false),
6409 }
6410 }
6411}
6412
6413#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6415pub struct PandaUnhappyCounter(pub i32);
6416#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6418pub struct SneezeCounter(pub i32);
6419#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6421pub struct EatCounter(pub i32);
6422#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6423pub struct Sneezing(pub bool);
6425#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6426pub struct PandaSitting(pub bool);
6428#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6429pub struct OnBack(pub bool);
6431#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6432pub struct PandaRolling(pub bool);
6434#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6436pub struct HiddenGene(pub u8);
6437#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6439pub struct PandaFlags(pub u8);
6440#[derive(Component)]
6473pub struct Panda;
6474impl Panda {
6475 fn apply_metadata(
6476 entity: &mut bevy_ecs::system::EntityCommands,
6477 d: EntityDataItem,
6478 ) -> Result<(), UpdateMetadataError> {
6479 match d.index {
6480 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6481 18 => {
6482 entity.insert(PandaUnhappyCounter(
6483 d.value
6484 .into_int()
6485 .map_err(|v| e(v, d.index, "PandaUnhappyCounter"))?,
6486 ));
6487 }
6488 19 => {
6489 entity.insert(SneezeCounter(
6490 d.value
6491 .into_int()
6492 .map_err(|v| e(v, d.index, "SneezeCounter"))?,
6493 ));
6494 }
6495 20 => {
6496 entity.insert(EatCounter(
6497 d.value
6498 .into_int()
6499 .map_err(|v| e(v, d.index, "EatCounter"))?,
6500 ));
6501 }
6502 21 => {
6503 let bitfield = d
6504 .value
6505 .into_byte()
6506 .map_err(|v| e(v, d.index, "<bitfield>"))?;
6507 entity.insert(Sneezing(bitfield & 0x2 != 0));
6508 entity.insert(PandaSitting(bitfield & 0x8 != 0));
6509 entity.insert(OnBack(bitfield & 0x10 != 0));
6510 entity.insert(PandaRolling(bitfield & 0x4 != 0));
6511 }
6512 22 => {
6513 entity.insert(HiddenGene(
6514 d.value
6515 .into_byte()
6516 .map_err(|v| e(v, d.index, "HiddenGene"))?,
6517 ));
6518 }
6519 23 => {
6520 entity.insert(PandaFlags(
6521 d.value
6522 .into_byte()
6523 .map_err(|v| e(v, d.index, "PandaFlags"))?,
6524 ));
6525 }
6526 _ => {}
6527 }
6528 Ok(())
6529 }
6530}
6531
6532#[derive(Bundle)]
6536pub struct PandaMetadataBundle {
6537 _marker: Panda,
6538 parent: AbstractAnimalMetadataBundle,
6539 panda_unhappy_counter: PandaUnhappyCounter,
6540 sneeze_counter: SneezeCounter,
6541 eat_counter: EatCounter,
6542 sneezing: Sneezing,
6543 panda_sitting: PandaSitting,
6544 on_back: OnBack,
6545 panda_rolling: PandaRolling,
6546 hidden_gene: HiddenGene,
6547 panda_flags: PandaFlags,
6548}
6549impl Default for PandaMetadataBundle {
6550 fn default() -> Self {
6551 Self {
6552 _marker: Panda,
6553 parent: Default::default(),
6554 panda_unhappy_counter: PandaUnhappyCounter(0),
6555 sneeze_counter: SneezeCounter(0),
6556 eat_counter: EatCounter(0),
6557 sneezing: Sneezing(false),
6558 panda_sitting: PandaSitting(false),
6559 on_back: OnBack(false),
6560 panda_rolling: PandaRolling(false),
6561 hidden_gene: HiddenGene(0),
6562 panda_flags: PandaFlags(0),
6563 }
6564 }
6565}
6566
6567#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6569pub struct PigBoostTime(pub i32);
6570#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6572pub struct PigVariant(pub azalea_registry::data::PigVariant);
6573#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6575pub struct PigSoundVariant(pub azalea_registry::data::PigSoundVariant);
6576#[derive(Component)]
6603pub struct Pig;
6604impl Pig {
6605 fn apply_metadata(
6606 entity: &mut bevy_ecs::system::EntityCommands,
6607 d: EntityDataItem,
6608 ) -> Result<(), UpdateMetadataError> {
6609 match d.index {
6610 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6611 18 => {
6612 entity.insert(PigBoostTime(
6613 d.value
6614 .into_int()
6615 .map_err(|v| e(v, d.index, "PigBoostTime"))?,
6616 ));
6617 }
6618 19 => {
6619 entity.insert(PigVariant(
6620 d.value
6621 .into_pig_variant()
6622 .map_err(|v| e(v, d.index, "PigVariant"))?,
6623 ));
6624 }
6625 20 => {
6626 entity.insert(PigSoundVariant(
6627 d.value
6628 .into_pig_sound_variant()
6629 .map_err(|v| e(v, d.index, "PigSoundVariant"))?,
6630 ));
6631 }
6632 _ => {}
6633 }
6634 Ok(())
6635 }
6636}
6637
6638#[derive(Bundle)]
6642pub struct PigMetadataBundle {
6643 _marker: Pig,
6644 parent: AbstractAnimalMetadataBundle,
6645 pig_boost_time: PigBoostTime,
6646 pig_variant: PigVariant,
6647 pig_sound_variant: PigSoundVariant,
6648}
6649impl Default for PigMetadataBundle {
6650 fn default() -> Self {
6651 Self {
6652 _marker: Pig,
6653 parent: Default::default(),
6654 pig_boost_time: PigBoostTime(0),
6655 pig_variant: PigVariant(azalea_registry::data::PigVariant::default()),
6656 pig_sound_variant: PigSoundVariant(azalea_registry::data::PigSoundVariant::default()),
6657 }
6658 }
6659}
6660
6661#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6663pub struct PolarBearStanding(pub bool);
6664#[derive(Component)]
6690pub struct PolarBear;
6691impl PolarBear {
6692 fn apply_metadata(
6693 entity: &mut bevy_ecs::system::EntityCommands,
6694 d: EntityDataItem,
6695 ) -> Result<(), UpdateMetadataError> {
6696 match d.index {
6697 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6698 18 => {
6699 entity.insert(PolarBearStanding(
6700 d.value
6701 .into_boolean()
6702 .map_err(|v| e(v, d.index, "PolarBearStanding"))?,
6703 ));
6704 }
6705 _ => {}
6706 }
6707 Ok(())
6708 }
6709}
6710
6711#[derive(Bundle)]
6715pub struct PolarBearMetadataBundle {
6716 _marker: PolarBear,
6717 parent: AbstractAnimalMetadataBundle,
6718 polar_bear_standing: PolarBearStanding,
6719}
6720impl Default for PolarBearMetadataBundle {
6721 fn default() -> Self {
6722 Self {
6723 _marker: PolarBear,
6724 parent: Default::default(),
6725 polar_bear_standing: PolarBearStanding(false),
6726 }
6727 }
6728}
6729
6730#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6732pub struct RabbitKind(pub i32);
6733#[derive(Component)]
6758pub struct Rabbit;
6759impl Rabbit {
6760 fn apply_metadata(
6761 entity: &mut bevy_ecs::system::EntityCommands,
6762 d: EntityDataItem,
6763 ) -> Result<(), UpdateMetadataError> {
6764 match d.index {
6765 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6766 18 => {
6767 entity.insert(RabbitKind(
6768 d.value
6769 .into_int()
6770 .map_err(|v| e(v, d.index, "RabbitKind"))?,
6771 ));
6772 }
6773 _ => {}
6774 }
6775 Ok(())
6776 }
6777}
6778
6779#[derive(Bundle)]
6783pub struct RabbitMetadataBundle {
6784 _marker: Rabbit,
6785 parent: AbstractAnimalMetadataBundle,
6786 rabbit_kind: RabbitKind,
6787}
6788impl Default for RabbitMetadataBundle {
6789 fn default() -> Self {
6790 Self {
6791 _marker: Rabbit,
6792 parent: Default::default(),
6793 rabbit_kind: RabbitKind(Default::default()),
6794 }
6795 }
6796}
6797
6798#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
6799pub struct SheepSheared(pub bool);
6801#[derive(Component)]
6826pub struct Sheep;
6827impl Sheep {
6828 fn apply_metadata(
6829 entity: &mut bevy_ecs::system::EntityCommands,
6830 d: EntityDataItem,
6831 ) -> Result<(), UpdateMetadataError> {
6832 match d.index {
6833 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6834 18 => {
6835 let bitfield = d
6836 .value
6837 .into_byte()
6838 .map_err(|v| e(v, d.index, "<bitfield>"))?;
6839 entity.insert(SheepSheared(bitfield & 0x10 != 0));
6840 }
6841 _ => {}
6842 }
6843 Ok(())
6844 }
6845}
6846
6847#[derive(Bundle)]
6851pub struct SheepMetadataBundle {
6852 _marker: Sheep,
6853 parent: AbstractAnimalMetadataBundle,
6854 sheep_sheared: SheepSheared,
6855}
6856impl Default for SheepMetadataBundle {
6857 fn default() -> Self {
6858 Self {
6859 _marker: Sheep,
6860 parent: Default::default(),
6861 sheep_sheared: SheepSheared(false),
6862 }
6863 }
6864}
6865
6866#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6868pub struct SnifferState(pub SnifferStateKind);
6869#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6871pub struct DropSeedAtTick(pub i32);
6872#[derive(Component)]
6898pub struct Sniffer;
6899impl Sniffer {
6900 fn apply_metadata(
6901 entity: &mut bevy_ecs::system::EntityCommands,
6902 d: EntityDataItem,
6903 ) -> Result<(), UpdateMetadataError> {
6904 match d.index {
6905 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6906 18 => {
6907 entity.insert(SnifferState(
6908 d.value
6909 .into_sniffer_state()
6910 .map_err(|v| e(v, d.index, "SnifferState"))?,
6911 ));
6912 }
6913 19 => {
6914 entity.insert(DropSeedAtTick(
6915 d.value
6916 .into_int()
6917 .map_err(|v| e(v, d.index, "DropSeedAtTick"))?,
6918 ));
6919 }
6920 _ => {}
6921 }
6922 Ok(())
6923 }
6924}
6925
6926#[derive(Bundle)]
6930pub struct SnifferMetadataBundle {
6931 _marker: Sniffer,
6932 parent: AbstractAnimalMetadataBundle,
6933 sniffer_state: SnifferState,
6934 drop_seed_at_tick: DropSeedAtTick,
6935}
6936impl Default for SnifferMetadataBundle {
6937 fn default() -> Self {
6938 Self {
6939 _marker: Sniffer,
6940 parent: Default::default(),
6941 sniffer_state: SnifferState(Default::default()),
6942 drop_seed_at_tick: DropSeedAtTick(0),
6943 }
6944 }
6945}
6946
6947#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6949pub struct StriderBoostTime(pub i32);
6950#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
6952pub struct Suffocating(pub bool);
6953#[derive(Component)]
6979pub struct Strider;
6980impl Strider {
6981 fn apply_metadata(
6982 entity: &mut bevy_ecs::system::EntityCommands,
6983 d: EntityDataItem,
6984 ) -> Result<(), UpdateMetadataError> {
6985 match d.index {
6986 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
6987 18 => {
6988 entity.insert(StriderBoostTime(
6989 d.value
6990 .into_int()
6991 .map_err(|v| e(v, d.index, "StriderBoostTime"))?,
6992 ));
6993 }
6994 19 => {
6995 entity.insert(Suffocating(
6996 d.value
6997 .into_boolean()
6998 .map_err(|v| e(v, d.index, "Suffocating"))?,
6999 ));
7000 }
7001 _ => {}
7002 }
7003 Ok(())
7004 }
7005}
7006
7007#[derive(Bundle)]
7011pub struct StriderMetadataBundle {
7012 _marker: Strider,
7013 parent: AbstractAnimalMetadataBundle,
7014 strider_boost_time: StriderBoostTime,
7015 suffocating: Suffocating,
7016}
7017impl Default for StriderMetadataBundle {
7018 fn default() -> Self {
7019 Self {
7020 _marker: Strider,
7021 parent: Default::default(),
7022 strider_boost_time: StriderBoostTime(0),
7023 suffocating: Suffocating(false),
7024 }
7025 }
7026}
7027
7028#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7030pub struct HasEgg(pub bool);
7031#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7033pub struct LayingEgg(pub bool);
7034#[derive(Component)]
7060pub struct Turtle;
7061impl Turtle {
7062 fn apply_metadata(
7063 entity: &mut bevy_ecs::system::EntityCommands,
7064 d: EntityDataItem,
7065 ) -> Result<(), UpdateMetadataError> {
7066 match d.index {
7067 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
7068 18 => {
7069 entity.insert(HasEgg(
7070 d.value
7071 .into_boolean()
7072 .map_err(|v| e(v, d.index, "HasEgg"))?,
7073 ));
7074 }
7075 19 => {
7076 entity.insert(LayingEgg(
7077 d.value
7078 .into_boolean()
7079 .map_err(|v| e(v, d.index, "LayingEgg"))?,
7080 ));
7081 }
7082 _ => {}
7083 }
7084 Ok(())
7085 }
7086}
7087
7088#[derive(Bundle)]
7092pub struct TurtleMetadataBundle {
7093 _marker: Turtle,
7094 parent: AbstractAnimalMetadataBundle,
7095 has_egg: HasEgg,
7096 laying_egg: LayingEgg,
7097}
7098impl Default for TurtleMetadataBundle {
7099 fn default() -> Self {
7100 Self {
7101 _marker: Turtle,
7102 parent: Default::default(),
7103 has_egg: HasEgg(false),
7104 laying_egg: LayingEgg(false),
7105 }
7106 }
7107}
7108
7109#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
7110pub struct Tamed(pub bool);
7112#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
7113pub struct Eating(pub bool);
7115#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
7116pub struct AbstractHorseStanding(pub bool);
7118#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
7119pub struct Bred(pub bool);
7121#[derive(Component)]
7159pub struct AbstractHorse;
7160impl AbstractHorse {
7161 fn apply_metadata(
7162 entity: &mut bevy_ecs::system::EntityCommands,
7163 d: EntityDataItem,
7164 ) -> Result<(), UpdateMetadataError> {
7165 match d.index {
7166 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
7167 18 => {
7168 let bitfield = d
7169 .value
7170 .into_byte()
7171 .map_err(|v| e(v, d.index, "<bitfield>"))?;
7172 entity.insert(Tamed(bitfield & 0x2 != 0));
7173 entity.insert(Eating(bitfield & 0x10 != 0));
7174 entity.insert(AbstractHorseStanding(bitfield & 0x20 != 0));
7175 entity.insert(Bred(bitfield & 0x8 != 0));
7176 }
7177 _ => {}
7178 }
7179 Ok(())
7180 }
7181}
7182
7183#[derive(Bundle)]
7187pub struct AbstractHorseMetadataBundle {
7188 _marker: AbstractHorse,
7189 parent: AbstractAnimalMetadataBundle,
7190 tamed: Tamed,
7191 eating: Eating,
7192 abstract_horse_standing: AbstractHorseStanding,
7193 bred: Bred,
7194}
7195impl Default for AbstractHorseMetadataBundle {
7196 fn default() -> Self {
7197 Self {
7198 _marker: AbstractHorse,
7199 parent: Default::default(),
7200 tamed: Tamed(false),
7201 eating: Eating(false),
7202 abstract_horse_standing: AbstractHorseStanding(false),
7203 bred: Bred(false),
7204 }
7205 }
7206}
7207
7208#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7210pub struct CamelDash(pub bool);
7211#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7213pub struct LastPoseChangeTick(pub i64);
7214#[derive(Component)]
7241pub struct Camel;
7242impl Camel {
7243 fn apply_metadata(
7244 entity: &mut bevy_ecs::system::EntityCommands,
7245 d: EntityDataItem,
7246 ) -> Result<(), UpdateMetadataError> {
7247 match d.index {
7248 0..=18 => AbstractHorse::apply_metadata(entity, d)?,
7249 19 => {
7250 entity.insert(CamelDash(
7251 d.value
7252 .into_boolean()
7253 .map_err(|v| e(v, d.index, "CamelDash"))?,
7254 ));
7255 }
7256 20 => {
7257 entity.insert(LastPoseChangeTick(
7258 d.value
7259 .into_long()
7260 .map_err(|v| e(v, d.index, "LastPoseChangeTick"))?,
7261 ));
7262 }
7263 _ => {}
7264 }
7265 Ok(())
7266 }
7267}
7268
7269#[derive(Bundle)]
7273pub struct CamelMetadataBundle {
7274 _marker: Camel,
7275 parent: AbstractHorseMetadataBundle,
7276 camel_dash: CamelDash,
7277 last_pose_change_tick: LastPoseChangeTick,
7278}
7279impl Default for CamelMetadataBundle {
7280 fn default() -> Self {
7281 Self {
7282 _marker: Camel,
7283 parent: Default::default(),
7284 camel_dash: CamelDash(false),
7285 last_pose_change_tick: LastPoseChangeTick(0),
7286 }
7287 }
7288}
7289
7290#[derive(Component)]
7315pub struct CamelHusk;
7316impl CamelHusk {
7317 fn apply_metadata(
7318 entity: &mut bevy_ecs::system::EntityCommands,
7319 d: EntityDataItem,
7320 ) -> Result<(), UpdateMetadataError> {
7321 match d.index {
7322 0..=20 => Camel::apply_metadata(entity, d)?,
7323 _ => {}
7324 }
7325 Ok(())
7326 }
7327}
7328
7329#[derive(Bundle)]
7333pub struct CamelHuskMetadataBundle {
7334 _marker: CamelHusk,
7335 parent: CamelMetadataBundle,
7336}
7337impl Default for CamelHuskMetadataBundle {
7338 fn default() -> Self {
7339 Self {
7340 _marker: CamelHusk,
7341 parent: Default::default(),
7342 }
7343 }
7344}
7345
7346#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7348pub struct HorseTypeVariant(pub i32);
7349#[derive(Component)]
7375pub struct Horse;
7376impl Horse {
7377 fn apply_metadata(
7378 entity: &mut bevy_ecs::system::EntityCommands,
7379 d: EntityDataItem,
7380 ) -> Result<(), UpdateMetadataError> {
7381 match d.index {
7382 0..=18 => AbstractHorse::apply_metadata(entity, d)?,
7383 19 => {
7384 entity.insert(HorseTypeVariant(
7385 d.value
7386 .into_int()
7387 .map_err(|v| e(v, d.index, "HorseTypeVariant"))?,
7388 ));
7389 }
7390 _ => {}
7391 }
7392 Ok(())
7393 }
7394}
7395
7396#[derive(Bundle)]
7400pub struct HorseMetadataBundle {
7401 _marker: Horse,
7402 parent: AbstractHorseMetadataBundle,
7403 horse_type_variant: HorseTypeVariant,
7404}
7405impl Default for HorseMetadataBundle {
7406 fn default() -> Self {
7407 Self {
7408 _marker: Horse,
7409 parent: Default::default(),
7410 horse_type_variant: HorseTypeVariant(0),
7411 }
7412 }
7413}
7414
7415#[derive(Component)]
7439pub struct SkeletonHorse;
7440impl SkeletonHorse {
7441 fn apply_metadata(
7442 entity: &mut bevy_ecs::system::EntityCommands,
7443 d: EntityDataItem,
7444 ) -> Result<(), UpdateMetadataError> {
7445 match d.index {
7446 0..=18 => AbstractHorse::apply_metadata(entity, d)?,
7447 _ => {}
7448 }
7449 Ok(())
7450 }
7451}
7452
7453#[derive(Bundle)]
7457pub struct SkeletonHorseMetadataBundle {
7458 _marker: SkeletonHorse,
7459 parent: AbstractHorseMetadataBundle,
7460}
7461impl Default for SkeletonHorseMetadataBundle {
7462 fn default() -> Self {
7463 Self {
7464 _marker: SkeletonHorse,
7465 parent: Default::default(),
7466 }
7467 }
7468}
7469
7470#[derive(Component)]
7494pub struct ZombieHorse;
7495impl ZombieHorse {
7496 fn apply_metadata(
7497 entity: &mut bevy_ecs::system::EntityCommands,
7498 d: EntityDataItem,
7499 ) -> Result<(), UpdateMetadataError> {
7500 match d.index {
7501 0..=18 => AbstractHorse::apply_metadata(entity, d)?,
7502 _ => {}
7503 }
7504 Ok(())
7505 }
7506}
7507
7508#[derive(Bundle)]
7512pub struct ZombieHorseMetadataBundle {
7513 _marker: ZombieHorse,
7514 parent: AbstractHorseMetadataBundle,
7515}
7516impl Default for ZombieHorseMetadataBundle {
7517 fn default() -> Self {
7518 Self {
7519 _marker: ZombieHorse,
7520 parent: Default::default(),
7521 }
7522 }
7523}
7524
7525#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7527pub struct Chest(pub bool);
7528#[derive(Component)]
7558pub struct AbstractChestedHorse;
7559impl AbstractChestedHorse {
7560 fn apply_metadata(
7561 entity: &mut bevy_ecs::system::EntityCommands,
7562 d: EntityDataItem,
7563 ) -> Result<(), UpdateMetadataError> {
7564 match d.index {
7565 0..=18 => AbstractHorse::apply_metadata(entity, d)?,
7566 19 => {
7567 entity.insert(Chest(
7568 d.value.into_boolean().map_err(|v| e(v, d.index, "Chest"))?,
7569 ));
7570 }
7571 _ => {}
7572 }
7573 Ok(())
7574 }
7575}
7576
7577#[derive(Bundle)]
7581pub struct AbstractChestedHorseMetadataBundle {
7582 _marker: AbstractChestedHorse,
7583 parent: AbstractHorseMetadataBundle,
7584 chest: Chest,
7585}
7586impl Default for AbstractChestedHorseMetadataBundle {
7587 fn default() -> Self {
7588 Self {
7589 _marker: AbstractChestedHorse,
7590 parent: Default::default(),
7591 chest: Chest(false),
7592 }
7593 }
7594}
7595
7596#[derive(Component)]
7621pub struct Donkey;
7622impl Donkey {
7623 fn apply_metadata(
7624 entity: &mut bevy_ecs::system::EntityCommands,
7625 d: EntityDataItem,
7626 ) -> Result<(), UpdateMetadataError> {
7627 match d.index {
7628 0..=19 => AbstractChestedHorse::apply_metadata(entity, d)?,
7629 _ => {}
7630 }
7631 Ok(())
7632 }
7633}
7634
7635#[derive(Bundle)]
7639pub struct DonkeyMetadataBundle {
7640 _marker: Donkey,
7641 parent: AbstractChestedHorseMetadataBundle,
7642}
7643impl Default for DonkeyMetadataBundle {
7644 fn default() -> Self {
7645 Self {
7646 _marker: Donkey,
7647 parent: Default::default(),
7648 }
7649 }
7650}
7651
7652#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7654pub struct Strength(pub i32);
7655#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7657pub struct LlamaVariant(pub i32);
7658#[derive(Component)]
7686pub struct Llama;
7687impl Llama {
7688 fn apply_metadata(
7689 entity: &mut bevy_ecs::system::EntityCommands,
7690 d: EntityDataItem,
7691 ) -> Result<(), UpdateMetadataError> {
7692 match d.index {
7693 0..=19 => AbstractChestedHorse::apply_metadata(entity, d)?,
7694 20 => {
7695 entity.insert(Strength(
7696 d.value.into_int().map_err(|v| e(v, d.index, "Strength"))?,
7697 ));
7698 }
7699 21 => {
7700 entity.insert(LlamaVariant(
7701 d.value
7702 .into_int()
7703 .map_err(|v| e(v, d.index, "LlamaVariant"))?,
7704 ));
7705 }
7706 _ => {}
7707 }
7708 Ok(())
7709 }
7710}
7711
7712#[derive(Bundle)]
7716pub struct LlamaMetadataBundle {
7717 _marker: Llama,
7718 parent: AbstractChestedHorseMetadataBundle,
7719 strength: Strength,
7720 llama_variant: LlamaVariant,
7721}
7722impl Default for LlamaMetadataBundle {
7723 fn default() -> Self {
7724 Self {
7725 _marker: Llama,
7726 parent: Default::default(),
7727 strength: Strength(0),
7728 llama_variant: LlamaVariant(0),
7729 }
7730 }
7731}
7732
7733#[derive(Component)]
7759pub struct TraderLlama;
7760impl TraderLlama {
7761 fn apply_metadata(
7762 entity: &mut bevy_ecs::system::EntityCommands,
7763 d: EntityDataItem,
7764 ) -> Result<(), UpdateMetadataError> {
7765 match d.index {
7766 0..=21 => Llama::apply_metadata(entity, d)?,
7767 _ => {}
7768 }
7769 Ok(())
7770 }
7771}
7772
7773#[derive(Bundle)]
7777pub struct TraderLlamaMetadataBundle {
7778 _marker: TraderLlama,
7779 parent: LlamaMetadataBundle,
7780}
7781impl Default for TraderLlamaMetadataBundle {
7782 fn default() -> Self {
7783 Self {
7784 _marker: TraderLlama,
7785 parent: Default::default(),
7786 }
7787 }
7788}
7789
7790#[derive(Component)]
7815pub struct Mule;
7816impl Mule {
7817 fn apply_metadata(
7818 entity: &mut bevy_ecs::system::EntityCommands,
7819 d: EntityDataItem,
7820 ) -> Result<(), UpdateMetadataError> {
7821 match d.index {
7822 0..=19 => AbstractChestedHorse::apply_metadata(entity, d)?,
7823 _ => {}
7824 }
7825 Ok(())
7826 }
7827}
7828
7829#[derive(Bundle)]
7833pub struct MuleMetadataBundle {
7834 _marker: Mule,
7835 parent: AbstractChestedHorseMetadataBundle,
7836}
7837impl Default for MuleMetadataBundle {
7838 fn default() -> Self {
7839 Self {
7840 _marker: Mule,
7841 parent: Default::default(),
7842 }
7843 }
7844}
7845
7846#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
7847pub struct Tame(pub bool);
7849#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
7850pub struct InSittingPose(pub bool);
7852#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7854pub struct Owneruuid(pub Option<Uuid>);
7855#[derive(Component)]
7888pub struct AbstractTameable;
7889impl AbstractTameable {
7890 fn apply_metadata(
7891 entity: &mut bevy_ecs::system::EntityCommands,
7892 d: EntityDataItem,
7893 ) -> Result<(), UpdateMetadataError> {
7894 match d.index {
7895 0..=17 => AbstractAnimal::apply_metadata(entity, d)?,
7896 18 => {
7897 let bitfield = d
7898 .value
7899 .into_byte()
7900 .map_err(|v| e(v, d.index, "<bitfield>"))?;
7901 entity.insert(Tame(bitfield & 0x4 != 0));
7902 entity.insert(InSittingPose(bitfield & 0x1 != 0));
7903 }
7904 19 => {
7905 entity.insert(Owneruuid(
7906 d.value
7907 .into_optional_living_entity_reference()
7908 .map_err(|v| e(v, d.index, "Owneruuid"))?,
7909 ));
7910 }
7911 _ => {}
7912 }
7913 Ok(())
7914 }
7915}
7916
7917#[derive(Bundle)]
7921pub struct AbstractTameableMetadataBundle {
7922 _marker: AbstractTameable,
7923 parent: AbstractAnimalMetadataBundle,
7924 tame: Tame,
7925 in_sitting_pose: InSittingPose,
7926 owneruuid: Owneruuid,
7927}
7928impl Default for AbstractTameableMetadataBundle {
7929 fn default() -> Self {
7930 Self {
7931 _marker: AbstractTameable,
7932 parent: Default::default(),
7933 tame: Tame(false),
7934 in_sitting_pose: InSittingPose(false),
7935 owneruuid: Owneruuid(None),
7936 }
7937 }
7938}
7939
7940#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7942pub struct CatVariant(pub azalea_registry::data::CatVariant);
7943#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7945pub struct IsLying(pub bool);
7946#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7948pub struct RelaxStateOne(pub bool);
7949#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7951pub struct CatCollarColor(pub i32);
7952#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
7954pub struct CatSoundVariant(pub azalea_registry::data::CatSoundVariant);
7955#[derive(Component)]
7985pub struct Cat;
7986impl Cat {
7987 fn apply_metadata(
7988 entity: &mut bevy_ecs::system::EntityCommands,
7989 d: EntityDataItem,
7990 ) -> Result<(), UpdateMetadataError> {
7991 match d.index {
7992 0..=19 => AbstractTameable::apply_metadata(entity, d)?,
7993 20 => {
7994 entity.insert(CatVariant(
7995 d.value
7996 .into_cat_variant()
7997 .map_err(|v| e(v, d.index, "CatVariant"))?,
7998 ));
7999 }
8000 21 => {
8001 entity.insert(IsLying(
8002 d.value
8003 .into_boolean()
8004 .map_err(|v| e(v, d.index, "IsLying"))?,
8005 ));
8006 }
8007 22 => {
8008 entity.insert(RelaxStateOne(
8009 d.value
8010 .into_boolean()
8011 .map_err(|v| e(v, d.index, "RelaxStateOne"))?,
8012 ));
8013 }
8014 23 => {
8015 entity.insert(CatCollarColor(
8016 d.value
8017 .into_int()
8018 .map_err(|v| e(v, d.index, "CatCollarColor"))?,
8019 ));
8020 }
8021 24 => {
8022 entity.insert(CatSoundVariant(
8023 d.value
8024 .into_cat_sound_variant()
8025 .map_err(|v| e(v, d.index, "CatSoundVariant"))?,
8026 ));
8027 }
8028 _ => {}
8029 }
8030 Ok(())
8031 }
8032}
8033
8034#[derive(Bundle)]
8038pub struct CatMetadataBundle {
8039 _marker: Cat,
8040 parent: AbstractTameableMetadataBundle,
8041 cat_variant: CatVariant,
8042 is_lying: IsLying,
8043 relax_state_one: RelaxStateOne,
8044 cat_collar_color: CatCollarColor,
8045 cat_sound_variant: CatSoundVariant,
8046}
8047impl Default for CatMetadataBundle {
8048 fn default() -> Self {
8049 Self {
8050 _marker: Cat,
8051 parent: Default::default(),
8052 cat_variant: CatVariant(azalea_registry::data::CatVariant::default()),
8053 is_lying: IsLying(false),
8054 relax_state_one: RelaxStateOne(false),
8055 cat_collar_color: CatCollarColor(Default::default()),
8056 cat_sound_variant: CatSoundVariant(azalea_registry::data::CatSoundVariant::default()),
8057 }
8058 }
8059}
8060
8061#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8063pub struct ParrotVariant(pub i32);
8064#[derive(Component)]
8090pub struct Parrot;
8091impl Parrot {
8092 fn apply_metadata(
8093 entity: &mut bevy_ecs::system::EntityCommands,
8094 d: EntityDataItem,
8095 ) -> Result<(), UpdateMetadataError> {
8096 match d.index {
8097 0..=19 => AbstractTameable::apply_metadata(entity, d)?,
8098 20 => {
8099 entity.insert(ParrotVariant(
8100 d.value
8101 .into_int()
8102 .map_err(|v| e(v, d.index, "ParrotVariant"))?,
8103 ));
8104 }
8105 _ => {}
8106 }
8107 Ok(())
8108 }
8109}
8110
8111#[derive(Bundle)]
8115pub struct ParrotMetadataBundle {
8116 _marker: Parrot,
8117 parent: AbstractTameableMetadataBundle,
8118 parrot_variant: ParrotVariant,
8119}
8120impl Default for ParrotMetadataBundle {
8121 fn default() -> Self {
8122 Self {
8123 _marker: Parrot,
8124 parent: Default::default(),
8125 parrot_variant: ParrotVariant(Default::default()),
8126 }
8127 }
8128}
8129
8130#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8132pub struct WolfInterested(pub bool);
8133#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8135pub struct WolfCollarColor(pub i32);
8136#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8138pub struct WolfAngerEndTime(pub i64);
8139#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8141pub struct WolfVariant(pub azalea_registry::data::WolfVariant);
8142#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8144pub struct WolfSoundVariant(pub azalea_registry::data::WolfSoundVariant);
8145#[derive(Component)]
8175pub struct Wolf;
8176impl Wolf {
8177 fn apply_metadata(
8178 entity: &mut bevy_ecs::system::EntityCommands,
8179 d: EntityDataItem,
8180 ) -> Result<(), UpdateMetadataError> {
8181 match d.index {
8182 0..=19 => AbstractTameable::apply_metadata(entity, d)?,
8183 20 => {
8184 entity.insert(WolfInterested(
8185 d.value
8186 .into_boolean()
8187 .map_err(|v| e(v, d.index, "WolfInterested"))?,
8188 ));
8189 }
8190 21 => {
8191 entity.insert(WolfCollarColor(
8192 d.value
8193 .into_int()
8194 .map_err(|v| e(v, d.index, "WolfCollarColor"))?,
8195 ));
8196 }
8197 22 => {
8198 entity.insert(WolfAngerEndTime(
8199 d.value
8200 .into_long()
8201 .map_err(|v| e(v, d.index, "WolfAngerEndTime"))?,
8202 ));
8203 }
8204 23 => {
8205 entity.insert(WolfVariant(
8206 d.value
8207 .into_wolf_variant()
8208 .map_err(|v| e(v, d.index, "WolfVariant"))?,
8209 ));
8210 }
8211 24 => {
8212 entity.insert(WolfSoundVariant(
8213 d.value
8214 .into_wolf_sound_variant()
8215 .map_err(|v| e(v, d.index, "WolfSoundVariant"))?,
8216 ));
8217 }
8218 _ => {}
8219 }
8220 Ok(())
8221 }
8222}
8223
8224#[derive(Bundle)]
8228pub struct WolfMetadataBundle {
8229 _marker: Wolf,
8230 parent: AbstractTameableMetadataBundle,
8231 wolf_interested: WolfInterested,
8232 wolf_collar_color: WolfCollarColor,
8233 wolf_anger_end_time: WolfAngerEndTime,
8234 wolf_variant: WolfVariant,
8235 wolf_sound_variant: WolfSoundVariant,
8236}
8237impl Default for WolfMetadataBundle {
8238 fn default() -> Self {
8239 Self {
8240 _marker: Wolf,
8241 parent: Default::default(),
8242 wolf_interested: WolfInterested(false),
8243 wolf_collar_color: WolfCollarColor(Default::default()),
8244 wolf_anger_end_time: WolfAngerEndTime(-1),
8245 wolf_variant: WolfVariant(azalea_registry::data::WolfVariant::default()),
8246 wolf_sound_variant: WolfSoundVariant(azalea_registry::data::WolfSoundVariant::default()),
8247 }
8248 }
8249}
8250
8251#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8253pub struct AbstractNautilusDash(pub bool);
8254#[derive(Component)]
8282pub struct AbstractNautilus;
8283impl AbstractNautilus {
8284 fn apply_metadata(
8285 entity: &mut bevy_ecs::system::EntityCommands,
8286 d: EntityDataItem,
8287 ) -> Result<(), UpdateMetadataError> {
8288 match d.index {
8289 0..=19 => AbstractTameable::apply_metadata(entity, d)?,
8290 20 => {
8291 entity.insert(AbstractNautilusDash(
8292 d.value
8293 .into_boolean()
8294 .map_err(|v| e(v, d.index, "AbstractNautilusDash"))?,
8295 ));
8296 }
8297 _ => {}
8298 }
8299 Ok(())
8300 }
8301}
8302
8303#[derive(Bundle)]
8307pub struct AbstractNautilusMetadataBundle {
8308 _marker: AbstractNautilus,
8309 parent: AbstractTameableMetadataBundle,
8310 abstract_nautilus_dash: AbstractNautilusDash,
8311}
8312impl Default for AbstractNautilusMetadataBundle {
8313 fn default() -> Self {
8314 Self {
8315 _marker: AbstractNautilus,
8316 parent: Default::default(),
8317 abstract_nautilus_dash: AbstractNautilusDash(false),
8318 }
8319 }
8320}
8321
8322#[derive(Component)]
8347pub struct Nautilus;
8348impl Nautilus {
8349 fn apply_metadata(
8350 entity: &mut bevy_ecs::system::EntityCommands,
8351 d: EntityDataItem,
8352 ) -> Result<(), UpdateMetadataError> {
8353 match d.index {
8354 0..=20 => AbstractNautilus::apply_metadata(entity, d)?,
8355 _ => {}
8356 }
8357 Ok(())
8358 }
8359}
8360
8361#[derive(Bundle)]
8365pub struct NautilusMetadataBundle {
8366 _marker: Nautilus,
8367 parent: AbstractNautilusMetadataBundle,
8368}
8369impl Default for NautilusMetadataBundle {
8370 fn default() -> Self {
8371 Self {
8372 _marker: Nautilus,
8373 parent: Default::default(),
8374 }
8375 }
8376}
8377
8378#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8380pub struct ZombieNautilusVariant(pub azalea_registry::data::ZombieNautilusVariant);
8381#[derive(Component)]
8409pub struct ZombieNautilus;
8410impl ZombieNautilus {
8411 fn apply_metadata(
8412 entity: &mut bevy_ecs::system::EntityCommands,
8413 d: EntityDataItem,
8414 ) -> Result<(), UpdateMetadataError> {
8415 match d.index {
8416 0..=20 => AbstractNautilus::apply_metadata(entity, d)?,
8417 21 => {
8418 entity.insert(ZombieNautilusVariant(
8419 d.value
8420 .into_zombie_nautilus_variant()
8421 .map_err(|v| e(v, d.index, "ZombieNautilusVariant"))?,
8422 ));
8423 }
8424 _ => {}
8425 }
8426 Ok(())
8427 }
8428}
8429
8430#[derive(Bundle)]
8434pub struct ZombieNautilusMetadataBundle {
8435 _marker: ZombieNautilus,
8436 parent: AbstractNautilusMetadataBundle,
8437 zombie_nautilus_variant: ZombieNautilusVariant,
8438}
8439impl Default for ZombieNautilusMetadataBundle {
8440 fn default() -> Self {
8441 Self {
8442 _marker: ZombieNautilus,
8443 parent: Default::default(),
8444 zombie_nautilus_variant: ZombieNautilusVariant(
8445 azalea_registry::data::ZombieNautilusVariant::default(),
8446 ),
8447 }
8448 }
8449}
8450
8451#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8453pub struct AbstractCubeMobSize(pub i32);
8454#[derive(Component)]
8481pub struct AbstractCubeMob;
8482impl AbstractCubeMob {
8483 fn apply_metadata(
8484 entity: &mut bevy_ecs::system::EntityCommands,
8485 d: EntityDataItem,
8486 ) -> Result<(), UpdateMetadataError> {
8487 match d.index {
8488 0..=17 => AbstractAgeable::apply_metadata(entity, d)?,
8489 18 => {
8490 entity.insert(AbstractCubeMobSize(
8491 d.value
8492 .into_int()
8493 .map_err(|v| e(v, d.index, "AbstractCubeMobSize"))?,
8494 ));
8495 }
8496 _ => {}
8497 }
8498 Ok(())
8499 }
8500}
8501
8502#[derive(Bundle)]
8506pub struct AbstractCubeMobMetadataBundle {
8507 _marker: AbstractCubeMob,
8508 parent: AbstractAgeableMetadataBundle,
8509 abstract_cube_mob_size: AbstractCubeMobSize,
8510}
8511impl Default for AbstractCubeMobMetadataBundle {
8512 fn default() -> Self {
8513 Self {
8514 _marker: AbstractCubeMob,
8515 parent: Default::default(),
8516 abstract_cube_mob_size: AbstractCubeMobSize(1),
8517 }
8518 }
8519}
8520
8521#[derive(Component)]
8544pub struct MagmaCube;
8545impl MagmaCube {
8546 fn apply_metadata(
8547 entity: &mut bevy_ecs::system::EntityCommands,
8548 d: EntityDataItem,
8549 ) -> Result<(), UpdateMetadataError> {
8550 match d.index {
8551 0..=18 => AbstractCubeMob::apply_metadata(entity, d)?,
8552 _ => {}
8553 }
8554 Ok(())
8555 }
8556}
8557
8558#[derive(Bundle)]
8562pub struct MagmaCubeMetadataBundle {
8563 _marker: MagmaCube,
8564 parent: AbstractCubeMobMetadataBundle,
8565}
8566impl Default for MagmaCubeMetadataBundle {
8567 fn default() -> Self {
8568 Self {
8569 _marker: MagmaCube,
8570 parent: Default::default(),
8571 }
8572 }
8573}
8574
8575#[derive(Component)]
8598pub struct Slime;
8599impl Slime {
8600 fn apply_metadata(
8601 entity: &mut bevy_ecs::system::EntityCommands,
8602 d: EntityDataItem,
8603 ) -> Result<(), UpdateMetadataError> {
8604 match d.index {
8605 0..=18 => AbstractCubeMob::apply_metadata(entity, d)?,
8606 _ => {}
8607 }
8608 Ok(())
8609 }
8610}
8611
8612#[derive(Bundle)]
8616pub struct SlimeMetadataBundle {
8617 _marker: Slime,
8618 parent: AbstractCubeMobMetadataBundle,
8619}
8620impl Default for SlimeMetadataBundle {
8621 fn default() -> Self {
8622 Self {
8623 _marker: Slime,
8624 parent: Default::default(),
8625 }
8626 }
8627}
8628
8629#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8631pub struct MaxFuse(pub i32);
8632#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8634pub struct SulfurCubeFromBucket(pub bool);
8635#[derive(Component)]
8662pub struct SulfurCube;
8663impl SulfurCube {
8664 fn apply_metadata(
8665 entity: &mut bevy_ecs::system::EntityCommands,
8666 d: EntityDataItem,
8667 ) -> Result<(), UpdateMetadataError> {
8668 match d.index {
8669 0..=18 => AbstractCubeMob::apply_metadata(entity, d)?,
8670 19 => {
8671 entity.insert(MaxFuse(
8672 d.value.into_int().map_err(|v| e(v, d.index, "MaxFuse"))?,
8673 ));
8674 }
8675 20 => {
8676 entity.insert(SulfurCubeFromBucket(
8677 d.value
8678 .into_boolean()
8679 .map_err(|v| e(v, d.index, "SulfurCubeFromBucket"))?,
8680 ));
8681 }
8682 _ => {}
8683 }
8684 Ok(())
8685 }
8686}
8687
8688#[derive(Bundle)]
8692pub struct SulfurCubeMetadataBundle {
8693 _marker: SulfurCube,
8694 parent: AbstractCubeMobMetadataBundle,
8695 max_fuse: MaxFuse,
8696 sulfur_cube_from_bucket: SulfurCubeFromBucket,
8697}
8698impl Default for SulfurCubeMetadataBundle {
8699 fn default() -> Self {
8700 Self {
8701 _marker: SulfurCube,
8702 parent: Default::default(),
8703 max_fuse: MaxFuse(-1),
8704 sulfur_cube_from_bucket: SulfurCubeFromBucket(false),
8705 }
8706 }
8707}
8708
8709#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8711pub struct AbstractVillagerUnhappyCounter(pub i32);
8712#[derive(Component)]
8738pub struct AbstractVillager;
8739impl AbstractVillager {
8740 fn apply_metadata(
8741 entity: &mut bevy_ecs::system::EntityCommands,
8742 d: EntityDataItem,
8743 ) -> Result<(), UpdateMetadataError> {
8744 match d.index {
8745 0..=17 => AbstractAgeable::apply_metadata(entity, d)?,
8746 18 => {
8747 entity.insert(AbstractVillagerUnhappyCounter(
8748 d.value
8749 .into_int()
8750 .map_err(|v| e(v, d.index, "AbstractVillagerUnhappyCounter"))?,
8751 ));
8752 }
8753 _ => {}
8754 }
8755 Ok(())
8756 }
8757}
8758
8759#[derive(Bundle)]
8763pub struct AbstractVillagerMetadataBundle {
8764 _marker: AbstractVillager,
8765 parent: AbstractAgeableMetadataBundle,
8766 abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter,
8767}
8768impl Default for AbstractVillagerMetadataBundle {
8769 fn default() -> Self {
8770 Self {
8771 _marker: AbstractVillager,
8772 parent: Default::default(),
8773 abstract_villager_unhappy_counter: AbstractVillagerUnhappyCounter(0),
8774 }
8775 }
8776}
8777
8778#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8780pub struct VillagerVillagerData(pub VillagerData);
8781#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8783pub struct VillagerVillagerDataFinalized(pub bool);
8784#[derive(Component)]
8811pub struct Villager;
8812impl Villager {
8813 fn apply_metadata(
8814 entity: &mut bevy_ecs::system::EntityCommands,
8815 d: EntityDataItem,
8816 ) -> Result<(), UpdateMetadataError> {
8817 match d.index {
8818 0..=18 => AbstractVillager::apply_metadata(entity, d)?,
8819 19 => {
8820 entity.insert(VillagerVillagerData(
8821 d.value
8822 .into_villager_data()
8823 .map_err(|v| e(v, d.index, "VillagerVillagerData"))?,
8824 ));
8825 }
8826 20 => {
8827 entity.insert(VillagerVillagerDataFinalized(
8828 d.value
8829 .into_boolean()
8830 .map_err(|v| e(v, d.index, "VillagerVillagerDataFinalized"))?,
8831 ));
8832 }
8833 _ => {}
8834 }
8835 Ok(())
8836 }
8837}
8838
8839#[derive(Bundle)]
8843pub struct VillagerMetadataBundle {
8844 _marker: Villager,
8845 parent: AbstractVillagerMetadataBundle,
8846 villager_villager_data: VillagerVillagerData,
8847 villager_villager_data_finalized: VillagerVillagerDataFinalized,
8848}
8849impl Default for VillagerMetadataBundle {
8850 fn default() -> Self {
8851 Self {
8852 _marker: Villager,
8853 parent: Default::default(),
8854 villager_villager_data: VillagerVillagerData(VillagerData {
8855 kind: azalea_registry::builtin::VillagerKind::Plains,
8856 profession: azalea_registry::builtin::VillagerProfession::None,
8857 level: 0,
8858 }),
8859 villager_villager_data_finalized: VillagerVillagerDataFinalized(false),
8860 }
8861 }
8862}
8863
8864#[derive(Component)]
8887pub struct WanderingTrader;
8888impl WanderingTrader {
8889 fn apply_metadata(
8890 entity: &mut bevy_ecs::system::EntityCommands,
8891 d: EntityDataItem,
8892 ) -> Result<(), UpdateMetadataError> {
8893 match d.index {
8894 0..=18 => AbstractVillager::apply_metadata(entity, d)?,
8895 _ => {}
8896 }
8897 Ok(())
8898 }
8899}
8900
8901#[derive(Bundle)]
8905pub struct WanderingTraderMetadataBundle {
8906 _marker: WanderingTrader,
8907 parent: AbstractVillagerMetadataBundle,
8908}
8909impl Default for WanderingTraderMetadataBundle {
8910 fn default() -> Self {
8911 Self {
8912 _marker: WanderingTrader,
8913 parent: Default::default(),
8914 }
8915 }
8916}
8917
8918#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
8920pub struct AbstractFishFromBucket(pub bool);
8921#[derive(Component)]
8947pub struct AbstractFish;
8948impl AbstractFish {
8949 fn apply_metadata(
8950 entity: &mut bevy_ecs::system::EntityCommands,
8951 d: EntityDataItem,
8952 ) -> Result<(), UpdateMetadataError> {
8953 match d.index {
8954 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
8955 16 => {
8956 entity.insert(AbstractFishFromBucket(
8957 d.value
8958 .into_boolean()
8959 .map_err(|v| e(v, d.index, "AbstractFishFromBucket"))?,
8960 ));
8961 }
8962 _ => {}
8963 }
8964 Ok(())
8965 }
8966}
8967
8968#[derive(Bundle)]
8972pub struct AbstractFishMetadataBundle {
8973 _marker: AbstractFish,
8974 parent: AbstractCreatureMetadataBundle,
8975 abstract_fish_from_bucket: AbstractFishFromBucket,
8976}
8977impl Default for AbstractFishMetadataBundle {
8978 fn default() -> Self {
8979 Self {
8980 _marker: AbstractFish,
8981 parent: Default::default(),
8982 abstract_fish_from_bucket: AbstractFishFromBucket(false),
8983 }
8984 }
8985}
8986
8987#[derive(Component)]
9009pub struct Cod;
9010impl Cod {
9011 fn apply_metadata(
9012 entity: &mut bevy_ecs::system::EntityCommands,
9013 d: EntityDataItem,
9014 ) -> Result<(), UpdateMetadataError> {
9015 match d.index {
9016 0..=16 => AbstractFish::apply_metadata(entity, d)?,
9017 _ => {}
9018 }
9019 Ok(())
9020 }
9021}
9022
9023#[derive(Bundle)]
9027pub struct CodMetadataBundle {
9028 _marker: Cod,
9029 parent: AbstractFishMetadataBundle,
9030}
9031impl Default for CodMetadataBundle {
9032 fn default() -> Self {
9033 Self {
9034 _marker: Cod,
9035 parent: Default::default(),
9036 }
9037 }
9038}
9039
9040#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9042pub struct SalmonKind(pub i32);
9043#[derive(Component)]
9067pub struct Salmon;
9068impl Salmon {
9069 fn apply_metadata(
9070 entity: &mut bevy_ecs::system::EntityCommands,
9071 d: EntityDataItem,
9072 ) -> Result<(), UpdateMetadataError> {
9073 match d.index {
9074 0..=16 => AbstractFish::apply_metadata(entity, d)?,
9075 17 => {
9076 entity.insert(SalmonKind(
9077 d.value
9078 .into_int()
9079 .map_err(|v| e(v, d.index, "SalmonKind"))?,
9080 ));
9081 }
9082 _ => {}
9083 }
9084 Ok(())
9085 }
9086}
9087
9088#[derive(Bundle)]
9092pub struct SalmonMetadataBundle {
9093 _marker: Salmon,
9094 parent: AbstractFishMetadataBundle,
9095 salmon_kind: SalmonKind,
9096}
9097impl Default for SalmonMetadataBundle {
9098 fn default() -> Self {
9099 Self {
9100 _marker: Salmon,
9101 parent: Default::default(),
9102 salmon_kind: SalmonKind(Default::default()),
9103 }
9104 }
9105}
9106
9107#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9109pub struct TropicalFishTypeVariant(pub i32);
9110#[derive(Component)]
9135pub struct TropicalFish;
9136impl TropicalFish {
9137 fn apply_metadata(
9138 entity: &mut bevy_ecs::system::EntityCommands,
9139 d: EntityDataItem,
9140 ) -> Result<(), UpdateMetadataError> {
9141 match d.index {
9142 0..=16 => AbstractFish::apply_metadata(entity, d)?,
9143 17 => {
9144 entity.insert(TropicalFishTypeVariant(
9145 d.value
9146 .into_int()
9147 .map_err(|v| e(v, d.index, "TropicalFishTypeVariant"))?,
9148 ));
9149 }
9150 _ => {}
9151 }
9152 Ok(())
9153 }
9154}
9155
9156#[derive(Bundle)]
9160pub struct TropicalFishMetadataBundle {
9161 _marker: TropicalFish,
9162 parent: AbstractFishMetadataBundle,
9163 tropical_fish_type_variant: TropicalFishTypeVariant,
9164}
9165impl Default for TropicalFishMetadataBundle {
9166 fn default() -> Self {
9167 Self {
9168 _marker: TropicalFish,
9169 parent: Default::default(),
9170 tropical_fish_type_variant: TropicalFishTypeVariant(Default::default()),
9171 }
9172 }
9173}
9174
9175#[derive(Component)]
9232pub struct AbstractMonster;
9233impl AbstractMonster {
9234 fn apply_metadata(
9235 entity: &mut bevy_ecs::system::EntityCommands,
9236 d: EntityDataItem,
9237 ) -> Result<(), UpdateMetadataError> {
9238 match d.index {
9239 0..=15 => AbstractCreature::apply_metadata(entity, d)?,
9240 _ => {}
9241 }
9242 Ok(())
9243 }
9244}
9245
9246#[derive(Bundle)]
9250pub struct AbstractMonsterMetadataBundle {
9251 _marker: AbstractMonster,
9252 parent: AbstractCreatureMetadataBundle,
9253}
9254impl Default for AbstractMonsterMetadataBundle {
9255 fn default() -> Self {
9256 Self {
9257 _marker: AbstractMonster,
9258 parent: Default::default(),
9259 }
9260 }
9261}
9262
9263#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
9264pub struct Charged(pub bool);
9266#[derive(Component)]
9290pub struct Blaze;
9291impl Blaze {
9292 fn apply_metadata(
9293 entity: &mut bevy_ecs::system::EntityCommands,
9294 d: EntityDataItem,
9295 ) -> Result<(), UpdateMetadataError> {
9296 match d.index {
9297 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9298 16 => {
9299 let bitfield = d
9300 .value
9301 .into_byte()
9302 .map_err(|v| e(v, d.index, "<bitfield>"))?;
9303 entity.insert(Charged(bitfield & 0x1 != 0));
9304 }
9305 _ => {}
9306 }
9307 Ok(())
9308 }
9309}
9310
9311#[derive(Bundle)]
9315pub struct BlazeMetadataBundle {
9316 _marker: Blaze,
9317 parent: AbstractMonsterMetadataBundle,
9318 charged: Charged,
9319}
9320impl Default for BlazeMetadataBundle {
9321 fn default() -> Self {
9322 Self {
9323 _marker: Blaze,
9324 parent: Default::default(),
9325 charged: Charged(false),
9326 }
9327 }
9328}
9329
9330#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9332pub struct BoggedSheared(pub bool);
9333#[derive(Component)]
9357pub struct Bogged;
9358impl Bogged {
9359 fn apply_metadata(
9360 entity: &mut bevy_ecs::system::EntityCommands,
9361 d: EntityDataItem,
9362 ) -> Result<(), UpdateMetadataError> {
9363 match d.index {
9364 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9365 16 => {
9366 entity.insert(BoggedSheared(
9367 d.value
9368 .into_boolean()
9369 .map_err(|v| e(v, d.index, "BoggedSheared"))?,
9370 ));
9371 }
9372 _ => {}
9373 }
9374 Ok(())
9375 }
9376}
9377
9378#[derive(Bundle)]
9382pub struct BoggedMetadataBundle {
9383 _marker: Bogged,
9384 parent: AbstractMonsterMetadataBundle,
9385 bogged_sheared: BoggedSheared,
9386}
9387impl Default for BoggedMetadataBundle {
9388 fn default() -> Self {
9389 Self {
9390 _marker: Bogged,
9391 parent: Default::default(),
9392 bogged_sheared: BoggedSheared(false),
9393 }
9394 }
9395}
9396
9397#[derive(Component)]
9419pub struct Breeze;
9420impl Breeze {
9421 fn apply_metadata(
9422 entity: &mut bevy_ecs::system::EntityCommands,
9423 d: EntityDataItem,
9424 ) -> Result<(), UpdateMetadataError> {
9425 match d.index {
9426 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9427 _ => {}
9428 }
9429 Ok(())
9430 }
9431}
9432
9433#[derive(Bundle)]
9437pub struct BreezeMetadataBundle {
9438 _marker: Breeze,
9439 parent: AbstractMonsterMetadataBundle,
9440}
9441impl Default for BreezeMetadataBundle {
9442 fn default() -> Self {
9443 Self {
9444 _marker: Breeze,
9445 parent: Default::default(),
9446 }
9447 }
9448}
9449
9450#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9452pub struct CanMove(pub bool);
9453#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9455pub struct IsActive(pub bool);
9456#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9458pub struct IsTearingDown(pub bool);
9459#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9461pub struct HomePos(pub Option<BlockPos>);
9462#[derive(Component)]
9490pub struct Creaking;
9491impl Creaking {
9492 fn apply_metadata(
9493 entity: &mut bevy_ecs::system::EntityCommands,
9494 d: EntityDataItem,
9495 ) -> Result<(), UpdateMetadataError> {
9496 match d.index {
9497 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9498 16 => {
9499 entity.insert(CanMove(
9500 d.value
9501 .into_boolean()
9502 .map_err(|v| e(v, d.index, "CanMove"))?,
9503 ));
9504 }
9505 17 => {
9506 entity.insert(IsActive(
9507 d.value
9508 .into_boolean()
9509 .map_err(|v| e(v, d.index, "IsActive"))?,
9510 ));
9511 }
9512 18 => {
9513 entity.insert(IsTearingDown(
9514 d.value
9515 .into_boolean()
9516 .map_err(|v| e(v, d.index, "IsTearingDown"))?,
9517 ));
9518 }
9519 19 => {
9520 entity.insert(HomePos(
9521 d.value
9522 .into_optional_block_pos()
9523 .map_err(|v| e(v, d.index, "HomePos"))?,
9524 ));
9525 }
9526 _ => {}
9527 }
9528 Ok(())
9529 }
9530}
9531
9532#[derive(Bundle)]
9536pub struct CreakingMetadataBundle {
9537 _marker: Creaking,
9538 parent: AbstractMonsterMetadataBundle,
9539 can_move: CanMove,
9540 is_active: IsActive,
9541 is_tearing_down: IsTearingDown,
9542 home_pos: HomePos,
9543}
9544impl Default for CreakingMetadataBundle {
9545 fn default() -> Self {
9546 Self {
9547 _marker: Creaking,
9548 parent: Default::default(),
9549 can_move: CanMove(true),
9550 is_active: IsActive(false),
9551 is_tearing_down: IsTearingDown(false),
9552 home_pos: HomePos(None),
9553 }
9554 }
9555}
9556
9557#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9559pub struct SwellDir(pub i32);
9560#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9562pub struct IsPowered(pub bool);
9563#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9565pub struct IsIgnited(pub bool);
9566#[derive(Component)]
9592pub struct Creeper;
9593impl Creeper {
9594 fn apply_metadata(
9595 entity: &mut bevy_ecs::system::EntityCommands,
9596 d: EntityDataItem,
9597 ) -> Result<(), UpdateMetadataError> {
9598 match d.index {
9599 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9600 16 => {
9601 entity.insert(SwellDir(
9602 d.value.into_int().map_err(|v| e(v, d.index, "SwellDir"))?,
9603 ));
9604 }
9605 17 => {
9606 entity.insert(IsPowered(
9607 d.value
9608 .into_boolean()
9609 .map_err(|v| e(v, d.index, "IsPowered"))?,
9610 ));
9611 }
9612 18 => {
9613 entity.insert(IsIgnited(
9614 d.value
9615 .into_boolean()
9616 .map_err(|v| e(v, d.index, "IsIgnited"))?,
9617 ));
9618 }
9619 _ => {}
9620 }
9621 Ok(())
9622 }
9623}
9624
9625#[derive(Bundle)]
9629pub struct CreeperMetadataBundle {
9630 _marker: Creeper,
9631 parent: AbstractMonsterMetadataBundle,
9632 swell_dir: SwellDir,
9633 is_powered: IsPowered,
9634 is_ignited: IsIgnited,
9635}
9636impl Default for CreeperMetadataBundle {
9637 fn default() -> Self {
9638 Self {
9639 _marker: Creeper,
9640 parent: Default::default(),
9641 swell_dir: SwellDir(-1),
9642 is_powered: IsPowered(false),
9643 is_ignited: IsIgnited(false),
9644 }
9645 }
9646}
9647
9648#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9650pub struct CarryState(pub azalea_block::BlockState);
9651#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9653pub struct Creepy(pub bool);
9654#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9656pub struct StaredAt(pub bool);
9657#[derive(Component)]
9684pub struct Enderman;
9685impl Enderman {
9686 fn apply_metadata(
9687 entity: &mut bevy_ecs::system::EntityCommands,
9688 d: EntityDataItem,
9689 ) -> Result<(), UpdateMetadataError> {
9690 match d.index {
9691 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9692 16 => {
9693 entity.insert(CarryState(
9694 d.value
9695 .into_optional_block_state()
9696 .map_err(|v| e(v, d.index, "CarryState"))?,
9697 ));
9698 }
9699 17 => {
9700 entity.insert(Creepy(
9701 d.value
9702 .into_boolean()
9703 .map_err(|v| e(v, d.index, "Creepy"))?,
9704 ));
9705 }
9706 18 => {
9707 entity.insert(StaredAt(
9708 d.value
9709 .into_boolean()
9710 .map_err(|v| e(v, d.index, "StaredAt"))?,
9711 ));
9712 }
9713 _ => {}
9714 }
9715 Ok(())
9716 }
9717}
9718
9719#[derive(Bundle)]
9723pub struct EndermanMetadataBundle {
9724 _marker: Enderman,
9725 parent: AbstractMonsterMetadataBundle,
9726 carry_state: CarryState,
9727 creepy: Creepy,
9728 stared_at: StaredAt,
9729}
9730impl Default for EndermanMetadataBundle {
9731 fn default() -> Self {
9732 Self {
9733 _marker: Enderman,
9734 parent: Default::default(),
9735 carry_state: CarryState(azalea_block::BlockState::AIR),
9736 creepy: Creepy(false),
9737 stared_at: StaredAt(false),
9738 }
9739 }
9740}
9741
9742#[derive(Component)]
9764pub struct Endermite;
9765impl Endermite {
9766 fn apply_metadata(
9767 entity: &mut bevy_ecs::system::EntityCommands,
9768 d: EntityDataItem,
9769 ) -> Result<(), UpdateMetadataError> {
9770 match d.index {
9771 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9772 _ => {}
9773 }
9774 Ok(())
9775 }
9776}
9777
9778#[derive(Bundle)]
9782pub struct EndermiteMetadataBundle {
9783 _marker: Endermite,
9784 parent: AbstractMonsterMetadataBundle,
9785}
9786impl Default for EndermiteMetadataBundle {
9787 fn default() -> Self {
9788 Self {
9789 _marker: Endermite,
9790 parent: Default::default(),
9791 }
9792 }
9793}
9794
9795#[derive(Component)]
9817pub struct Giant;
9818impl Giant {
9819 fn apply_metadata(
9820 entity: &mut bevy_ecs::system::EntityCommands,
9821 d: EntityDataItem,
9822 ) -> Result<(), UpdateMetadataError> {
9823 match d.index {
9824 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9825 _ => {}
9826 }
9827 Ok(())
9828 }
9829}
9830
9831#[derive(Bundle)]
9835pub struct GiantMetadataBundle {
9836 _marker: Giant,
9837 parent: AbstractMonsterMetadataBundle,
9838}
9839impl Default for GiantMetadataBundle {
9840 fn default() -> Self {
9841 Self {
9842 _marker: Giant,
9843 parent: Default::default(),
9844 }
9845 }
9846}
9847
9848#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9850pub struct Moving(pub bool);
9851#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
9853pub struct AttackTarget(pub i32);
9854#[derive(Component)]
9880pub struct Guardian;
9881impl Guardian {
9882 fn apply_metadata(
9883 entity: &mut bevy_ecs::system::EntityCommands,
9884 d: EntityDataItem,
9885 ) -> Result<(), UpdateMetadataError> {
9886 match d.index {
9887 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
9888 16 => {
9889 entity.insert(Moving(
9890 d.value
9891 .into_boolean()
9892 .map_err(|v| e(v, d.index, "Moving"))?,
9893 ));
9894 }
9895 17 => {
9896 entity.insert(AttackTarget(
9897 d.value
9898 .into_int()
9899 .map_err(|v| e(v, d.index, "AttackTarget"))?,
9900 ));
9901 }
9902 _ => {}
9903 }
9904 Ok(())
9905 }
9906}
9907
9908#[derive(Bundle)]
9912pub struct GuardianMetadataBundle {
9913 _marker: Guardian,
9914 parent: AbstractMonsterMetadataBundle,
9915 moving: Moving,
9916 attack_target: AttackTarget,
9917}
9918impl Default for GuardianMetadataBundle {
9919 fn default() -> Self {
9920 Self {
9921 _marker: Guardian,
9922 parent: Default::default(),
9923 moving: Moving(false),
9924 attack_target: AttackTarget(0),
9925 }
9926 }
9927}
9928
9929#[derive(Component)]
9952pub struct ElderGuardian;
9953impl ElderGuardian {
9954 fn apply_metadata(
9955 entity: &mut bevy_ecs::system::EntityCommands,
9956 d: EntityDataItem,
9957 ) -> Result<(), UpdateMetadataError> {
9958 match d.index {
9959 0..=17 => Guardian::apply_metadata(entity, d)?,
9960 _ => {}
9961 }
9962 Ok(())
9963 }
9964}
9965
9966#[derive(Bundle)]
9970pub struct ElderGuardianMetadataBundle {
9971 _marker: ElderGuardian,
9972 parent: GuardianMetadataBundle,
9973}
9974impl Default for ElderGuardianMetadataBundle {
9975 fn default() -> Self {
9976 Self {
9977 _marker: ElderGuardian,
9978 parent: Default::default(),
9979 }
9980 }
9981}
9982
9983#[derive(Component)]
10005pub struct Parched;
10006impl Parched {
10007 fn apply_metadata(
10008 entity: &mut bevy_ecs::system::EntityCommands,
10009 d: EntityDataItem,
10010 ) -> Result<(), UpdateMetadataError> {
10011 match d.index {
10012 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
10013 _ => {}
10014 }
10015 Ok(())
10016 }
10017}
10018
10019#[derive(Bundle)]
10023pub struct ParchedMetadataBundle {
10024 _marker: Parched,
10025 parent: AbstractMonsterMetadataBundle,
10026}
10027impl Default for ParchedMetadataBundle {
10028 fn default() -> Self {
10029 Self {
10030 _marker: Parched,
10031 parent: Default::default(),
10032 }
10033 }
10034}
10035
10036#[derive(Component)]
10058pub struct Silverfish;
10059impl Silverfish {
10060 fn apply_metadata(
10061 entity: &mut bevy_ecs::system::EntityCommands,
10062 d: EntityDataItem,
10063 ) -> Result<(), UpdateMetadataError> {
10064 match d.index {
10065 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
10066 _ => {}
10067 }
10068 Ok(())
10069 }
10070}
10071
10072#[derive(Bundle)]
10076pub struct SilverfishMetadataBundle {
10077 _marker: Silverfish,
10078 parent: AbstractMonsterMetadataBundle,
10079}
10080impl Default for SilverfishMetadataBundle {
10081 fn default() -> Self {
10082 Self {
10083 _marker: Silverfish,
10084 parent: Default::default(),
10085 }
10086 }
10087}
10088
10089#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10091pub struct StrayConversion(pub bool);
10092#[derive(Component)]
10117pub struct Skeleton;
10118impl Skeleton {
10119 fn apply_metadata(
10120 entity: &mut bevy_ecs::system::EntityCommands,
10121 d: EntityDataItem,
10122 ) -> Result<(), UpdateMetadataError> {
10123 match d.index {
10124 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
10125 16 => {
10126 entity.insert(StrayConversion(
10127 d.value
10128 .into_boolean()
10129 .map_err(|v| e(v, d.index, "StrayConversion"))?,
10130 ));
10131 }
10132 _ => {}
10133 }
10134 Ok(())
10135 }
10136}
10137
10138#[derive(Bundle)]
10142pub struct SkeletonMetadataBundle {
10143 _marker: Skeleton,
10144 parent: AbstractMonsterMetadataBundle,
10145 stray_conversion: StrayConversion,
10146}
10147impl Default for SkeletonMetadataBundle {
10148 fn default() -> Self {
10149 Self {
10150 _marker: Skeleton,
10151 parent: Default::default(),
10152 stray_conversion: StrayConversion(false),
10153 }
10154 }
10155}
10156
10157#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]
10158pub struct Climbing(pub bool);
10160#[derive(Component)]
10184pub struct Spider;
10185impl Spider {
10186 fn apply_metadata(
10187 entity: &mut bevy_ecs::system::EntityCommands,
10188 d: EntityDataItem,
10189 ) -> Result<(), UpdateMetadataError> {
10190 match d.index {
10191 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
10192 16 => {
10193 let bitfield = d
10194 .value
10195 .into_byte()
10196 .map_err(|v| e(v, d.index, "<bitfield>"))?;
10197 entity.insert(Climbing(bitfield & 0x1 != 0));
10198 }
10199 _ => {}
10200 }
10201 Ok(())
10202 }
10203}
10204
10205#[derive(Bundle)]
10209pub struct SpiderMetadataBundle {
10210 _marker: Spider,
10211 parent: AbstractMonsterMetadataBundle,
10212 climbing: Climbing,
10213}
10214impl Default for SpiderMetadataBundle {
10215 fn default() -> Self {
10216 Self {
10217 _marker: Spider,
10218 parent: Default::default(),
10219 climbing: Climbing(false),
10220 }
10221 }
10222}
10223
10224#[derive(Component)]
10247pub struct CaveSpider;
10248impl CaveSpider {
10249 fn apply_metadata(
10250 entity: &mut bevy_ecs::system::EntityCommands,
10251 d: EntityDataItem,
10252 ) -> Result<(), UpdateMetadataError> {
10253 match d.index {
10254 0..=16 => Spider::apply_metadata(entity, d)?,
10255 _ => {}
10256 }
10257 Ok(())
10258 }
10259}
10260
10261#[derive(Bundle)]
10265pub struct CaveSpiderMetadataBundle {
10266 _marker: CaveSpider,
10267 parent: SpiderMetadataBundle,
10268}
10269impl Default for CaveSpiderMetadataBundle {
10270 fn default() -> Self {
10271 Self {
10272 _marker: CaveSpider,
10273 parent: Default::default(),
10274 }
10275 }
10276}
10277
10278#[derive(Component)]
10300pub struct Stray;
10301impl Stray {
10302 fn apply_metadata(
10303 entity: &mut bevy_ecs::system::EntityCommands,
10304 d: EntityDataItem,
10305 ) -> Result<(), UpdateMetadataError> {
10306 match d.index {
10307 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
10308 _ => {}
10309 }
10310 Ok(())
10311 }
10312}
10313
10314#[derive(Bundle)]
10318pub struct StrayMetadataBundle {
10319 _marker: Stray,
10320 parent: AbstractMonsterMetadataBundle,
10321}
10322impl Default for StrayMetadataBundle {
10323 fn default() -> Self {
10324 Self {
10325 _marker: Stray,
10326 parent: Default::default(),
10327 }
10328 }
10329}
10330
10331#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10333pub struct VexFlags(pub u8);
10334#[derive(Component)]
10358pub struct Vex;
10359impl Vex {
10360 fn apply_metadata(
10361 entity: &mut bevy_ecs::system::EntityCommands,
10362 d: EntityDataItem,
10363 ) -> Result<(), UpdateMetadataError> {
10364 match d.index {
10365 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
10366 16 => {
10367 entity.insert(VexFlags(
10368 d.value.into_byte().map_err(|v| e(v, d.index, "VexFlags"))?,
10369 ));
10370 }
10371 _ => {}
10372 }
10373 Ok(())
10374 }
10375}
10376
10377#[derive(Bundle)]
10381pub struct VexMetadataBundle {
10382 _marker: Vex,
10383 parent: AbstractMonsterMetadataBundle,
10384 vex_flags: VexFlags,
10385}
10386impl Default for VexMetadataBundle {
10387 fn default() -> Self {
10388 Self {
10389 _marker: Vex,
10390 parent: Default::default(),
10391 vex_flags: VexFlags(0),
10392 }
10393 }
10394}
10395
10396#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10398pub struct ClientAngerLevel(pub i32);
10399#[derive(Component)]
10423pub struct Warden;
10424impl Warden {
10425 fn apply_metadata(
10426 entity: &mut bevy_ecs::system::EntityCommands,
10427 d: EntityDataItem,
10428 ) -> Result<(), UpdateMetadataError> {
10429 match d.index {
10430 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
10431 16 => {
10432 entity.insert(ClientAngerLevel(
10433 d.value
10434 .into_int()
10435 .map_err(|v| e(v, d.index, "ClientAngerLevel"))?,
10436 ));
10437 }
10438 _ => {}
10439 }
10440 Ok(())
10441 }
10442}
10443
10444#[derive(Bundle)]
10448pub struct WardenMetadataBundle {
10449 _marker: Warden,
10450 parent: AbstractMonsterMetadataBundle,
10451 client_anger_level: ClientAngerLevel,
10452}
10453impl Default for WardenMetadataBundle {
10454 fn default() -> Self {
10455 Self {
10456 _marker: Warden,
10457 parent: Default::default(),
10458 client_anger_level: ClientAngerLevel(0),
10459 }
10460 }
10461}
10462
10463#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10465pub struct TargetA(pub i32);
10466#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10468pub struct TargetB(pub i32);
10469#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10471pub struct TargetC(pub i32);
10472#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10474pub struct Inv(pub i32);
10475#[derive(Component)]
10502pub struct Wither;
10503impl Wither {
10504 fn apply_metadata(
10505 entity: &mut bevy_ecs::system::EntityCommands,
10506 d: EntityDataItem,
10507 ) -> Result<(), UpdateMetadataError> {
10508 match d.index {
10509 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
10510 16 => {
10511 entity.insert(TargetA(
10512 d.value.into_int().map_err(|v| e(v, d.index, "TargetA"))?,
10513 ));
10514 }
10515 17 => {
10516 entity.insert(TargetB(
10517 d.value.into_int().map_err(|v| e(v, d.index, "TargetB"))?,
10518 ));
10519 }
10520 18 => {
10521 entity.insert(TargetC(
10522 d.value.into_int().map_err(|v| e(v, d.index, "TargetC"))?,
10523 ));
10524 }
10525 19 => {
10526 entity.insert(Inv(d.value.into_int().map_err(|v| e(v, d.index, "Inv"))?));
10527 }
10528 _ => {}
10529 }
10530 Ok(())
10531 }
10532}
10533
10534#[derive(Bundle)]
10538pub struct WitherMetadataBundle {
10539 _marker: Wither,
10540 parent: AbstractMonsterMetadataBundle,
10541 target_a: TargetA,
10542 target_b: TargetB,
10543 target_c: TargetC,
10544 inv: Inv,
10545}
10546impl Default for WitherMetadataBundle {
10547 fn default() -> Self {
10548 Self {
10549 _marker: Wither,
10550 parent: Default::default(),
10551 target_a: TargetA(0),
10552 target_b: TargetB(0),
10553 target_c: TargetC(0),
10554 inv: Inv(0),
10555 }
10556 }
10557}
10558
10559#[derive(Component)]
10581pub struct WitherSkeleton;
10582impl WitherSkeleton {
10583 fn apply_metadata(
10584 entity: &mut bevy_ecs::system::EntityCommands,
10585 d: EntityDataItem,
10586 ) -> Result<(), UpdateMetadataError> {
10587 match d.index {
10588 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
10589 _ => {}
10590 }
10591 Ok(())
10592 }
10593}
10594
10595#[derive(Bundle)]
10599pub struct WitherSkeletonMetadataBundle {
10600 _marker: WitherSkeleton,
10601 parent: AbstractMonsterMetadataBundle,
10602}
10603impl Default for WitherSkeletonMetadataBundle {
10604 fn default() -> Self {
10605 Self {
10606 _marker: WitherSkeleton,
10607 parent: Default::default(),
10608 }
10609 }
10610}
10611
10612#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10614pub struct ZoglinBaby(pub bool);
10615#[derive(Component)]
10639pub struct Zoglin;
10640impl Zoglin {
10641 fn apply_metadata(
10642 entity: &mut bevy_ecs::system::EntityCommands,
10643 d: EntityDataItem,
10644 ) -> Result<(), UpdateMetadataError> {
10645 match d.index {
10646 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
10647 16 => {
10648 entity.insert(ZoglinBaby(
10649 d.value
10650 .into_boolean()
10651 .map_err(|v| e(v, d.index, "ZoglinBaby"))?,
10652 ));
10653 }
10654 _ => {}
10655 }
10656 Ok(())
10657 }
10658}
10659
10660#[derive(Bundle)]
10664pub struct ZoglinMetadataBundle {
10665 _marker: Zoglin,
10666 parent: AbstractMonsterMetadataBundle,
10667 zoglin_baby: ZoglinBaby,
10668}
10669impl Default for ZoglinMetadataBundle {
10670 fn default() -> Self {
10671 Self {
10672 _marker: Zoglin,
10673 parent: Default::default(),
10674 zoglin_baby: ZoglinBaby(false),
10675 }
10676 }
10677}
10678
10679#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10681pub struct ZombieBaby(pub bool);
10682#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10684pub struct SpecialType(pub i32);
10685#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10687pub struct DrownedConversion(pub bool);
10688#[derive(Component)]
10717pub struct Zombie;
10718impl Zombie {
10719 fn apply_metadata(
10720 entity: &mut bevy_ecs::system::EntityCommands,
10721 d: EntityDataItem,
10722 ) -> Result<(), UpdateMetadataError> {
10723 match d.index {
10724 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
10725 16 => {
10726 entity.insert(ZombieBaby(
10727 d.value
10728 .into_boolean()
10729 .map_err(|v| e(v, d.index, "ZombieBaby"))?,
10730 ));
10731 }
10732 17 => {
10733 entity.insert(SpecialType(
10734 d.value
10735 .into_int()
10736 .map_err(|v| e(v, d.index, "SpecialType"))?,
10737 ));
10738 }
10739 18 => {
10740 entity.insert(DrownedConversion(
10741 d.value
10742 .into_boolean()
10743 .map_err(|v| e(v, d.index, "DrownedConversion"))?,
10744 ));
10745 }
10746 _ => {}
10747 }
10748 Ok(())
10749 }
10750}
10751
10752#[derive(Bundle)]
10756pub struct ZombieMetadataBundle {
10757 _marker: Zombie,
10758 parent: AbstractMonsterMetadataBundle,
10759 zombie_baby: ZombieBaby,
10760 special_type: SpecialType,
10761 drowned_conversion: DrownedConversion,
10762}
10763impl Default for ZombieMetadataBundle {
10764 fn default() -> Self {
10765 Self {
10766 _marker: Zombie,
10767 parent: Default::default(),
10768 zombie_baby: ZombieBaby(false),
10769 special_type: SpecialType(0),
10770 drowned_conversion: DrownedConversion(false),
10771 }
10772 }
10773}
10774
10775#[derive(Component)]
10798pub struct Drowned;
10799impl Drowned {
10800 fn apply_metadata(
10801 entity: &mut bevy_ecs::system::EntityCommands,
10802 d: EntityDataItem,
10803 ) -> Result<(), UpdateMetadataError> {
10804 match d.index {
10805 0..=18 => Zombie::apply_metadata(entity, d)?,
10806 _ => {}
10807 }
10808 Ok(())
10809 }
10810}
10811
10812#[derive(Bundle)]
10816pub struct DrownedMetadataBundle {
10817 _marker: Drowned,
10818 parent: ZombieMetadataBundle,
10819}
10820impl Default for DrownedMetadataBundle {
10821 fn default() -> Self {
10822 Self {
10823 _marker: Drowned,
10824 parent: Default::default(),
10825 }
10826 }
10827}
10828
10829#[derive(Component)]
10852pub struct Husk;
10853impl Husk {
10854 fn apply_metadata(
10855 entity: &mut bevy_ecs::system::EntityCommands,
10856 d: EntityDataItem,
10857 ) -> Result<(), UpdateMetadataError> {
10858 match d.index {
10859 0..=18 => Zombie::apply_metadata(entity, d)?,
10860 _ => {}
10861 }
10862 Ok(())
10863 }
10864}
10865
10866#[derive(Bundle)]
10870pub struct HuskMetadataBundle {
10871 _marker: Husk,
10872 parent: ZombieMetadataBundle,
10873}
10874impl Default for HuskMetadataBundle {
10875 fn default() -> Self {
10876 Self {
10877 _marker: Husk,
10878 parent: Default::default(),
10879 }
10880 }
10881}
10882
10883#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10885pub struct Converting(pub bool);
10886#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10888pub struct ZombieVillagerVillagerData(pub VillagerData);
10889#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
10891pub struct ZombieVillagerVillagerDataFinalized(pub bool);
10892#[derive(Component)]
10920pub struct ZombieVillager;
10921impl ZombieVillager {
10922 fn apply_metadata(
10923 entity: &mut bevy_ecs::system::EntityCommands,
10924 d: EntityDataItem,
10925 ) -> Result<(), UpdateMetadataError> {
10926 match d.index {
10927 0..=18 => Zombie::apply_metadata(entity, d)?,
10928 19 => {
10929 entity.insert(Converting(
10930 d.value
10931 .into_boolean()
10932 .map_err(|v| e(v, d.index, "Converting"))?,
10933 ));
10934 }
10935 20 => {
10936 entity.insert(ZombieVillagerVillagerData(
10937 d.value
10938 .into_villager_data()
10939 .map_err(|v| e(v, d.index, "ZombieVillagerVillagerData"))?,
10940 ));
10941 }
10942 21 => {
10943 entity.insert(ZombieVillagerVillagerDataFinalized(
10944 d.value
10945 .into_boolean()
10946 .map_err(|v| e(v, d.index, "ZombieVillagerVillagerDataFinalized"))?,
10947 ));
10948 }
10949 _ => {}
10950 }
10951 Ok(())
10952 }
10953}
10954
10955#[derive(Bundle)]
10959pub struct ZombieVillagerMetadataBundle {
10960 _marker: ZombieVillager,
10961 parent: ZombieMetadataBundle,
10962 converting: Converting,
10963 zombie_villager_villager_data: ZombieVillagerVillagerData,
10964 zombie_villager_villager_data_finalized: ZombieVillagerVillagerDataFinalized,
10965}
10966impl Default for ZombieVillagerMetadataBundle {
10967 fn default() -> Self {
10968 Self {
10969 _marker: ZombieVillager,
10970 parent: Default::default(),
10971 converting: Converting(false),
10972 zombie_villager_villager_data: ZombieVillagerVillagerData(VillagerData {
10973 kind: azalea_registry::builtin::VillagerKind::Plains,
10974 profession: azalea_registry::builtin::VillagerProfession::None,
10975 level: 0,
10976 }),
10977 zombie_villager_villager_data_finalized: ZombieVillagerVillagerDataFinalized(false),
10978 }
10979 }
10980}
10981
10982#[derive(Component)]
11005pub struct ZombifiedPiglin;
11006impl ZombifiedPiglin {
11007 fn apply_metadata(
11008 entity: &mut bevy_ecs::system::EntityCommands,
11009 d: EntityDataItem,
11010 ) -> Result<(), UpdateMetadataError> {
11011 match d.index {
11012 0..=18 => Zombie::apply_metadata(entity, d)?,
11013 _ => {}
11014 }
11015 Ok(())
11016 }
11017}
11018
11019#[derive(Bundle)]
11023pub struct ZombifiedPiglinMetadataBundle {
11024 _marker: ZombifiedPiglin,
11025 parent: ZombieMetadataBundle,
11026}
11027impl Default for ZombifiedPiglinMetadataBundle {
11028 fn default() -> Self {
11029 Self {
11030 _marker: ZombifiedPiglin,
11031 parent: Default::default(),
11032 }
11033 }
11034}
11035
11036#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11038pub struct AbstractPiglinImmuneToZombification(pub bool);
11039#[derive(Component)]
11065pub struct AbstractPiglin;
11066impl AbstractPiglin {
11067 fn apply_metadata(
11068 entity: &mut bevy_ecs::system::EntityCommands,
11069 d: EntityDataItem,
11070 ) -> Result<(), UpdateMetadataError> {
11071 match d.index {
11072 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
11073 16 => {
11074 entity.insert(AbstractPiglinImmuneToZombification(
11075 d.value
11076 .into_boolean()
11077 .map_err(|v| e(v, d.index, "AbstractPiglinImmuneToZombification"))?,
11078 ));
11079 }
11080 _ => {}
11081 }
11082 Ok(())
11083 }
11084}
11085
11086#[derive(Bundle)]
11090pub struct AbstractPiglinMetadataBundle {
11091 _marker: AbstractPiglin,
11092 parent: AbstractMonsterMetadataBundle,
11093 abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification,
11094}
11095impl Default for AbstractPiglinMetadataBundle {
11096 fn default() -> Self {
11097 Self {
11098 _marker: AbstractPiglin,
11099 parent: Default::default(),
11100 abstract_piglin_immune_to_zombification: AbstractPiglinImmuneToZombification(false),
11101 }
11102 }
11103}
11104
11105#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11107pub struct PiglinBaby(pub bool);
11108#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11110pub struct PiglinIsChargingCrossbow(pub bool);
11111#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11113pub struct IsDancing(pub bool);
11114#[derive(Component)]
11141pub struct Piglin;
11142impl Piglin {
11143 fn apply_metadata(
11144 entity: &mut bevy_ecs::system::EntityCommands,
11145 d: EntityDataItem,
11146 ) -> Result<(), UpdateMetadataError> {
11147 match d.index {
11148 0..=16 => AbstractPiglin::apply_metadata(entity, d)?,
11149 17 => {
11150 entity.insert(PiglinBaby(
11151 d.value
11152 .into_boolean()
11153 .map_err(|v| e(v, d.index, "PiglinBaby"))?,
11154 ));
11155 }
11156 18 => {
11157 entity.insert(PiglinIsChargingCrossbow(
11158 d.value
11159 .into_boolean()
11160 .map_err(|v| e(v, d.index, "PiglinIsChargingCrossbow"))?,
11161 ));
11162 }
11163 19 => {
11164 entity.insert(IsDancing(
11165 d.value
11166 .into_boolean()
11167 .map_err(|v| e(v, d.index, "IsDancing"))?,
11168 ));
11169 }
11170 _ => {}
11171 }
11172 Ok(())
11173 }
11174}
11175
11176#[derive(Bundle)]
11180pub struct PiglinMetadataBundle {
11181 _marker: Piglin,
11182 parent: AbstractPiglinMetadataBundle,
11183 piglin_baby: PiglinBaby,
11184 piglin_is_charging_crossbow: PiglinIsChargingCrossbow,
11185 is_dancing: IsDancing,
11186}
11187impl Default for PiglinMetadataBundle {
11188 fn default() -> Self {
11189 Self {
11190 _marker: Piglin,
11191 parent: Default::default(),
11192 piglin_baby: PiglinBaby(false),
11193 piglin_is_charging_crossbow: PiglinIsChargingCrossbow(false),
11194 is_dancing: IsDancing(false),
11195 }
11196 }
11197}
11198
11199#[derive(Component)]
11222pub struct PiglinBrute;
11223impl PiglinBrute {
11224 fn apply_metadata(
11225 entity: &mut bevy_ecs::system::EntityCommands,
11226 d: EntityDataItem,
11227 ) -> Result<(), UpdateMetadataError> {
11228 match d.index {
11229 0..=16 => AbstractPiglin::apply_metadata(entity, d)?,
11230 _ => {}
11231 }
11232 Ok(())
11233 }
11234}
11235
11236#[derive(Bundle)]
11240pub struct PiglinBruteMetadataBundle {
11241 _marker: PiglinBrute,
11242 parent: AbstractPiglinMetadataBundle,
11243}
11244impl Default for PiglinBruteMetadataBundle {
11245 fn default() -> Self {
11246 Self {
11247 _marker: PiglinBrute,
11248 parent: Default::default(),
11249 }
11250 }
11251}
11252
11253#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11255pub struct IsCelebrating(pub bool);
11256#[derive(Component)]
11287pub struct AbstractRaider;
11288impl AbstractRaider {
11289 fn apply_metadata(
11290 entity: &mut bevy_ecs::system::EntityCommands,
11291 d: EntityDataItem,
11292 ) -> Result<(), UpdateMetadataError> {
11293 match d.index {
11294 0..=15 => AbstractMonster::apply_metadata(entity, d)?,
11295 16 => {
11296 entity.insert(IsCelebrating(
11297 d.value
11298 .into_boolean()
11299 .map_err(|v| e(v, d.index, "IsCelebrating"))?,
11300 ));
11301 }
11302 _ => {}
11303 }
11304 Ok(())
11305 }
11306}
11307
11308#[derive(Bundle)]
11312pub struct AbstractRaiderMetadataBundle {
11313 _marker: AbstractRaider,
11314 parent: AbstractMonsterMetadataBundle,
11315 is_celebrating: IsCelebrating,
11316}
11317impl Default for AbstractRaiderMetadataBundle {
11318 fn default() -> Self {
11319 Self {
11320 _marker: AbstractRaider,
11321 parent: Default::default(),
11322 is_celebrating: IsCelebrating(false),
11323 }
11324 }
11325}
11326
11327#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11329pub struct PillagerIsChargingCrossbow(pub bool);
11330#[derive(Component)]
11356pub struct Pillager;
11357impl Pillager {
11358 fn apply_metadata(
11359 entity: &mut bevy_ecs::system::EntityCommands,
11360 d: EntityDataItem,
11361 ) -> Result<(), UpdateMetadataError> {
11362 match d.index {
11363 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
11364 17 => {
11365 entity.insert(PillagerIsChargingCrossbow(
11366 d.value
11367 .into_boolean()
11368 .map_err(|v| e(v, d.index, "PillagerIsChargingCrossbow"))?,
11369 ));
11370 }
11371 _ => {}
11372 }
11373 Ok(())
11374 }
11375}
11376
11377#[derive(Bundle)]
11381pub struct PillagerMetadataBundle {
11382 _marker: Pillager,
11383 parent: AbstractRaiderMetadataBundle,
11384 pillager_is_charging_crossbow: PillagerIsChargingCrossbow,
11385}
11386impl Default for PillagerMetadataBundle {
11387 fn default() -> Self {
11388 Self {
11389 _marker: Pillager,
11390 parent: Default::default(),
11391 pillager_is_charging_crossbow: PillagerIsChargingCrossbow(false),
11392 }
11393 }
11394}
11395
11396#[derive(Component)]
11419pub struct Ravager;
11420impl Ravager {
11421 fn apply_metadata(
11422 entity: &mut bevy_ecs::system::EntityCommands,
11423 d: EntityDataItem,
11424 ) -> Result<(), UpdateMetadataError> {
11425 match d.index {
11426 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
11427 _ => {}
11428 }
11429 Ok(())
11430 }
11431}
11432
11433#[derive(Bundle)]
11437pub struct RavagerMetadataBundle {
11438 _marker: Ravager,
11439 parent: AbstractRaiderMetadataBundle,
11440}
11441impl Default for RavagerMetadataBundle {
11442 fn default() -> Self {
11443 Self {
11444 _marker: Ravager,
11445 parent: Default::default(),
11446 }
11447 }
11448}
11449
11450#[derive(Component)]
11473pub struct Vindicator;
11474impl Vindicator {
11475 fn apply_metadata(
11476 entity: &mut bevy_ecs::system::EntityCommands,
11477 d: EntityDataItem,
11478 ) -> Result<(), UpdateMetadataError> {
11479 match d.index {
11480 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
11481 _ => {}
11482 }
11483 Ok(())
11484 }
11485}
11486
11487#[derive(Bundle)]
11491pub struct VindicatorMetadataBundle {
11492 _marker: Vindicator,
11493 parent: AbstractRaiderMetadataBundle,
11494}
11495impl Default for VindicatorMetadataBundle {
11496 fn default() -> Self {
11497 Self {
11498 _marker: Vindicator,
11499 parent: Default::default(),
11500 }
11501 }
11502}
11503
11504#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11506pub struct WitchUsingItem(pub bool);
11507#[derive(Component)]
11532pub struct Witch;
11533impl Witch {
11534 fn apply_metadata(
11535 entity: &mut bevy_ecs::system::EntityCommands,
11536 d: EntityDataItem,
11537 ) -> Result<(), UpdateMetadataError> {
11538 match d.index {
11539 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
11540 17 => {
11541 entity.insert(WitchUsingItem(
11542 d.value
11543 .into_boolean()
11544 .map_err(|v| e(v, d.index, "WitchUsingItem"))?,
11545 ));
11546 }
11547 _ => {}
11548 }
11549 Ok(())
11550 }
11551}
11552
11553#[derive(Bundle)]
11557pub struct WitchMetadataBundle {
11558 _marker: Witch,
11559 parent: AbstractRaiderMetadataBundle,
11560 witch_using_item: WitchUsingItem,
11561}
11562impl Default for WitchMetadataBundle {
11563 fn default() -> Self {
11564 Self {
11565 _marker: Witch,
11566 parent: Default::default(),
11567 witch_using_item: WitchUsingItem(false),
11568 }
11569 }
11570}
11571
11572#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11574pub struct SpellCasting(pub u8);
11575#[derive(Component)]
11602pub struct AbstractSpellcasterIllager;
11603impl AbstractSpellcasterIllager {
11604 fn apply_metadata(
11605 entity: &mut bevy_ecs::system::EntityCommands,
11606 d: EntityDataItem,
11607 ) -> Result<(), UpdateMetadataError> {
11608 match d.index {
11609 0..=16 => AbstractRaider::apply_metadata(entity, d)?,
11610 17 => {
11611 entity.insert(SpellCasting(
11612 d.value
11613 .into_byte()
11614 .map_err(|v| e(v, d.index, "SpellCasting"))?,
11615 ));
11616 }
11617 _ => {}
11618 }
11619 Ok(())
11620 }
11621}
11622
11623#[derive(Bundle)]
11627pub struct AbstractSpellcasterIllagerMetadataBundle {
11628 _marker: AbstractSpellcasterIllager,
11629 parent: AbstractRaiderMetadataBundle,
11630 spell_casting: SpellCasting,
11631}
11632impl Default for AbstractSpellcasterIllagerMetadataBundle {
11633 fn default() -> Self {
11634 Self {
11635 _marker: AbstractSpellcasterIllager,
11636 parent: Default::default(),
11637 spell_casting: SpellCasting(0),
11638 }
11639 }
11640}
11641
11642#[derive(Component)]
11666pub struct Evoker;
11667impl Evoker {
11668 fn apply_metadata(
11669 entity: &mut bevy_ecs::system::EntityCommands,
11670 d: EntityDataItem,
11671 ) -> Result<(), UpdateMetadataError> {
11672 match d.index {
11673 0..=17 => AbstractSpellcasterIllager::apply_metadata(entity, d)?,
11674 _ => {}
11675 }
11676 Ok(())
11677 }
11678}
11679
11680#[derive(Bundle)]
11684pub struct EvokerMetadataBundle {
11685 _marker: Evoker,
11686 parent: AbstractSpellcasterIllagerMetadataBundle,
11687}
11688impl Default for EvokerMetadataBundle {
11689 fn default() -> Self {
11690 Self {
11691 _marker: Evoker,
11692 parent: Default::default(),
11693 }
11694 }
11695}
11696
11697#[derive(Component)]
11721pub struct Illusioner;
11722impl Illusioner {
11723 fn apply_metadata(
11724 entity: &mut bevy_ecs::system::EntityCommands,
11725 d: EntityDataItem,
11726 ) -> Result<(), UpdateMetadataError> {
11727 match d.index {
11728 0..=17 => AbstractSpellcasterIllager::apply_metadata(entity, d)?,
11729 _ => {}
11730 }
11731 Ok(())
11732 }
11733}
11734
11735#[derive(Bundle)]
11739pub struct IllusionerMetadataBundle {
11740 _marker: Illusioner,
11741 parent: AbstractSpellcasterIllagerMetadataBundle,
11742}
11743impl Default for IllusionerMetadataBundle {
11744 fn default() -> Self {
11745 Self {
11746 _marker: Illusioner,
11747 parent: Default::default(),
11748 }
11749 }
11750}
11751
11752#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
11754pub struct AbstractThrownItemProjectileItemStack(pub ItemStack);
11755#[derive(Component)]
11781pub struct AbstractThrownItemProjectile;
11782impl AbstractThrownItemProjectile {
11783 fn apply_metadata(
11784 entity: &mut bevy_ecs::system::EntityCommands,
11785 d: EntityDataItem,
11786 ) -> Result<(), UpdateMetadataError> {
11787 match d.index {
11788 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
11789 8 => {
11790 entity.insert(AbstractThrownItemProjectileItemStack(
11791 d.value
11792 .into_item_stack()
11793 .map_err(|v| e(v, d.index, "AbstractThrownItemProjectileItemStack"))?,
11794 ));
11795 }
11796 _ => {}
11797 }
11798 Ok(())
11799 }
11800}
11801
11802#[derive(Bundle)]
11806pub struct AbstractThrownItemProjectileMetadataBundle {
11807 _marker: AbstractThrownItemProjectile,
11808 parent: AbstractEntityMetadataBundle,
11809 abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack,
11810}
11811impl Default for AbstractThrownItemProjectileMetadataBundle {
11812 fn default() -> Self {
11813 Self {
11814 _marker: AbstractThrownItemProjectile,
11815 parent: Default::default(),
11816 abstract_thrown_item_projectile_item_stack: AbstractThrownItemProjectileItemStack(
11817 Default::default(),
11818 ),
11819 }
11820 }
11821}
11822
11823#[derive(Component)]
11842pub struct Egg;
11843impl Egg {
11844 fn apply_metadata(
11845 entity: &mut bevy_ecs::system::EntityCommands,
11846 d: EntityDataItem,
11847 ) -> Result<(), UpdateMetadataError> {
11848 match d.index {
11849 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
11850 _ => {}
11851 }
11852 Ok(())
11853 }
11854}
11855
11856#[derive(Bundle)]
11860pub struct EggMetadataBundle {
11861 _marker: Egg,
11862 parent: AbstractThrownItemProjectileMetadataBundle,
11863}
11864impl Default for EggMetadataBundle {
11865 fn default() -> Self {
11866 Self {
11867 _marker: Egg,
11868 parent: Default::default(),
11869 }
11870 }
11871}
11872
11873#[derive(Component)]
11892pub struct EnderPearl;
11893impl EnderPearl {
11894 fn apply_metadata(
11895 entity: &mut bevy_ecs::system::EntityCommands,
11896 d: EntityDataItem,
11897 ) -> Result<(), UpdateMetadataError> {
11898 match d.index {
11899 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
11900 _ => {}
11901 }
11902 Ok(())
11903 }
11904}
11905
11906#[derive(Bundle)]
11910pub struct EnderPearlMetadataBundle {
11911 _marker: EnderPearl,
11912 parent: AbstractThrownItemProjectileMetadataBundle,
11913}
11914impl Default for EnderPearlMetadataBundle {
11915 fn default() -> Self {
11916 Self {
11917 _marker: EnderPearl,
11918 parent: Default::default(),
11919 }
11920 }
11921}
11922
11923#[derive(Component)]
11942pub struct ExperienceBottle;
11943impl ExperienceBottle {
11944 fn apply_metadata(
11945 entity: &mut bevy_ecs::system::EntityCommands,
11946 d: EntityDataItem,
11947 ) -> Result<(), UpdateMetadataError> {
11948 match d.index {
11949 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
11950 _ => {}
11951 }
11952 Ok(())
11953 }
11954}
11955
11956#[derive(Bundle)]
11960pub struct ExperienceBottleMetadataBundle {
11961 _marker: ExperienceBottle,
11962 parent: AbstractThrownItemProjectileMetadataBundle,
11963}
11964impl Default for ExperienceBottleMetadataBundle {
11965 fn default() -> Self {
11966 Self {
11967 _marker: ExperienceBottle,
11968 parent: Default::default(),
11969 }
11970 }
11971}
11972
11973#[derive(Component)]
11992pub struct LingeringPotion;
11993impl LingeringPotion {
11994 fn apply_metadata(
11995 entity: &mut bevy_ecs::system::EntityCommands,
11996 d: EntityDataItem,
11997 ) -> Result<(), UpdateMetadataError> {
11998 match d.index {
11999 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
12000 _ => {}
12001 }
12002 Ok(())
12003 }
12004}
12005
12006#[derive(Bundle)]
12010pub struct LingeringPotionMetadataBundle {
12011 _marker: LingeringPotion,
12012 parent: AbstractThrownItemProjectileMetadataBundle,
12013}
12014impl Default for LingeringPotionMetadataBundle {
12015 fn default() -> Self {
12016 Self {
12017 _marker: LingeringPotion,
12018 parent: Default::default(),
12019 }
12020 }
12021}
12022
12023#[derive(Component)]
12042pub struct Snowball;
12043impl Snowball {
12044 fn apply_metadata(
12045 entity: &mut bevy_ecs::system::EntityCommands,
12046 d: EntityDataItem,
12047 ) -> Result<(), UpdateMetadataError> {
12048 match d.index {
12049 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
12050 _ => {}
12051 }
12052 Ok(())
12053 }
12054}
12055
12056#[derive(Bundle)]
12060pub struct SnowballMetadataBundle {
12061 _marker: Snowball,
12062 parent: AbstractThrownItemProjectileMetadataBundle,
12063}
12064impl Default for SnowballMetadataBundle {
12065 fn default() -> Self {
12066 Self {
12067 _marker: Snowball,
12068 parent: Default::default(),
12069 }
12070 }
12071}
12072
12073#[derive(Component)]
12092pub struct SplashPotion;
12093impl SplashPotion {
12094 fn apply_metadata(
12095 entity: &mut bevy_ecs::system::EntityCommands,
12096 d: EntityDataItem,
12097 ) -> Result<(), UpdateMetadataError> {
12098 match d.index {
12099 0..=8 => AbstractThrownItemProjectile::apply_metadata(entity, d)?,
12100 _ => {}
12101 }
12102 Ok(())
12103 }
12104}
12105
12106#[derive(Bundle)]
12110pub struct SplashPotionMetadataBundle {
12111 _marker: SplashPotion,
12112 parent: AbstractThrownItemProjectileMetadataBundle,
12113}
12114impl Default for SplashPotionMetadataBundle {
12115 fn default() -> Self {
12116 Self {
12117 _marker: SplashPotion,
12118 parent: Default::default(),
12119 }
12120 }
12121}
12122
12123#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12125pub struct Hurt(pub i32);
12126#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12128pub struct Hurtdir(pub i32);
12129#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12131pub struct Damage(pub f32);
12132#[derive(Component)]
12185pub struct AbstractVehicle;
12186impl AbstractVehicle {
12187 fn apply_metadata(
12188 entity: &mut bevy_ecs::system::EntityCommands,
12189 d: EntityDataItem,
12190 ) -> Result<(), UpdateMetadataError> {
12191 match d.index {
12192 0..=7 => AbstractEntity::apply_metadata(entity, d)?,
12193 8 => {
12194 entity.insert(Hurt(d.value.into_int().map_err(|v| e(v, d.index, "Hurt"))?));
12195 }
12196 9 => {
12197 entity.insert(Hurtdir(
12198 d.value.into_int().map_err(|v| e(v, d.index, "Hurtdir"))?,
12199 ));
12200 }
12201 10 => {
12202 entity.insert(Damage(
12203 d.value.into_float().map_err(|v| e(v, d.index, "Damage"))?,
12204 ));
12205 }
12206 _ => {}
12207 }
12208 Ok(())
12209 }
12210}
12211
12212#[derive(Bundle)]
12216pub struct AbstractVehicleMetadataBundle {
12217 _marker: AbstractVehicle,
12218 parent: AbstractEntityMetadataBundle,
12219 hurt: Hurt,
12220 hurtdir: Hurtdir,
12221 damage: Damage,
12222}
12223impl Default for AbstractVehicleMetadataBundle {
12224 fn default() -> Self {
12225 Self {
12226 _marker: AbstractVehicle,
12227 parent: Default::default(),
12228 hurt: Hurt(0),
12229 hurtdir: Hurtdir(1),
12230 damage: Damage(0.0),
12231 }
12232 }
12233}
12234
12235#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12237pub struct PaddleLeft(pub bool);
12238#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12240pub struct PaddleRight(pub bool);
12241#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
12243pub struct BubbleTime(pub i32);
12244#[derive(Component)]
12289pub struct AbstractBoat;
12290impl AbstractBoat {
12291 fn apply_metadata(
12292 entity: &mut bevy_ecs::system::EntityCommands,
12293 d: EntityDataItem,
12294 ) -> Result<(), UpdateMetadataError> {
12295 match d.index {
12296 0..=10 => AbstractVehicle::apply_metadata(entity, d)?,
12297 11 => {
12298 entity.insert(PaddleLeft(
12299 d.value
12300 .into_boolean()
12301 .map_err(|v| e(v, d.index, "PaddleLeft"))?,
12302 ));
12303 }
12304 12 => {
12305 entity.insert(PaddleRight(
12306 d.value
12307 .into_boolean()
12308 .map_err(|v| e(v, d.index, "PaddleRight"))?,
12309 ));
12310 }
12311 13 => {
12312 entity.insert(BubbleTime(
12313 d.value
12314 .into_int()
12315 .map_err(|v| e(v, d.index, "BubbleTime"))?,
12316 ));
12317 }
12318 _ => {}
12319 }
12320 Ok(())
12321 }
12322}
12323
12324#[derive(Bundle)]
12328pub struct AbstractBoatMetadataBundle {
12329 _marker: AbstractBoat,
12330 parent: AbstractVehicleMetadataBundle,
12331 paddle_left: PaddleLeft,
12332 paddle_right: PaddleRight,
12333 bubble_time: BubbleTime,
12334}
12335impl Default for AbstractBoatMetadataBundle {
12336 fn default() -> Self {
12337 Self {
12338 _marker: AbstractBoat,
12339 parent: Default::default(),
12340 paddle_left: PaddleLeft(false),
12341 paddle_right: PaddleRight(false),
12342 bubble_time: BubbleTime(0),
12343 }
12344 }
12345}
12346
12347#[derive(Component)]
12367pub struct AcaciaBoat;
12368impl AcaciaBoat {
12369 fn apply_metadata(
12370 entity: &mut bevy_ecs::system::EntityCommands,
12371 d: EntityDataItem,
12372 ) -> Result<(), UpdateMetadataError> {
12373 match d.index {
12374 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12375 _ => {}
12376 }
12377 Ok(())
12378 }
12379}
12380
12381#[derive(Bundle)]
12385pub struct AcaciaBoatMetadataBundle {
12386 _marker: AcaciaBoat,
12387 parent: AbstractBoatMetadataBundle,
12388}
12389impl Default for AcaciaBoatMetadataBundle {
12390 fn default() -> Self {
12391 Self {
12392 _marker: AcaciaBoat,
12393 parent: Default::default(),
12394 }
12395 }
12396}
12397
12398#[derive(Component)]
12418pub struct AcaciaChestBoat;
12419impl AcaciaChestBoat {
12420 fn apply_metadata(
12421 entity: &mut bevy_ecs::system::EntityCommands,
12422 d: EntityDataItem,
12423 ) -> Result<(), UpdateMetadataError> {
12424 match d.index {
12425 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12426 _ => {}
12427 }
12428 Ok(())
12429 }
12430}
12431
12432#[derive(Bundle)]
12436pub struct AcaciaChestBoatMetadataBundle {
12437 _marker: AcaciaChestBoat,
12438 parent: AbstractBoatMetadataBundle,
12439}
12440impl Default for AcaciaChestBoatMetadataBundle {
12441 fn default() -> Self {
12442 Self {
12443 _marker: AcaciaChestBoat,
12444 parent: Default::default(),
12445 }
12446 }
12447}
12448
12449#[derive(Component)]
12469pub struct BambooChestRaft;
12470impl BambooChestRaft {
12471 fn apply_metadata(
12472 entity: &mut bevy_ecs::system::EntityCommands,
12473 d: EntityDataItem,
12474 ) -> Result<(), UpdateMetadataError> {
12475 match d.index {
12476 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12477 _ => {}
12478 }
12479 Ok(())
12480 }
12481}
12482
12483#[derive(Bundle)]
12487pub struct BambooChestRaftMetadataBundle {
12488 _marker: BambooChestRaft,
12489 parent: AbstractBoatMetadataBundle,
12490}
12491impl Default for BambooChestRaftMetadataBundle {
12492 fn default() -> Self {
12493 Self {
12494 _marker: BambooChestRaft,
12495 parent: Default::default(),
12496 }
12497 }
12498}
12499
12500#[derive(Component)]
12520pub struct BambooRaft;
12521impl BambooRaft {
12522 fn apply_metadata(
12523 entity: &mut bevy_ecs::system::EntityCommands,
12524 d: EntityDataItem,
12525 ) -> Result<(), UpdateMetadataError> {
12526 match d.index {
12527 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12528 _ => {}
12529 }
12530 Ok(())
12531 }
12532}
12533
12534#[derive(Bundle)]
12538pub struct BambooRaftMetadataBundle {
12539 _marker: BambooRaft,
12540 parent: AbstractBoatMetadataBundle,
12541}
12542impl Default for BambooRaftMetadataBundle {
12543 fn default() -> Self {
12544 Self {
12545 _marker: BambooRaft,
12546 parent: Default::default(),
12547 }
12548 }
12549}
12550
12551#[derive(Component)]
12571pub struct BirchBoat;
12572impl BirchBoat {
12573 fn apply_metadata(
12574 entity: &mut bevy_ecs::system::EntityCommands,
12575 d: EntityDataItem,
12576 ) -> Result<(), UpdateMetadataError> {
12577 match d.index {
12578 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12579 _ => {}
12580 }
12581 Ok(())
12582 }
12583}
12584
12585#[derive(Bundle)]
12589pub struct BirchBoatMetadataBundle {
12590 _marker: BirchBoat,
12591 parent: AbstractBoatMetadataBundle,
12592}
12593impl Default for BirchBoatMetadataBundle {
12594 fn default() -> Self {
12595 Self {
12596 _marker: BirchBoat,
12597 parent: Default::default(),
12598 }
12599 }
12600}
12601
12602#[derive(Component)]
12622pub struct BirchChestBoat;
12623impl BirchChestBoat {
12624 fn apply_metadata(
12625 entity: &mut bevy_ecs::system::EntityCommands,
12626 d: EntityDataItem,
12627 ) -> Result<(), UpdateMetadataError> {
12628 match d.index {
12629 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12630 _ => {}
12631 }
12632 Ok(())
12633 }
12634}
12635
12636#[derive(Bundle)]
12640pub struct BirchChestBoatMetadataBundle {
12641 _marker: BirchChestBoat,
12642 parent: AbstractBoatMetadataBundle,
12643}
12644impl Default for BirchChestBoatMetadataBundle {
12645 fn default() -> Self {
12646 Self {
12647 _marker: BirchChestBoat,
12648 parent: Default::default(),
12649 }
12650 }
12651}
12652
12653#[derive(Component)]
12673pub struct CherryBoat;
12674impl CherryBoat {
12675 fn apply_metadata(
12676 entity: &mut bevy_ecs::system::EntityCommands,
12677 d: EntityDataItem,
12678 ) -> Result<(), UpdateMetadataError> {
12679 match d.index {
12680 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12681 _ => {}
12682 }
12683 Ok(())
12684 }
12685}
12686
12687#[derive(Bundle)]
12691pub struct CherryBoatMetadataBundle {
12692 _marker: CherryBoat,
12693 parent: AbstractBoatMetadataBundle,
12694}
12695impl Default for CherryBoatMetadataBundle {
12696 fn default() -> Self {
12697 Self {
12698 _marker: CherryBoat,
12699 parent: Default::default(),
12700 }
12701 }
12702}
12703
12704#[derive(Component)]
12724pub struct CherryChestBoat;
12725impl CherryChestBoat {
12726 fn apply_metadata(
12727 entity: &mut bevy_ecs::system::EntityCommands,
12728 d: EntityDataItem,
12729 ) -> Result<(), UpdateMetadataError> {
12730 match d.index {
12731 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12732 _ => {}
12733 }
12734 Ok(())
12735 }
12736}
12737
12738#[derive(Bundle)]
12742pub struct CherryChestBoatMetadataBundle {
12743 _marker: CherryChestBoat,
12744 parent: AbstractBoatMetadataBundle,
12745}
12746impl Default for CherryChestBoatMetadataBundle {
12747 fn default() -> Self {
12748 Self {
12749 _marker: CherryChestBoat,
12750 parent: Default::default(),
12751 }
12752 }
12753}
12754
12755#[derive(Component)]
12775pub struct DarkOakBoat;
12776impl DarkOakBoat {
12777 fn apply_metadata(
12778 entity: &mut bevy_ecs::system::EntityCommands,
12779 d: EntityDataItem,
12780 ) -> Result<(), UpdateMetadataError> {
12781 match d.index {
12782 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12783 _ => {}
12784 }
12785 Ok(())
12786 }
12787}
12788
12789#[derive(Bundle)]
12793pub struct DarkOakBoatMetadataBundle {
12794 _marker: DarkOakBoat,
12795 parent: AbstractBoatMetadataBundle,
12796}
12797impl Default for DarkOakBoatMetadataBundle {
12798 fn default() -> Self {
12799 Self {
12800 _marker: DarkOakBoat,
12801 parent: Default::default(),
12802 }
12803 }
12804}
12805
12806#[derive(Component)]
12826pub struct DarkOakChestBoat;
12827impl DarkOakChestBoat {
12828 fn apply_metadata(
12829 entity: &mut bevy_ecs::system::EntityCommands,
12830 d: EntityDataItem,
12831 ) -> Result<(), UpdateMetadataError> {
12832 match d.index {
12833 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12834 _ => {}
12835 }
12836 Ok(())
12837 }
12838}
12839
12840#[derive(Bundle)]
12844pub struct DarkOakChestBoatMetadataBundle {
12845 _marker: DarkOakChestBoat,
12846 parent: AbstractBoatMetadataBundle,
12847}
12848impl Default for DarkOakChestBoatMetadataBundle {
12849 fn default() -> Self {
12850 Self {
12851 _marker: DarkOakChestBoat,
12852 parent: Default::default(),
12853 }
12854 }
12855}
12856
12857#[derive(Component)]
12877pub struct JungleBoat;
12878impl JungleBoat {
12879 fn apply_metadata(
12880 entity: &mut bevy_ecs::system::EntityCommands,
12881 d: EntityDataItem,
12882 ) -> Result<(), UpdateMetadataError> {
12883 match d.index {
12884 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12885 _ => {}
12886 }
12887 Ok(())
12888 }
12889}
12890
12891#[derive(Bundle)]
12895pub struct JungleBoatMetadataBundle {
12896 _marker: JungleBoat,
12897 parent: AbstractBoatMetadataBundle,
12898}
12899impl Default for JungleBoatMetadataBundle {
12900 fn default() -> Self {
12901 Self {
12902 _marker: JungleBoat,
12903 parent: Default::default(),
12904 }
12905 }
12906}
12907
12908#[derive(Component)]
12928pub struct JungleChestBoat;
12929impl JungleChestBoat {
12930 fn apply_metadata(
12931 entity: &mut bevy_ecs::system::EntityCommands,
12932 d: EntityDataItem,
12933 ) -> Result<(), UpdateMetadataError> {
12934 match d.index {
12935 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12936 _ => {}
12937 }
12938 Ok(())
12939 }
12940}
12941
12942#[derive(Bundle)]
12946pub struct JungleChestBoatMetadataBundle {
12947 _marker: JungleChestBoat,
12948 parent: AbstractBoatMetadataBundle,
12949}
12950impl Default for JungleChestBoatMetadataBundle {
12951 fn default() -> Self {
12952 Self {
12953 _marker: JungleChestBoat,
12954 parent: Default::default(),
12955 }
12956 }
12957}
12958
12959#[derive(Component)]
12979pub struct MangroveBoat;
12980impl MangroveBoat {
12981 fn apply_metadata(
12982 entity: &mut bevy_ecs::system::EntityCommands,
12983 d: EntityDataItem,
12984 ) -> Result<(), UpdateMetadataError> {
12985 match d.index {
12986 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
12987 _ => {}
12988 }
12989 Ok(())
12990 }
12991}
12992
12993#[derive(Bundle)]
12997pub struct MangroveBoatMetadataBundle {
12998 _marker: MangroveBoat,
12999 parent: AbstractBoatMetadataBundle,
13000}
13001impl Default for MangroveBoatMetadataBundle {
13002 fn default() -> Self {
13003 Self {
13004 _marker: MangroveBoat,
13005 parent: Default::default(),
13006 }
13007 }
13008}
13009
13010#[derive(Component)]
13030pub struct MangroveChestBoat;
13031impl MangroveChestBoat {
13032 fn apply_metadata(
13033 entity: &mut bevy_ecs::system::EntityCommands,
13034 d: EntityDataItem,
13035 ) -> Result<(), UpdateMetadataError> {
13036 match d.index {
13037 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
13038 _ => {}
13039 }
13040 Ok(())
13041 }
13042}
13043
13044#[derive(Bundle)]
13048pub struct MangroveChestBoatMetadataBundle {
13049 _marker: MangroveChestBoat,
13050 parent: AbstractBoatMetadataBundle,
13051}
13052impl Default for MangroveChestBoatMetadataBundle {
13053 fn default() -> Self {
13054 Self {
13055 _marker: MangroveChestBoat,
13056 parent: Default::default(),
13057 }
13058 }
13059}
13060
13061#[derive(Component)]
13081pub struct OakBoat;
13082impl OakBoat {
13083 fn apply_metadata(
13084 entity: &mut bevy_ecs::system::EntityCommands,
13085 d: EntityDataItem,
13086 ) -> Result<(), UpdateMetadataError> {
13087 match d.index {
13088 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
13089 _ => {}
13090 }
13091 Ok(())
13092 }
13093}
13094
13095#[derive(Bundle)]
13099pub struct OakBoatMetadataBundle {
13100 _marker: OakBoat,
13101 parent: AbstractBoatMetadataBundle,
13102}
13103impl Default for OakBoatMetadataBundle {
13104 fn default() -> Self {
13105 Self {
13106 _marker: OakBoat,
13107 parent: Default::default(),
13108 }
13109 }
13110}
13111
13112#[derive(Component)]
13132pub struct OakChestBoat;
13133impl OakChestBoat {
13134 fn apply_metadata(
13135 entity: &mut bevy_ecs::system::EntityCommands,
13136 d: EntityDataItem,
13137 ) -> Result<(), UpdateMetadataError> {
13138 match d.index {
13139 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
13140 _ => {}
13141 }
13142 Ok(())
13143 }
13144}
13145
13146#[derive(Bundle)]
13150pub struct OakChestBoatMetadataBundle {
13151 _marker: OakChestBoat,
13152 parent: AbstractBoatMetadataBundle,
13153}
13154impl Default for OakChestBoatMetadataBundle {
13155 fn default() -> Self {
13156 Self {
13157 _marker: OakChestBoat,
13158 parent: Default::default(),
13159 }
13160 }
13161}
13162
13163#[derive(Component)]
13183pub struct PaleOakBoat;
13184impl PaleOakBoat {
13185 fn apply_metadata(
13186 entity: &mut bevy_ecs::system::EntityCommands,
13187 d: EntityDataItem,
13188 ) -> Result<(), UpdateMetadataError> {
13189 match d.index {
13190 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
13191 _ => {}
13192 }
13193 Ok(())
13194 }
13195}
13196
13197#[derive(Bundle)]
13201pub struct PaleOakBoatMetadataBundle {
13202 _marker: PaleOakBoat,
13203 parent: AbstractBoatMetadataBundle,
13204}
13205impl Default for PaleOakBoatMetadataBundle {
13206 fn default() -> Self {
13207 Self {
13208 _marker: PaleOakBoat,
13209 parent: Default::default(),
13210 }
13211 }
13212}
13213
13214#[derive(Component)]
13234pub struct PaleOakChestBoat;
13235impl PaleOakChestBoat {
13236 fn apply_metadata(
13237 entity: &mut bevy_ecs::system::EntityCommands,
13238 d: EntityDataItem,
13239 ) -> Result<(), UpdateMetadataError> {
13240 match d.index {
13241 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
13242 _ => {}
13243 }
13244 Ok(())
13245 }
13246}
13247
13248#[derive(Bundle)]
13252pub struct PaleOakChestBoatMetadataBundle {
13253 _marker: PaleOakChestBoat,
13254 parent: AbstractBoatMetadataBundle,
13255}
13256impl Default for PaleOakChestBoatMetadataBundle {
13257 fn default() -> Self {
13258 Self {
13259 _marker: PaleOakChestBoat,
13260 parent: Default::default(),
13261 }
13262 }
13263}
13264
13265#[derive(Component)]
13285pub struct PoplarBoat;
13286impl PoplarBoat {
13287 fn apply_metadata(
13288 entity: &mut bevy_ecs::system::EntityCommands,
13289 d: EntityDataItem,
13290 ) -> Result<(), UpdateMetadataError> {
13291 match d.index {
13292 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
13293 _ => {}
13294 }
13295 Ok(())
13296 }
13297}
13298
13299#[derive(Bundle)]
13303pub struct PoplarBoatMetadataBundle {
13304 _marker: PoplarBoat,
13305 parent: AbstractBoatMetadataBundle,
13306}
13307impl Default for PoplarBoatMetadataBundle {
13308 fn default() -> Self {
13309 Self {
13310 _marker: PoplarBoat,
13311 parent: Default::default(),
13312 }
13313 }
13314}
13315
13316#[derive(Component)]
13336pub struct PoplarChestBoat;
13337impl PoplarChestBoat {
13338 fn apply_metadata(
13339 entity: &mut bevy_ecs::system::EntityCommands,
13340 d: EntityDataItem,
13341 ) -> Result<(), UpdateMetadataError> {
13342 match d.index {
13343 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
13344 _ => {}
13345 }
13346 Ok(())
13347 }
13348}
13349
13350#[derive(Bundle)]
13354pub struct PoplarChestBoatMetadataBundle {
13355 _marker: PoplarChestBoat,
13356 parent: AbstractBoatMetadataBundle,
13357}
13358impl Default for PoplarChestBoatMetadataBundle {
13359 fn default() -> Self {
13360 Self {
13361 _marker: PoplarChestBoat,
13362 parent: Default::default(),
13363 }
13364 }
13365}
13366
13367#[derive(Component)]
13387pub struct SpruceBoat;
13388impl SpruceBoat {
13389 fn apply_metadata(
13390 entity: &mut bevy_ecs::system::EntityCommands,
13391 d: EntityDataItem,
13392 ) -> Result<(), UpdateMetadataError> {
13393 match d.index {
13394 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
13395 _ => {}
13396 }
13397 Ok(())
13398 }
13399}
13400
13401#[derive(Bundle)]
13405pub struct SpruceBoatMetadataBundle {
13406 _marker: SpruceBoat,
13407 parent: AbstractBoatMetadataBundle,
13408}
13409impl Default for SpruceBoatMetadataBundle {
13410 fn default() -> Self {
13411 Self {
13412 _marker: SpruceBoat,
13413 parent: Default::default(),
13414 }
13415 }
13416}
13417
13418#[derive(Component)]
13438pub struct SpruceChestBoat;
13439impl SpruceChestBoat {
13440 fn apply_metadata(
13441 entity: &mut bevy_ecs::system::EntityCommands,
13442 d: EntityDataItem,
13443 ) -> Result<(), UpdateMetadataError> {
13444 match d.index {
13445 0..=13 => AbstractBoat::apply_metadata(entity, d)?,
13446 _ => {}
13447 }
13448 Ok(())
13449 }
13450}
13451
13452#[derive(Bundle)]
13456pub struct SpruceChestBoatMetadataBundle {
13457 _marker: SpruceChestBoat,
13458 parent: AbstractBoatMetadataBundle,
13459}
13460impl Default for SpruceChestBoatMetadataBundle {
13461 fn default() -> Self {
13462 Self {
13463 _marker: SpruceChestBoat,
13464 parent: Default::default(),
13465 }
13466 }
13467}
13468
13469#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
13471pub struct CustomDisplayBlock(pub azalea_block::BlockState);
13472#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
13474pub struct DisplayOffset(pub i32);
13475#[derive(Component)]
13504pub struct AbstractMinecart;
13505impl AbstractMinecart {
13506 fn apply_metadata(
13507 entity: &mut bevy_ecs::system::EntityCommands,
13508 d: EntityDataItem,
13509 ) -> Result<(), UpdateMetadataError> {
13510 match d.index {
13511 0..=10 => AbstractVehicle::apply_metadata(entity, d)?,
13512 11 => {
13513 entity.insert(CustomDisplayBlock(
13514 d.value
13515 .into_optional_block_state()
13516 .map_err(|v| e(v, d.index, "CustomDisplayBlock"))?,
13517 ));
13518 }
13519 12 => {
13520 entity.insert(DisplayOffset(
13521 d.value
13522 .into_int()
13523 .map_err(|v| e(v, d.index, "DisplayOffset"))?,
13524 ));
13525 }
13526 _ => {}
13527 }
13528 Ok(())
13529 }
13530}
13531
13532#[derive(Bundle)]
13536pub struct AbstractMinecartMetadataBundle {
13537 _marker: AbstractMinecart,
13538 parent: AbstractVehicleMetadataBundle,
13539 custom_display_block: CustomDisplayBlock,
13540 display_offset: DisplayOffset,
13541}
13542impl Default for AbstractMinecartMetadataBundle {
13543 fn default() -> Self {
13544 Self {
13545 _marker: AbstractMinecart,
13546 parent: Default::default(),
13547 custom_display_block: CustomDisplayBlock(azalea_block::BlockState::AIR),
13548 display_offset: DisplayOffset(Default::default()),
13549 }
13550 }
13551}
13552
13553#[derive(Component)]
13573pub struct ChestMinecart;
13574impl ChestMinecart {
13575 fn apply_metadata(
13576 entity: &mut bevy_ecs::system::EntityCommands,
13577 d: EntityDataItem,
13578 ) -> Result<(), UpdateMetadataError> {
13579 match d.index {
13580 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
13581 _ => {}
13582 }
13583 Ok(())
13584 }
13585}
13586
13587#[derive(Bundle)]
13591pub struct ChestMinecartMetadataBundle {
13592 _marker: ChestMinecart,
13593 parent: AbstractMinecartMetadataBundle,
13594}
13595impl Default for ChestMinecartMetadataBundle {
13596 fn default() -> Self {
13597 Self {
13598 _marker: ChestMinecart,
13599 parent: Default::default(),
13600 }
13601 }
13602}
13603
13604#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
13606pub struct CommandName(pub Box<str>);
13607#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
13609pub struct LastOutput(pub Box<FormattedText>);
13610#[derive(Component)]
13635pub struct CommandBlockMinecart;
13636impl CommandBlockMinecart {
13637 fn apply_metadata(
13638 entity: &mut bevy_ecs::system::EntityCommands,
13639 d: EntityDataItem,
13640 ) -> Result<(), UpdateMetadataError> {
13641 match d.index {
13642 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
13643 13 => {
13644 entity.insert(CommandName(
13645 d.value
13646 .into_string()
13647 .map_err(|v| e(v, d.index, "CommandName"))?,
13648 ));
13649 }
13650 14 => {
13651 entity.insert(LastOutput(
13652 d.value
13653 .into_formatted_text()
13654 .map_err(|v| e(v, d.index, "LastOutput"))?,
13655 ));
13656 }
13657 _ => {}
13658 }
13659 Ok(())
13660 }
13661}
13662
13663#[derive(Bundle)]
13667pub struct CommandBlockMinecartMetadataBundle {
13668 _marker: CommandBlockMinecart,
13669 parent: AbstractMinecartMetadataBundle,
13670 command_name: CommandName,
13671 last_output: LastOutput,
13672}
13673impl Default for CommandBlockMinecartMetadataBundle {
13674 fn default() -> Self {
13675 Self {
13676 _marker: CommandBlockMinecart,
13677 parent: Default::default(),
13678 command_name: CommandName("".into()),
13679 last_output: LastOutput(Default::default()),
13680 }
13681 }
13682}
13683
13684#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
13686pub struct Fuel(pub bool);
13687#[derive(Component)]
13710pub struct FurnaceMinecart;
13711impl FurnaceMinecart {
13712 fn apply_metadata(
13713 entity: &mut bevy_ecs::system::EntityCommands,
13714 d: EntityDataItem,
13715 ) -> Result<(), UpdateMetadataError> {
13716 match d.index {
13717 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
13718 13 => {
13719 entity.insert(Fuel(
13720 d.value.into_boolean().map_err(|v| e(v, d.index, "Fuel"))?,
13721 ));
13722 }
13723 _ => {}
13724 }
13725 Ok(())
13726 }
13727}
13728
13729#[derive(Bundle)]
13733pub struct FurnaceMinecartMetadataBundle {
13734 _marker: FurnaceMinecart,
13735 parent: AbstractMinecartMetadataBundle,
13736 fuel: Fuel,
13737}
13738impl Default for FurnaceMinecartMetadataBundle {
13739 fn default() -> Self {
13740 Self {
13741 _marker: FurnaceMinecart,
13742 parent: Default::default(),
13743 fuel: Fuel(false),
13744 }
13745 }
13746}
13747
13748#[derive(Component)]
13768pub struct HopperMinecart;
13769impl HopperMinecart {
13770 fn apply_metadata(
13771 entity: &mut bevy_ecs::system::EntityCommands,
13772 d: EntityDataItem,
13773 ) -> Result<(), UpdateMetadataError> {
13774 match d.index {
13775 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
13776 _ => {}
13777 }
13778 Ok(())
13779 }
13780}
13781
13782#[derive(Bundle)]
13786pub struct HopperMinecartMetadataBundle {
13787 _marker: HopperMinecart,
13788 parent: AbstractMinecartMetadataBundle,
13789}
13790impl Default for HopperMinecartMetadataBundle {
13791 fn default() -> Self {
13792 Self {
13793 _marker: HopperMinecart,
13794 parent: Default::default(),
13795 }
13796 }
13797}
13798
13799#[derive(Component)]
13819pub struct Minecart;
13820impl Minecart {
13821 fn apply_metadata(
13822 entity: &mut bevy_ecs::system::EntityCommands,
13823 d: EntityDataItem,
13824 ) -> Result<(), UpdateMetadataError> {
13825 match d.index {
13826 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
13827 _ => {}
13828 }
13829 Ok(())
13830 }
13831}
13832
13833#[derive(Bundle)]
13837pub struct MinecartMetadataBundle {
13838 _marker: Minecart,
13839 parent: AbstractMinecartMetadataBundle,
13840}
13841impl Default for MinecartMetadataBundle {
13842 fn default() -> Self {
13843 Self {
13844 _marker: Minecart,
13845 parent: Default::default(),
13846 }
13847 }
13848}
13849
13850#[derive(Component)]
13870pub struct SpawnerMinecart;
13871impl SpawnerMinecart {
13872 fn apply_metadata(
13873 entity: &mut bevy_ecs::system::EntityCommands,
13874 d: EntityDataItem,
13875 ) -> Result<(), UpdateMetadataError> {
13876 match d.index {
13877 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
13878 _ => {}
13879 }
13880 Ok(())
13881 }
13882}
13883
13884#[derive(Bundle)]
13888pub struct SpawnerMinecartMetadataBundle {
13889 _marker: SpawnerMinecart,
13890 parent: AbstractMinecartMetadataBundle,
13891}
13892impl Default for SpawnerMinecartMetadataBundle {
13893 fn default() -> Self {
13894 Self {
13895 _marker: SpawnerMinecart,
13896 parent: Default::default(),
13897 }
13898 }
13899}
13900
13901#[derive(Component)]
13921pub struct TntMinecart;
13922impl TntMinecart {
13923 fn apply_metadata(
13924 entity: &mut bevy_ecs::system::EntityCommands,
13925 d: EntityDataItem,
13926 ) -> Result<(), UpdateMetadataError> {
13927 match d.index {
13928 0..=12 => AbstractMinecart::apply_metadata(entity, d)?,
13929 _ => {}
13930 }
13931 Ok(())
13932 }
13933}
13934
13935#[derive(Bundle)]
13939pub struct TntMinecartMetadataBundle {
13940 _marker: TntMinecart,
13941 parent: AbstractMinecartMetadataBundle,
13942}
13943impl Default for TntMinecartMetadataBundle {
13944 fn default() -> Self {
13945 Self {
13946 _marker: TntMinecart,
13947 parent: Default::default(),
13948 }
13949 }
13950}
13951
13952pub fn apply_metadata(
13953 entity: &mut bevy_ecs::system::EntityCommands,
13954 entity_kind: EntityKind,
13955 items: Vec<EntityDataItem>,
13956) -> Result<(), UpdateMetadataError> {
13957 match entity_kind {
13958 EntityKind::AcaciaBoat => {
13959 for d in items {
13960 AcaciaBoat::apply_metadata(entity, d)?;
13961 }
13962 }
13963 EntityKind::AcaciaChestBoat => {
13964 for d in items {
13965 AcaciaChestBoat::apply_metadata(entity, d)?;
13966 }
13967 }
13968 EntityKind::Allay => {
13969 for d in items {
13970 Allay::apply_metadata(entity, d)?;
13971 }
13972 }
13973 EntityKind::AreaEffectCloud => {
13974 for d in items {
13975 AreaEffectCloud::apply_metadata(entity, d)?;
13976 }
13977 }
13978 EntityKind::Armadillo => {
13979 for d in items {
13980 Armadillo::apply_metadata(entity, d)?;
13981 }
13982 }
13983 EntityKind::ArmorStand => {
13984 for d in items {
13985 ArmorStand::apply_metadata(entity, d)?;
13986 }
13987 }
13988 EntityKind::Arrow => {
13989 for d in items {
13990 Arrow::apply_metadata(entity, d)?;
13991 }
13992 }
13993 EntityKind::Axolotl => {
13994 for d in items {
13995 Axolotl::apply_metadata(entity, d)?;
13996 }
13997 }
13998 EntityKind::BambooChestRaft => {
13999 for d in items {
14000 BambooChestRaft::apply_metadata(entity, d)?;
14001 }
14002 }
14003 EntityKind::BambooRaft => {
14004 for d in items {
14005 BambooRaft::apply_metadata(entity, d)?;
14006 }
14007 }
14008 EntityKind::Bat => {
14009 for d in items {
14010 Bat::apply_metadata(entity, d)?;
14011 }
14012 }
14013 EntityKind::Bee => {
14014 for d in items {
14015 Bee::apply_metadata(entity, d)?;
14016 }
14017 }
14018 EntityKind::BirchBoat => {
14019 for d in items {
14020 BirchBoat::apply_metadata(entity, d)?;
14021 }
14022 }
14023 EntityKind::BirchChestBoat => {
14024 for d in items {
14025 BirchChestBoat::apply_metadata(entity, d)?;
14026 }
14027 }
14028 EntityKind::Blaze => {
14029 for d in items {
14030 Blaze::apply_metadata(entity, d)?;
14031 }
14032 }
14033 EntityKind::BlockDisplay => {
14034 for d in items {
14035 BlockDisplay::apply_metadata(entity, d)?;
14036 }
14037 }
14038 EntityKind::Bogged => {
14039 for d in items {
14040 Bogged::apply_metadata(entity, d)?;
14041 }
14042 }
14043 EntityKind::Breeze => {
14044 for d in items {
14045 Breeze::apply_metadata(entity, d)?;
14046 }
14047 }
14048 EntityKind::BreezeWindCharge => {
14049 for d in items {
14050 BreezeWindCharge::apply_metadata(entity, d)?;
14051 }
14052 }
14053 EntityKind::Camel => {
14054 for d in items {
14055 Camel::apply_metadata(entity, d)?;
14056 }
14057 }
14058 EntityKind::CamelHusk => {
14059 for d in items {
14060 CamelHusk::apply_metadata(entity, d)?;
14061 }
14062 }
14063 EntityKind::Cat => {
14064 for d in items {
14065 Cat::apply_metadata(entity, d)?;
14066 }
14067 }
14068 EntityKind::CaveSpider => {
14069 for d in items {
14070 CaveSpider::apply_metadata(entity, d)?;
14071 }
14072 }
14073 EntityKind::CherryBoat => {
14074 for d in items {
14075 CherryBoat::apply_metadata(entity, d)?;
14076 }
14077 }
14078 EntityKind::CherryChestBoat => {
14079 for d in items {
14080 CherryChestBoat::apply_metadata(entity, d)?;
14081 }
14082 }
14083 EntityKind::ChestMinecart => {
14084 for d in items {
14085 ChestMinecart::apply_metadata(entity, d)?;
14086 }
14087 }
14088 EntityKind::Chicken => {
14089 for d in items {
14090 Chicken::apply_metadata(entity, d)?;
14091 }
14092 }
14093 EntityKind::Cod => {
14094 for d in items {
14095 Cod::apply_metadata(entity, d)?;
14096 }
14097 }
14098 EntityKind::CommandBlockMinecart => {
14099 for d in items {
14100 CommandBlockMinecart::apply_metadata(entity, d)?;
14101 }
14102 }
14103 EntityKind::CopperGolem => {
14104 for d in items {
14105 CopperGolem::apply_metadata(entity, d)?;
14106 }
14107 }
14108 EntityKind::Cow => {
14109 for d in items {
14110 Cow::apply_metadata(entity, d)?;
14111 }
14112 }
14113 EntityKind::Creaking => {
14114 for d in items {
14115 Creaking::apply_metadata(entity, d)?;
14116 }
14117 }
14118 EntityKind::Creeper => {
14119 for d in items {
14120 Creeper::apply_metadata(entity, d)?;
14121 }
14122 }
14123 EntityKind::Cushion => {
14124 for d in items {
14125 Cushion::apply_metadata(entity, d)?;
14126 }
14127 }
14128 EntityKind::DarkOakBoat => {
14129 for d in items {
14130 DarkOakBoat::apply_metadata(entity, d)?;
14131 }
14132 }
14133 EntityKind::DarkOakChestBoat => {
14134 for d in items {
14135 DarkOakChestBoat::apply_metadata(entity, d)?;
14136 }
14137 }
14138 EntityKind::Dolphin => {
14139 for d in items {
14140 Dolphin::apply_metadata(entity, d)?;
14141 }
14142 }
14143 EntityKind::Donkey => {
14144 for d in items {
14145 Donkey::apply_metadata(entity, d)?;
14146 }
14147 }
14148 EntityKind::DragonFireball => {
14149 for d in items {
14150 DragonFireball::apply_metadata(entity, d)?;
14151 }
14152 }
14153 EntityKind::Drowned => {
14154 for d in items {
14155 Drowned::apply_metadata(entity, d)?;
14156 }
14157 }
14158 EntityKind::Egg => {
14159 for d in items {
14160 Egg::apply_metadata(entity, d)?;
14161 }
14162 }
14163 EntityKind::ElderGuardian => {
14164 for d in items {
14165 ElderGuardian::apply_metadata(entity, d)?;
14166 }
14167 }
14168 EntityKind::EndCrystal => {
14169 for d in items {
14170 EndCrystal::apply_metadata(entity, d)?;
14171 }
14172 }
14173 EntityKind::EnderDragon => {
14174 for d in items {
14175 EnderDragon::apply_metadata(entity, d)?;
14176 }
14177 }
14178 EntityKind::EnderPearl => {
14179 for d in items {
14180 EnderPearl::apply_metadata(entity, d)?;
14181 }
14182 }
14183 EntityKind::Enderman => {
14184 for d in items {
14185 Enderman::apply_metadata(entity, d)?;
14186 }
14187 }
14188 EntityKind::Endermite => {
14189 for d in items {
14190 Endermite::apply_metadata(entity, d)?;
14191 }
14192 }
14193 EntityKind::Evoker => {
14194 for d in items {
14195 Evoker::apply_metadata(entity, d)?;
14196 }
14197 }
14198 EntityKind::EvokerFangs => {
14199 for d in items {
14200 EvokerFangs::apply_metadata(entity, d)?;
14201 }
14202 }
14203 EntityKind::ExperienceBottle => {
14204 for d in items {
14205 ExperienceBottle::apply_metadata(entity, d)?;
14206 }
14207 }
14208 EntityKind::ExperienceOrb => {
14209 for d in items {
14210 ExperienceOrb::apply_metadata(entity, d)?;
14211 }
14212 }
14213 EntityKind::EyeOfEnder => {
14214 for d in items {
14215 EyeOfEnder::apply_metadata(entity, d)?;
14216 }
14217 }
14218 EntityKind::FallingBlock => {
14219 for d in items {
14220 FallingBlock::apply_metadata(entity, d)?;
14221 }
14222 }
14223 EntityKind::Fireball => {
14224 for d in items {
14225 Fireball::apply_metadata(entity, d)?;
14226 }
14227 }
14228 EntityKind::FireworkRocket => {
14229 for d in items {
14230 FireworkRocket::apply_metadata(entity, d)?;
14231 }
14232 }
14233 EntityKind::FishingBobber => {
14234 for d in items {
14235 FishingBobber::apply_metadata(entity, d)?;
14236 }
14237 }
14238 EntityKind::Fox => {
14239 for d in items {
14240 Fox::apply_metadata(entity, d)?;
14241 }
14242 }
14243 EntityKind::Frog => {
14244 for d in items {
14245 Frog::apply_metadata(entity, d)?;
14246 }
14247 }
14248 EntityKind::FurnaceMinecart => {
14249 for d in items {
14250 FurnaceMinecart::apply_metadata(entity, d)?;
14251 }
14252 }
14253 EntityKind::Ghast => {
14254 for d in items {
14255 Ghast::apply_metadata(entity, d)?;
14256 }
14257 }
14258 EntityKind::Giant => {
14259 for d in items {
14260 Giant::apply_metadata(entity, d)?;
14261 }
14262 }
14263 EntityKind::GlowItemFrame => {
14264 for d in items {
14265 GlowItemFrame::apply_metadata(entity, d)?;
14266 }
14267 }
14268 EntityKind::GlowSquid => {
14269 for d in items {
14270 GlowSquid::apply_metadata(entity, d)?;
14271 }
14272 }
14273 EntityKind::Goat => {
14274 for d in items {
14275 Goat::apply_metadata(entity, d)?;
14276 }
14277 }
14278 EntityKind::Guardian => {
14279 for d in items {
14280 Guardian::apply_metadata(entity, d)?;
14281 }
14282 }
14283 EntityKind::HappyGhast => {
14284 for d in items {
14285 HappyGhast::apply_metadata(entity, d)?;
14286 }
14287 }
14288 EntityKind::Hoglin => {
14289 for d in items {
14290 Hoglin::apply_metadata(entity, d)?;
14291 }
14292 }
14293 EntityKind::HopperMinecart => {
14294 for d in items {
14295 HopperMinecart::apply_metadata(entity, d)?;
14296 }
14297 }
14298 EntityKind::Horse => {
14299 for d in items {
14300 Horse::apply_metadata(entity, d)?;
14301 }
14302 }
14303 EntityKind::Husk => {
14304 for d in items {
14305 Husk::apply_metadata(entity, d)?;
14306 }
14307 }
14308 EntityKind::Illusioner => {
14309 for d in items {
14310 Illusioner::apply_metadata(entity, d)?;
14311 }
14312 }
14313 EntityKind::Interaction => {
14314 for d in items {
14315 Interaction::apply_metadata(entity, d)?;
14316 }
14317 }
14318 EntityKind::IronGolem => {
14319 for d in items {
14320 IronGolem::apply_metadata(entity, d)?;
14321 }
14322 }
14323 EntityKind::Item => {
14324 for d in items {
14325 Item::apply_metadata(entity, d)?;
14326 }
14327 }
14328 EntityKind::ItemDisplay => {
14329 for d in items {
14330 ItemDisplay::apply_metadata(entity, d)?;
14331 }
14332 }
14333 EntityKind::ItemFrame => {
14334 for d in items {
14335 ItemFrame::apply_metadata(entity, d)?;
14336 }
14337 }
14338 EntityKind::JungleBoat => {
14339 for d in items {
14340 JungleBoat::apply_metadata(entity, d)?;
14341 }
14342 }
14343 EntityKind::JungleChestBoat => {
14344 for d in items {
14345 JungleChestBoat::apply_metadata(entity, d)?;
14346 }
14347 }
14348 EntityKind::LeashKnot => {
14349 for d in items {
14350 LeashKnot::apply_metadata(entity, d)?;
14351 }
14352 }
14353 EntityKind::LightningBolt => {
14354 for d in items {
14355 LightningBolt::apply_metadata(entity, d)?;
14356 }
14357 }
14358 EntityKind::LingeringPotion => {
14359 for d in items {
14360 LingeringPotion::apply_metadata(entity, d)?;
14361 }
14362 }
14363 EntityKind::Llama => {
14364 for d in items {
14365 Llama::apply_metadata(entity, d)?;
14366 }
14367 }
14368 EntityKind::LlamaSpit => {
14369 for d in items {
14370 LlamaSpit::apply_metadata(entity, d)?;
14371 }
14372 }
14373 EntityKind::MagmaCube => {
14374 for d in items {
14375 MagmaCube::apply_metadata(entity, d)?;
14376 }
14377 }
14378 EntityKind::MangroveBoat => {
14379 for d in items {
14380 MangroveBoat::apply_metadata(entity, d)?;
14381 }
14382 }
14383 EntityKind::MangroveChestBoat => {
14384 for d in items {
14385 MangroveChestBoat::apply_metadata(entity, d)?;
14386 }
14387 }
14388 EntityKind::Mannequin => {
14389 for d in items {
14390 Mannequin::apply_metadata(entity, d)?;
14391 }
14392 }
14393 EntityKind::Marker => {
14394 for d in items {
14395 Marker::apply_metadata(entity, d)?;
14396 }
14397 }
14398 EntityKind::Minecart => {
14399 for d in items {
14400 Minecart::apply_metadata(entity, d)?;
14401 }
14402 }
14403 EntityKind::Mooshroom => {
14404 for d in items {
14405 Mooshroom::apply_metadata(entity, d)?;
14406 }
14407 }
14408 EntityKind::Mule => {
14409 for d in items {
14410 Mule::apply_metadata(entity, d)?;
14411 }
14412 }
14413 EntityKind::Nautilus => {
14414 for d in items {
14415 Nautilus::apply_metadata(entity, d)?;
14416 }
14417 }
14418 EntityKind::OakBoat => {
14419 for d in items {
14420 OakBoat::apply_metadata(entity, d)?;
14421 }
14422 }
14423 EntityKind::OakChestBoat => {
14424 for d in items {
14425 OakChestBoat::apply_metadata(entity, d)?;
14426 }
14427 }
14428 EntityKind::Ocelot => {
14429 for d in items {
14430 Ocelot::apply_metadata(entity, d)?;
14431 }
14432 }
14433 EntityKind::OminousItemSpawner => {
14434 for d in items {
14435 OminousItemSpawner::apply_metadata(entity, d)?;
14436 }
14437 }
14438 EntityKind::Painting => {
14439 for d in items {
14440 Painting::apply_metadata(entity, d)?;
14441 }
14442 }
14443 EntityKind::PaleOakBoat => {
14444 for d in items {
14445 PaleOakBoat::apply_metadata(entity, d)?;
14446 }
14447 }
14448 EntityKind::PaleOakChestBoat => {
14449 for d in items {
14450 PaleOakChestBoat::apply_metadata(entity, d)?;
14451 }
14452 }
14453 EntityKind::Panda => {
14454 for d in items {
14455 Panda::apply_metadata(entity, d)?;
14456 }
14457 }
14458 EntityKind::Parched => {
14459 for d in items {
14460 Parched::apply_metadata(entity, d)?;
14461 }
14462 }
14463 EntityKind::Parrot => {
14464 for d in items {
14465 Parrot::apply_metadata(entity, d)?;
14466 }
14467 }
14468 EntityKind::Phantom => {
14469 for d in items {
14470 Phantom::apply_metadata(entity, d)?;
14471 }
14472 }
14473 EntityKind::Pig => {
14474 for d in items {
14475 Pig::apply_metadata(entity, d)?;
14476 }
14477 }
14478 EntityKind::Piglin => {
14479 for d in items {
14480 Piglin::apply_metadata(entity, d)?;
14481 }
14482 }
14483 EntityKind::PiglinBrute => {
14484 for d in items {
14485 PiglinBrute::apply_metadata(entity, d)?;
14486 }
14487 }
14488 EntityKind::Pillager => {
14489 for d in items {
14490 Pillager::apply_metadata(entity, d)?;
14491 }
14492 }
14493 EntityKind::Player => {
14494 for d in items {
14495 Player::apply_metadata(entity, d)?;
14496 }
14497 }
14498 EntityKind::PolarBear => {
14499 for d in items {
14500 PolarBear::apply_metadata(entity, d)?;
14501 }
14502 }
14503 EntityKind::PoplarBoat => {
14504 for d in items {
14505 PoplarBoat::apply_metadata(entity, d)?;
14506 }
14507 }
14508 EntityKind::PoplarChestBoat => {
14509 for d in items {
14510 PoplarChestBoat::apply_metadata(entity, d)?;
14511 }
14512 }
14513 EntityKind::Pufferfish => {
14514 for d in items {
14515 Pufferfish::apply_metadata(entity, d)?;
14516 }
14517 }
14518 EntityKind::Rabbit => {
14519 for d in items {
14520 Rabbit::apply_metadata(entity, d)?;
14521 }
14522 }
14523 EntityKind::Ravager => {
14524 for d in items {
14525 Ravager::apply_metadata(entity, d)?;
14526 }
14527 }
14528 EntityKind::Salmon => {
14529 for d in items {
14530 Salmon::apply_metadata(entity, d)?;
14531 }
14532 }
14533 EntityKind::Sheep => {
14534 for d in items {
14535 Sheep::apply_metadata(entity, d)?;
14536 }
14537 }
14538 EntityKind::Shulker => {
14539 for d in items {
14540 Shulker::apply_metadata(entity, d)?;
14541 }
14542 }
14543 EntityKind::ShulkerBullet => {
14544 for d in items {
14545 ShulkerBullet::apply_metadata(entity, d)?;
14546 }
14547 }
14548 EntityKind::Silverfish => {
14549 for d in items {
14550 Silverfish::apply_metadata(entity, d)?;
14551 }
14552 }
14553 EntityKind::Skeleton => {
14554 for d in items {
14555 Skeleton::apply_metadata(entity, d)?;
14556 }
14557 }
14558 EntityKind::SkeletonHorse => {
14559 for d in items {
14560 SkeletonHorse::apply_metadata(entity, d)?;
14561 }
14562 }
14563 EntityKind::Slime => {
14564 for d in items {
14565 Slime::apply_metadata(entity, d)?;
14566 }
14567 }
14568 EntityKind::SmallFireball => {
14569 for d in items {
14570 SmallFireball::apply_metadata(entity, d)?;
14571 }
14572 }
14573 EntityKind::Sniffer => {
14574 for d in items {
14575 Sniffer::apply_metadata(entity, d)?;
14576 }
14577 }
14578 EntityKind::SnowGolem => {
14579 for d in items {
14580 SnowGolem::apply_metadata(entity, d)?;
14581 }
14582 }
14583 EntityKind::Snowball => {
14584 for d in items {
14585 Snowball::apply_metadata(entity, d)?;
14586 }
14587 }
14588 EntityKind::SpawnerMinecart => {
14589 for d in items {
14590 SpawnerMinecart::apply_metadata(entity, d)?;
14591 }
14592 }
14593 EntityKind::SpectralArrow => {
14594 for d in items {
14595 SpectralArrow::apply_metadata(entity, d)?;
14596 }
14597 }
14598 EntityKind::Spider => {
14599 for d in items {
14600 Spider::apply_metadata(entity, d)?;
14601 }
14602 }
14603 EntityKind::SplashPotion => {
14604 for d in items {
14605 SplashPotion::apply_metadata(entity, d)?;
14606 }
14607 }
14608 EntityKind::SpruceBoat => {
14609 for d in items {
14610 SpruceBoat::apply_metadata(entity, d)?;
14611 }
14612 }
14613 EntityKind::SpruceChestBoat => {
14614 for d in items {
14615 SpruceChestBoat::apply_metadata(entity, d)?;
14616 }
14617 }
14618 EntityKind::Squid => {
14619 for d in items {
14620 Squid::apply_metadata(entity, d)?;
14621 }
14622 }
14623 EntityKind::Stray => {
14624 for d in items {
14625 Stray::apply_metadata(entity, d)?;
14626 }
14627 }
14628 EntityKind::Strider => {
14629 for d in items {
14630 Strider::apply_metadata(entity, d)?;
14631 }
14632 }
14633 EntityKind::SulfurCube => {
14634 for d in items {
14635 SulfurCube::apply_metadata(entity, d)?;
14636 }
14637 }
14638 EntityKind::Tadpole => {
14639 for d in items {
14640 Tadpole::apply_metadata(entity, d)?;
14641 }
14642 }
14643 EntityKind::TextDisplay => {
14644 for d in items {
14645 TextDisplay::apply_metadata(entity, d)?;
14646 }
14647 }
14648 EntityKind::Tnt => {
14649 for d in items {
14650 Tnt::apply_metadata(entity, d)?;
14651 }
14652 }
14653 EntityKind::TntMinecart => {
14654 for d in items {
14655 TntMinecart::apply_metadata(entity, d)?;
14656 }
14657 }
14658 EntityKind::TraderLlama => {
14659 for d in items {
14660 TraderLlama::apply_metadata(entity, d)?;
14661 }
14662 }
14663 EntityKind::Trident => {
14664 for d in items {
14665 Trident::apply_metadata(entity, d)?;
14666 }
14667 }
14668 EntityKind::TropicalFish => {
14669 for d in items {
14670 TropicalFish::apply_metadata(entity, d)?;
14671 }
14672 }
14673 EntityKind::Turtle => {
14674 for d in items {
14675 Turtle::apply_metadata(entity, d)?;
14676 }
14677 }
14678 EntityKind::Vex => {
14679 for d in items {
14680 Vex::apply_metadata(entity, d)?;
14681 }
14682 }
14683 EntityKind::Villager => {
14684 for d in items {
14685 Villager::apply_metadata(entity, d)?;
14686 }
14687 }
14688 EntityKind::Vindicator => {
14689 for d in items {
14690 Vindicator::apply_metadata(entity, d)?;
14691 }
14692 }
14693 EntityKind::WanderingTrader => {
14694 for d in items {
14695 WanderingTrader::apply_metadata(entity, d)?;
14696 }
14697 }
14698 EntityKind::Warden => {
14699 for d in items {
14700 Warden::apply_metadata(entity, d)?;
14701 }
14702 }
14703 EntityKind::WindCharge => {
14704 for d in items {
14705 WindCharge::apply_metadata(entity, d)?;
14706 }
14707 }
14708 EntityKind::Witch => {
14709 for d in items {
14710 Witch::apply_metadata(entity, d)?;
14711 }
14712 }
14713 EntityKind::Wither => {
14714 for d in items {
14715 Wither::apply_metadata(entity, d)?;
14716 }
14717 }
14718 EntityKind::WitherSkeleton => {
14719 for d in items {
14720 WitherSkeleton::apply_metadata(entity, d)?;
14721 }
14722 }
14723 EntityKind::WitherSkull => {
14724 for d in items {
14725 WitherSkull::apply_metadata(entity, d)?;
14726 }
14727 }
14728 EntityKind::Wolf => {
14729 for d in items {
14730 Wolf::apply_metadata(entity, d)?;
14731 }
14732 }
14733 EntityKind::Zoglin => {
14734 for d in items {
14735 Zoglin::apply_metadata(entity, d)?;
14736 }
14737 }
14738 EntityKind::Zombie => {
14739 for d in items {
14740 Zombie::apply_metadata(entity, d)?;
14741 }
14742 }
14743 EntityKind::ZombieHorse => {
14744 for d in items {
14745 ZombieHorse::apply_metadata(entity, d)?;
14746 }
14747 }
14748 EntityKind::ZombieNautilus => {
14749 for d in items {
14750 ZombieNautilus::apply_metadata(entity, d)?;
14751 }
14752 }
14753 EntityKind::ZombieVillager => {
14754 for d in items {
14755 ZombieVillager::apply_metadata(entity, d)?;
14756 }
14757 }
14758 EntityKind::ZombifiedPiglin => {
14759 for d in items {
14760 ZombifiedPiglin::apply_metadata(entity, d)?;
14761 }
14762 }
14763 }
14764 Ok(())
14765}
14766
14767pub fn apply_default_metadata(entity: &mut bevy_ecs::system::EntityCommands, kind: EntityKind) {
14768 match kind {
14769 EntityKind::AcaciaBoat => {
14770 entity.insert(AcaciaBoatMetadataBundle::default());
14771 }
14772 EntityKind::AcaciaChestBoat => {
14773 entity.insert(AcaciaChestBoatMetadataBundle::default());
14774 }
14775 EntityKind::Allay => {
14776 entity.insert(AllayMetadataBundle::default());
14777 }
14778 EntityKind::AreaEffectCloud => {
14779 entity.insert(AreaEffectCloudMetadataBundle::default());
14780 }
14781 EntityKind::Armadillo => {
14782 entity.insert(ArmadilloMetadataBundle::default());
14783 }
14784 EntityKind::ArmorStand => {
14785 entity.insert(ArmorStandMetadataBundle::default());
14786 }
14787 EntityKind::Arrow => {
14788 entity.insert(ArrowMetadataBundle::default());
14789 }
14790 EntityKind::Axolotl => {
14791 entity.insert(AxolotlMetadataBundle::default());
14792 }
14793 EntityKind::BambooChestRaft => {
14794 entity.insert(BambooChestRaftMetadataBundle::default());
14795 }
14796 EntityKind::BambooRaft => {
14797 entity.insert(BambooRaftMetadataBundle::default());
14798 }
14799 EntityKind::Bat => {
14800 entity.insert(BatMetadataBundle::default());
14801 }
14802 EntityKind::Bee => {
14803 entity.insert(BeeMetadataBundle::default());
14804 }
14805 EntityKind::BirchBoat => {
14806 entity.insert(BirchBoatMetadataBundle::default());
14807 }
14808 EntityKind::BirchChestBoat => {
14809 entity.insert(BirchChestBoatMetadataBundle::default());
14810 }
14811 EntityKind::Blaze => {
14812 entity.insert(BlazeMetadataBundle::default());
14813 }
14814 EntityKind::BlockDisplay => {
14815 entity.insert(BlockDisplayMetadataBundle::default());
14816 }
14817 EntityKind::Bogged => {
14818 entity.insert(BoggedMetadataBundle::default());
14819 }
14820 EntityKind::Breeze => {
14821 entity.insert(BreezeMetadataBundle::default());
14822 }
14823 EntityKind::BreezeWindCharge => {
14824 entity.insert(BreezeWindChargeMetadataBundle::default());
14825 }
14826 EntityKind::Camel => {
14827 entity.insert(CamelMetadataBundle::default());
14828 }
14829 EntityKind::CamelHusk => {
14830 entity.insert(CamelHuskMetadataBundle::default());
14831 }
14832 EntityKind::Cat => {
14833 entity.insert(CatMetadataBundle::default());
14834 }
14835 EntityKind::CaveSpider => {
14836 entity.insert(CaveSpiderMetadataBundle::default());
14837 }
14838 EntityKind::CherryBoat => {
14839 entity.insert(CherryBoatMetadataBundle::default());
14840 }
14841 EntityKind::CherryChestBoat => {
14842 entity.insert(CherryChestBoatMetadataBundle::default());
14843 }
14844 EntityKind::ChestMinecart => {
14845 entity.insert(ChestMinecartMetadataBundle::default());
14846 }
14847 EntityKind::Chicken => {
14848 entity.insert(ChickenMetadataBundle::default());
14849 }
14850 EntityKind::Cod => {
14851 entity.insert(CodMetadataBundle::default());
14852 }
14853 EntityKind::CommandBlockMinecart => {
14854 entity.insert(CommandBlockMinecartMetadataBundle::default());
14855 }
14856 EntityKind::CopperGolem => {
14857 entity.insert(CopperGolemMetadataBundle::default());
14858 }
14859 EntityKind::Cow => {
14860 entity.insert(CowMetadataBundle::default());
14861 }
14862 EntityKind::Creaking => {
14863 entity.insert(CreakingMetadataBundle::default());
14864 }
14865 EntityKind::Creeper => {
14866 entity.insert(CreeperMetadataBundle::default());
14867 }
14868 EntityKind::Cushion => {
14869 entity.insert(CushionMetadataBundle::default());
14870 }
14871 EntityKind::DarkOakBoat => {
14872 entity.insert(DarkOakBoatMetadataBundle::default());
14873 }
14874 EntityKind::DarkOakChestBoat => {
14875 entity.insert(DarkOakChestBoatMetadataBundle::default());
14876 }
14877 EntityKind::Dolphin => {
14878 entity.insert(DolphinMetadataBundle::default());
14879 }
14880 EntityKind::Donkey => {
14881 entity.insert(DonkeyMetadataBundle::default());
14882 }
14883 EntityKind::DragonFireball => {
14884 entity.insert(DragonFireballMetadataBundle::default());
14885 }
14886 EntityKind::Drowned => {
14887 entity.insert(DrownedMetadataBundle::default());
14888 }
14889 EntityKind::Egg => {
14890 entity.insert(EggMetadataBundle::default());
14891 }
14892 EntityKind::ElderGuardian => {
14893 entity.insert(ElderGuardianMetadataBundle::default());
14894 }
14895 EntityKind::EndCrystal => {
14896 entity.insert(EndCrystalMetadataBundle::default());
14897 }
14898 EntityKind::EnderDragon => {
14899 entity.insert(EnderDragonMetadataBundle::default());
14900 }
14901 EntityKind::EnderPearl => {
14902 entity.insert(EnderPearlMetadataBundle::default());
14903 }
14904 EntityKind::Enderman => {
14905 entity.insert(EndermanMetadataBundle::default());
14906 }
14907 EntityKind::Endermite => {
14908 entity.insert(EndermiteMetadataBundle::default());
14909 }
14910 EntityKind::Evoker => {
14911 entity.insert(EvokerMetadataBundle::default());
14912 }
14913 EntityKind::EvokerFangs => {
14914 entity.insert(EvokerFangsMetadataBundle::default());
14915 }
14916 EntityKind::ExperienceBottle => {
14917 entity.insert(ExperienceBottleMetadataBundle::default());
14918 }
14919 EntityKind::ExperienceOrb => {
14920 entity.insert(ExperienceOrbMetadataBundle::default());
14921 }
14922 EntityKind::EyeOfEnder => {
14923 entity.insert(EyeOfEnderMetadataBundle::default());
14924 }
14925 EntityKind::FallingBlock => {
14926 entity.insert(FallingBlockMetadataBundle::default());
14927 }
14928 EntityKind::Fireball => {
14929 entity.insert(FireballMetadataBundle::default());
14930 }
14931 EntityKind::FireworkRocket => {
14932 entity.insert(FireworkRocketMetadataBundle::default());
14933 }
14934 EntityKind::FishingBobber => {
14935 entity.insert(FishingBobberMetadataBundle::default());
14936 }
14937 EntityKind::Fox => {
14938 entity.insert(FoxMetadataBundle::default());
14939 }
14940 EntityKind::Frog => {
14941 entity.insert(FrogMetadataBundle::default());
14942 }
14943 EntityKind::FurnaceMinecart => {
14944 entity.insert(FurnaceMinecartMetadataBundle::default());
14945 }
14946 EntityKind::Ghast => {
14947 entity.insert(GhastMetadataBundle::default());
14948 }
14949 EntityKind::Giant => {
14950 entity.insert(GiantMetadataBundle::default());
14951 }
14952 EntityKind::GlowItemFrame => {
14953 entity.insert(GlowItemFrameMetadataBundle::default());
14954 }
14955 EntityKind::GlowSquid => {
14956 entity.insert(GlowSquidMetadataBundle::default());
14957 }
14958 EntityKind::Goat => {
14959 entity.insert(GoatMetadataBundle::default());
14960 }
14961 EntityKind::Guardian => {
14962 entity.insert(GuardianMetadataBundle::default());
14963 }
14964 EntityKind::HappyGhast => {
14965 entity.insert(HappyGhastMetadataBundle::default());
14966 }
14967 EntityKind::Hoglin => {
14968 entity.insert(HoglinMetadataBundle::default());
14969 }
14970 EntityKind::HopperMinecart => {
14971 entity.insert(HopperMinecartMetadataBundle::default());
14972 }
14973 EntityKind::Horse => {
14974 entity.insert(HorseMetadataBundle::default());
14975 }
14976 EntityKind::Husk => {
14977 entity.insert(HuskMetadataBundle::default());
14978 }
14979 EntityKind::Illusioner => {
14980 entity.insert(IllusionerMetadataBundle::default());
14981 }
14982 EntityKind::Interaction => {
14983 entity.insert(InteractionMetadataBundle::default());
14984 }
14985 EntityKind::IronGolem => {
14986 entity.insert(IronGolemMetadataBundle::default());
14987 }
14988 EntityKind::Item => {
14989 entity.insert(ItemMetadataBundle::default());
14990 }
14991 EntityKind::ItemDisplay => {
14992 entity.insert(ItemDisplayMetadataBundle::default());
14993 }
14994 EntityKind::ItemFrame => {
14995 entity.insert(ItemFrameMetadataBundle::default());
14996 }
14997 EntityKind::JungleBoat => {
14998 entity.insert(JungleBoatMetadataBundle::default());
14999 }
15000 EntityKind::JungleChestBoat => {
15001 entity.insert(JungleChestBoatMetadataBundle::default());
15002 }
15003 EntityKind::LeashKnot => {
15004 entity.insert(LeashKnotMetadataBundle::default());
15005 }
15006 EntityKind::LightningBolt => {
15007 entity.insert(LightningBoltMetadataBundle::default());
15008 }
15009 EntityKind::LingeringPotion => {
15010 entity.insert(LingeringPotionMetadataBundle::default());
15011 }
15012 EntityKind::Llama => {
15013 entity.insert(LlamaMetadataBundle::default());
15014 }
15015 EntityKind::LlamaSpit => {
15016 entity.insert(LlamaSpitMetadataBundle::default());
15017 }
15018 EntityKind::MagmaCube => {
15019 entity.insert(MagmaCubeMetadataBundle::default());
15020 }
15021 EntityKind::MangroveBoat => {
15022 entity.insert(MangroveBoatMetadataBundle::default());
15023 }
15024 EntityKind::MangroveChestBoat => {
15025 entity.insert(MangroveChestBoatMetadataBundle::default());
15026 }
15027 EntityKind::Mannequin => {
15028 entity.insert(MannequinMetadataBundle::default());
15029 }
15030 EntityKind::Marker => {
15031 entity.insert(MarkerMetadataBundle::default());
15032 }
15033 EntityKind::Minecart => {
15034 entity.insert(MinecartMetadataBundle::default());
15035 }
15036 EntityKind::Mooshroom => {
15037 entity.insert(MooshroomMetadataBundle::default());
15038 }
15039 EntityKind::Mule => {
15040 entity.insert(MuleMetadataBundle::default());
15041 }
15042 EntityKind::Nautilus => {
15043 entity.insert(NautilusMetadataBundle::default());
15044 }
15045 EntityKind::OakBoat => {
15046 entity.insert(OakBoatMetadataBundle::default());
15047 }
15048 EntityKind::OakChestBoat => {
15049 entity.insert(OakChestBoatMetadataBundle::default());
15050 }
15051 EntityKind::Ocelot => {
15052 entity.insert(OcelotMetadataBundle::default());
15053 }
15054 EntityKind::OminousItemSpawner => {
15055 entity.insert(OminousItemSpawnerMetadataBundle::default());
15056 }
15057 EntityKind::Painting => {
15058 entity.insert(PaintingMetadataBundle::default());
15059 }
15060 EntityKind::PaleOakBoat => {
15061 entity.insert(PaleOakBoatMetadataBundle::default());
15062 }
15063 EntityKind::PaleOakChestBoat => {
15064 entity.insert(PaleOakChestBoatMetadataBundle::default());
15065 }
15066 EntityKind::Panda => {
15067 entity.insert(PandaMetadataBundle::default());
15068 }
15069 EntityKind::Parched => {
15070 entity.insert(ParchedMetadataBundle::default());
15071 }
15072 EntityKind::Parrot => {
15073 entity.insert(ParrotMetadataBundle::default());
15074 }
15075 EntityKind::Phantom => {
15076 entity.insert(PhantomMetadataBundle::default());
15077 }
15078 EntityKind::Pig => {
15079 entity.insert(PigMetadataBundle::default());
15080 }
15081 EntityKind::Piglin => {
15082 entity.insert(PiglinMetadataBundle::default());
15083 }
15084 EntityKind::PiglinBrute => {
15085 entity.insert(PiglinBruteMetadataBundle::default());
15086 }
15087 EntityKind::Pillager => {
15088 entity.insert(PillagerMetadataBundle::default());
15089 }
15090 EntityKind::Player => {
15091 entity.insert(PlayerMetadataBundle::default());
15092 }
15093 EntityKind::PolarBear => {
15094 entity.insert(PolarBearMetadataBundle::default());
15095 }
15096 EntityKind::PoplarBoat => {
15097 entity.insert(PoplarBoatMetadataBundle::default());
15098 }
15099 EntityKind::PoplarChestBoat => {
15100 entity.insert(PoplarChestBoatMetadataBundle::default());
15101 }
15102 EntityKind::Pufferfish => {
15103 entity.insert(PufferfishMetadataBundle::default());
15104 }
15105 EntityKind::Rabbit => {
15106 entity.insert(RabbitMetadataBundle::default());
15107 }
15108 EntityKind::Ravager => {
15109 entity.insert(RavagerMetadataBundle::default());
15110 }
15111 EntityKind::Salmon => {
15112 entity.insert(SalmonMetadataBundle::default());
15113 }
15114 EntityKind::Sheep => {
15115 entity.insert(SheepMetadataBundle::default());
15116 }
15117 EntityKind::Shulker => {
15118 entity.insert(ShulkerMetadataBundle::default());
15119 }
15120 EntityKind::ShulkerBullet => {
15121 entity.insert(ShulkerBulletMetadataBundle::default());
15122 }
15123 EntityKind::Silverfish => {
15124 entity.insert(SilverfishMetadataBundle::default());
15125 }
15126 EntityKind::Skeleton => {
15127 entity.insert(SkeletonMetadataBundle::default());
15128 }
15129 EntityKind::SkeletonHorse => {
15130 entity.insert(SkeletonHorseMetadataBundle::default());
15131 }
15132 EntityKind::Slime => {
15133 entity.insert(SlimeMetadataBundle::default());
15134 }
15135 EntityKind::SmallFireball => {
15136 entity.insert(SmallFireballMetadataBundle::default());
15137 }
15138 EntityKind::Sniffer => {
15139 entity.insert(SnifferMetadataBundle::default());
15140 }
15141 EntityKind::SnowGolem => {
15142 entity.insert(SnowGolemMetadataBundle::default());
15143 }
15144 EntityKind::Snowball => {
15145 entity.insert(SnowballMetadataBundle::default());
15146 }
15147 EntityKind::SpawnerMinecart => {
15148 entity.insert(SpawnerMinecartMetadataBundle::default());
15149 }
15150 EntityKind::SpectralArrow => {
15151 entity.insert(SpectralArrowMetadataBundle::default());
15152 }
15153 EntityKind::Spider => {
15154 entity.insert(SpiderMetadataBundle::default());
15155 }
15156 EntityKind::SplashPotion => {
15157 entity.insert(SplashPotionMetadataBundle::default());
15158 }
15159 EntityKind::SpruceBoat => {
15160 entity.insert(SpruceBoatMetadataBundle::default());
15161 }
15162 EntityKind::SpruceChestBoat => {
15163 entity.insert(SpruceChestBoatMetadataBundle::default());
15164 }
15165 EntityKind::Squid => {
15166 entity.insert(SquidMetadataBundle::default());
15167 }
15168 EntityKind::Stray => {
15169 entity.insert(StrayMetadataBundle::default());
15170 }
15171 EntityKind::Strider => {
15172 entity.insert(StriderMetadataBundle::default());
15173 }
15174 EntityKind::SulfurCube => {
15175 entity.insert(SulfurCubeMetadataBundle::default());
15176 }
15177 EntityKind::Tadpole => {
15178 entity.insert(TadpoleMetadataBundle::default());
15179 }
15180 EntityKind::TextDisplay => {
15181 entity.insert(TextDisplayMetadataBundle::default());
15182 }
15183 EntityKind::Tnt => {
15184 entity.insert(TntMetadataBundle::default());
15185 }
15186 EntityKind::TntMinecart => {
15187 entity.insert(TntMinecartMetadataBundle::default());
15188 }
15189 EntityKind::TraderLlama => {
15190 entity.insert(TraderLlamaMetadataBundle::default());
15191 }
15192 EntityKind::Trident => {
15193 entity.insert(TridentMetadataBundle::default());
15194 }
15195 EntityKind::TropicalFish => {
15196 entity.insert(TropicalFishMetadataBundle::default());
15197 }
15198 EntityKind::Turtle => {
15199 entity.insert(TurtleMetadataBundle::default());
15200 }
15201 EntityKind::Vex => {
15202 entity.insert(VexMetadataBundle::default());
15203 }
15204 EntityKind::Villager => {
15205 entity.insert(VillagerMetadataBundle::default());
15206 }
15207 EntityKind::Vindicator => {
15208 entity.insert(VindicatorMetadataBundle::default());
15209 }
15210 EntityKind::WanderingTrader => {
15211 entity.insert(WanderingTraderMetadataBundle::default());
15212 }
15213 EntityKind::Warden => {
15214 entity.insert(WardenMetadataBundle::default());
15215 }
15216 EntityKind::WindCharge => {
15217 entity.insert(WindChargeMetadataBundle::default());
15218 }
15219 EntityKind::Witch => {
15220 entity.insert(WitchMetadataBundle::default());
15221 }
15222 EntityKind::Wither => {
15223 entity.insert(WitherMetadataBundle::default());
15224 }
15225 EntityKind::WitherSkeleton => {
15226 entity.insert(WitherSkeletonMetadataBundle::default());
15227 }
15228 EntityKind::WitherSkull => {
15229 entity.insert(WitherSkullMetadataBundle::default());
15230 }
15231 EntityKind::Wolf => {
15232 entity.insert(WolfMetadataBundle::default());
15233 }
15234 EntityKind::Zoglin => {
15235 entity.insert(ZoglinMetadataBundle::default());
15236 }
15237 EntityKind::Zombie => {
15238 entity.insert(ZombieMetadataBundle::default());
15239 }
15240 EntityKind::ZombieHorse => {
15241 entity.insert(ZombieHorseMetadataBundle::default());
15242 }
15243 EntityKind::ZombieNautilus => {
15244 entity.insert(ZombieNautilusMetadataBundle::default());
15245 }
15246 EntityKind::ZombieVillager => {
15247 entity.insert(ZombieVillagerMetadataBundle::default());
15248 }
15249 EntityKind::ZombifiedPiglin => {
15250 entity.insert(ZombifiedPiglinMetadataBundle::default());
15251 }
15252 }
15253}