From 799b3588396aea3fee3513cb71973200735c769f Mon Sep 17 00:00:00 2001 From: Andrew Gazelka Date: Fri, 20 Dec 2024 00:05:33 -0800 Subject: [PATCH] fix --- crates/hyperion/src/lib.rs | 2 +- crates/hyperion/src/simulation/event.rs | 3 +-- crates/hyperion/src/simulation/mod.rs | 4 ++-- crates/hyperion/src/spatial/mod.rs | 5 +++-- crates/hyperion/tests/spatial.rs | 4 +++- events/tag/src/command/raycast.rs | 2 +- events/tag/src/module/bow.rs | 4 ++-- 7 files changed, 13 insertions(+), 11 deletions(-) diff --git a/crates/hyperion/src/lib.rs b/crates/hyperion/src/lib.rs index 97fbc349..104a5343 100644 --- a/crates/hyperion/src/lib.rs +++ b/crates/hyperion/src/lib.rs @@ -87,8 +87,8 @@ pub mod egress; pub mod ingress; pub mod net; pub mod simulation; -pub mod storage; pub mod spatial; +pub mod storage; /// Relationship for previous values #[derive(Component)] diff --git a/crates/hyperion/src/simulation/event.rs b/crates/hyperion/src/simulation/event.rs index b8fc80a6..8c37ff95 100644 --- a/crates/hyperion/src/simulation/event.rs +++ b/crates/hyperion/src/simulation/event.rs @@ -7,9 +7,8 @@ use valence_generated::block::BlockState; use valence_protocol::Hand; use valence_server::{ItemKind, entity::item_frame::ItemStack}; -use crate::simulation::skin::PlayerSkin; - use super::blocks::RayCollision; +use crate::simulation::skin::PlayerSkin; #[derive(Component, Default, Debug)] pub struct ItemDropEvent { diff --git a/crates/hyperion/src/simulation/mod.rs b/crates/hyperion/src/simulation/mod.rs index a64ae8c1..20e49c68 100644 --- a/crates/hyperion/src/simulation/mod.rs +++ b/crates/hyperion/src/simulation/mod.rs @@ -626,8 +626,8 @@ impl Module for SimModule { world.component::(); - /* world.component::(); - component!(world, BowCharging).opaque_func(meta_ser_stringify_type_display::); */ + // world.component::(); + // component!(world, BowCharging).opaque_func(meta_ser_stringify_type_display::); observer!( world, diff --git a/crates/hyperion/src/spatial/mod.rs b/crates/hyperion/src/spatial/mod.rs index 3e0da6cb..bc994c8a 100644 --- a/crates/hyperion/src/spatial/mod.rs +++ b/crates/hyperion/src/spatial/mod.rs @@ -7,6 +7,9 @@ use flecs_ecs::{ prelude::Module, }; use geometry::{aabb::Aabb, ray::Ray}; +use ordered_float::NotNan; +use rayon::iter::Either; + use super::{ egress::player_join::RayonWorldStages, glam::Vec3, @@ -15,8 +18,6 @@ use super::{ blocks::{Blocks, RayCollision}, }, }; -use ordered_float::NotNan; -use rayon::iter::Either; #[derive(Component)] pub struct SpatialModule; diff --git a/crates/hyperion/tests/spatial.rs b/crates/hyperion/tests/spatial.rs index bb4cbd4c..e65ed951 100644 --- a/crates/hyperion/tests/spatial.rs +++ b/crates/hyperion/tests/spatial.rs @@ -12,7 +12,9 @@ use flecs_ecs::core::{QueryBuilderImpl, SystemAPI, World, WorldGet, flecs}; use geometry::{aabb::Aabb, ray::Ray}; use glam::Vec3; use hyperion::{ - simulation::{entity_kind::EntityKind, EntitySize, Position}, spatial, HyperionCore + HyperionCore, + simulation::{EntitySize, Position, entity_kind::EntityKind}, + spatial, }; use spatial::{Spatial, SpatialIndex, SpatialModule}; diff --git a/events/tag/src/command/raycast.rs b/events/tag/src/command/raycast.rs index db575863..284f1c54 100644 --- a/events/tag/src/command/raycast.rs +++ b/events/tag/src/command/raycast.rs @@ -2,8 +2,8 @@ use clap::Parser; use flecs_ecs::core::{Entity, EntityView, EntityViewGet, WorldProvider}; use hyperion::{ glam::Vec3, - spatial::get_first_collision, simulation::{Pitch, Position, Yaw, entity_kind::EntityKind}, + spatial::get_first_collision, }; use hyperion_clap::{CommandPermission, MinecraftCommand}; use rayon::iter::Either; diff --git a/events/tag/src/module/bow.rs b/events/tag/src/module/bow.rs index 73600b2e..d360d8bb 100644 --- a/events/tag/src/module/bow.rs +++ b/events/tag/src/module/bow.rs @@ -124,7 +124,6 @@ impl Module for BowModule { world, &mut EventQueue($), ) - .multi_threaded() .kind::() .each_iter(move |it, _, event_queue| { let _system = it.system(); @@ -196,7 +195,8 @@ impl Module for BowModule { debug!("Arrow spawn position: {:?}", spawn_pos); - world.entity() + world + .entity() .add_enum(EntityKind::Arrow) .set(Uuid::new_v4()) .set(Position::new(spawn_pos.x, spawn_pos.y, spawn_pos.z))