Skip to content

Commit 9d32f7f

Browse files
committed
feat: improve component meta
1 parent ac6ac18 commit 9d32f7f

File tree

1 file changed

+19
-10
lines changed
  • crates/hyperion/src/simulation

1 file changed

+19
-10
lines changed

crates/hyperion/src/simulation/mod.rs

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ use bytemuck::{Pod, Zeroable};
44
use derive_more::{Deref, DerefMut, Display, From};
55
use flecs_ecs::prelude::*;
66
use geometry::aabb::{Aabb, HasAabb};
7-
use glam::{IVec2, IVec3, Vec3};
7+
use glam::{IVec2, IVec3, Quat, Vec3};
88
use rustc_hash::FxHashMap;
99
use serde::{Deserialize, Serialize};
1010
use skin::PlayerSkin;
1111
use uuid;
12+
use valence_generated::block::BlockState;
1213
use valence_protocol::VarInt;
1314

1415
use crate::{
@@ -529,16 +530,13 @@ impl Module for SimModule {
529530
fn module(world: &World) {
530531
component!(world, VarInt).member::<i32>("x");
531532

532-
world.component::<MetadataPrefabs>();
533-
world.component::<EntityFlags>();
534-
let prefabs = metadata::register_prefabs(world);
535-
536-
world.set(prefabs);
533+
component!(world, Quat)
534+
.member::<f32>("x")
535+
.member::<f32>("y")
536+
.member::<f32>("z")
537+
.member::<f32>("w");
537538

538-
world.component::<Xp>();
539-
540-
world.component::<PlayerSkin>();
541-
world.component::<Command>();
539+
component!(world, BlockState).member::<u16>("id");
542540

543541
component!(world, EntitySize).opaque_func(meta_ser_stringify_type_display::<EntitySize>);
544542
component!(world, IVec3 {
@@ -552,6 +550,17 @@ impl Module for SimModule {
552550
z: f32
553551
});
554552

553+
world.component::<MetadataPrefabs>();
554+
world.component::<EntityFlags>();
555+
let prefabs = metadata::register_prefabs(world);
556+
557+
world.set(prefabs);
558+
559+
world.component::<Xp>();
560+
561+
world.component::<PlayerSkin>();
562+
world.component::<Command>();
563+
555564
component!(world, IgnMap);
556565

557566
world.component::<Position>().meta();

0 commit comments

Comments
 (0)