diff --git a/common/src/state.rs b/common/src/state.rs index 179f6ee360..f6d9084ee7 100644 --- a/common/src/state.rs +++ b/common/src/state.rs @@ -314,15 +314,15 @@ impl State { &mut self.ecs.write_resource::().blocks, Default::default(), ); - + // Process local events let events = self.ecs.read_resource::>().recv_all(); for event in events { { let mut velocities = self.ecs.write_storage::(); let mut force_updates = self.ecs.write_storage::(); - - match event { + + match event { LocalEvent::Jump(entity) => { if let Some(vel) = velocities.get_mut(entity) { vel.0.z = HUMANOID_JUMP_ACCEL; @@ -333,7 +333,7 @@ impl State { } } } - + /// Clean up the state after a tick. pub fn cleanup(&mut self) { // Clean up data structures from the last tick. diff --git a/common/src/sys/controller.rs b/common/src/sys/controller.rs index 7d71080db7..f97db742e3 100644 --- a/common/src/sys/controller.rs +++ b/common/src/sys/controller.rs @@ -3,7 +3,7 @@ use crate::{ ActionState::*, Body, CharacterState, Controller, MovementState::*, PhysicsState, Stats, Vel, }, - event::{EventBus, ServerEvent, LocalEvent}, + event::{EventBus, LocalEvent, ServerEvent}, }; use specs::{Entities, Join, Read, ReadStorage, System, WriteStorage}; use std::time::Duration; @@ -140,7 +140,7 @@ impl<'a> System<'a> for Sys { time_left: Duration::from_millis(600), }; } - + // Jump if controller.jump && physics.on_ground && vel.0.z <= 0.0 { local_emitter.emit(LocalEvent::Jump(entity)); diff --git a/common/src/sys/phys.rs b/common/src/sys/phys.rs index ad31ff7188..1d379dbb4c 100644 --- a/common/src/sys/phys.rs +++ b/common/src/sys/phys.rs @@ -1,7 +1,7 @@ use { crate::{ comp::{Body, MovementState::*, Ori, PhysicsState, Pos, Scale, Stats, Vel}, - event::{ServerEvent, EventBus}, + event::{EventBus, ServerEvent}, state::DeltaTime, terrain::TerrainMap, vol::{ReadVol, Vox}, diff --git a/common/src/sys/stats.rs b/common/src/sys/stats.rs index e461a1fad7..3aeb11746d 100644 --- a/common/src/sys/stats.rs +++ b/common/src/sys/stats.rs @@ -1,6 +1,6 @@ use crate::{ comp::{HealthSource, Stats}, - event::{ServerEvent, EventBus}, + event::{EventBus, ServerEvent}, state::DeltaTime, }; use log::warn; diff --git a/server/src/cmd.rs b/server/src/cmd.rs index 675cee77b4..f920f1d0f6 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -6,7 +6,7 @@ use crate::Server; use chrono::{NaiveTime, Timelike}; use common::{ comp, - event::{ServerEvent, EventBus}, + event::{EventBus, ServerEvent}, msg::ServerMsg, npc::{get_npc_name, NpcKind}, state::TimeOfDay, diff --git a/voxygen/src/anim/character/block.rs b/voxygen/src/anim/character/block.rs index f1b98b7ac0..72e08d2a05 100644 --- a/voxygen/src/anim/character/block.rs +++ b/voxygen/src/anim/character/block.rs @@ -45,16 +45,17 @@ impl Animation for BlockAnimation { 1.0 + skeleton_attr.neck_forward, skeleton_attr.neck_height + 13.5 + wave_ultra_slow * 0.2, ); - next.head.ori = - Quaternion::rotation_x(-0.25); + next.head.ori = Quaternion::rotation_x(-0.25); next.head.scale = Vec3::one() * 1.01 * skeleton_attr.head_scale; next.chest.offset = Vec3::new(0.0 + wave_slow_cos * 0.2, 0.0, 5.0 + wave_ultra_slow * 0.2); - next.chest.ori = Quaternion::rotation_x(-0.15) * Quaternion::rotation_y(wave_ultra_slow_cos * 0.01); + next.chest.ori = + Quaternion::rotation_x(-0.15) * Quaternion::rotation_y(wave_ultra_slow_cos * 0.01); next.chest.scale = Vec3::one(); next.belt.offset = Vec3::new(0.0 + wave_slow_cos * 0.2, 0.0, 3.0 + wave_ultra_slow * 0.2); - next.belt.ori = Quaternion::rotation_x(0.0) * Quaternion::rotation_y(wave_ultra_slow_cos * 0.008); + next.belt.ori = + Quaternion::rotation_x(0.0) * Quaternion::rotation_y(wave_ultra_slow_cos * 0.008); next.belt.scale = Vec3::one() * 1.01; next.shorts.offset = Vec3::new(0.0 + wave_slow_cos * 0.2, 0.0, 1.0 + wave_ultra_slow * 0.2); @@ -64,18 +65,10 @@ impl Animation for BlockAnimation { match Tool::Hammer { //TODO: Inventory Tool::Sword => { - next.l_hand.offset = Vec3::new( - -6.0, - 3.5, - 0.0 + wave_ultra_slow * 1.0, - ); + next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0 + wave_ultra_slow * 1.0); next.l_hand.ori = Quaternion::rotation_x(-0.3); next.l_hand.scale = Vec3::one() * 1.01; - next.r_hand.offset = Vec3::new( - -6.0, - 3.0, - -2.0, - ); + next.r_hand.offset = Vec3::new(-6.0, 3.0, -2.0); next.r_hand.ori = Quaternion::rotation_x(-0.3); next.r_hand.scale = Vec3::one() * 1.01; next.weapon.offset = Vec3::new( diff --git a/voxygen/src/anim/character/mod.rs b/voxygen/src/anim/character/mod.rs index e497818193..138ca93a2b 100644 --- a/voxygen/src/anim/character/mod.rs +++ b/voxygen/src/anim/character/mod.rs @@ -1,4 +1,5 @@ pub mod attack; +pub mod block; pub mod cidle; pub mod cjump; pub mod crun; @@ -7,10 +8,10 @@ pub mod idle; pub mod jump; pub mod roll; pub mod run; -pub mod block; // Reexports pub use self::attack::AttackAnimation; +pub use self::block::BlockAnimation; pub use self::cidle::CidleAnimation; pub use self::cjump::CjumpAnimation; pub use self::crun::CrunAnimation; @@ -19,8 +20,6 @@ pub use self::idle::IdleAnimation; pub use self::jump::JumpAnimation; pub use self::roll::RollAnimation; pub use self::run::RunAnimation; -pub use self::block::BlockAnimation; - use super::{Bone, Skeleton}; use crate::render::FigureBoneData; diff --git a/voxygen/src/scene/figure.rs b/voxygen/src/scene/figure.rs index 4843d7dd6c..ece30c60ec 100644 --- a/voxygen/src/scene/figure.rs +++ b/voxygen/src/scene/figure.rs @@ -693,14 +693,12 @@ impl FigureMgr { skeleton_attr, ) } - comp::Animation::Block => { - anim::character::BlockAnimation::update_skeleton( - state.skeleton_mut(), - time, - animation_info.time, - skeleton_attr, - ) - } + comp::Animation::Block => anim::character::BlockAnimation::update_skeleton( + state.skeleton_mut(), + time, + animation_info.time, + skeleton_attr, + ), comp::Animation::Cjump => anim::character::CjumpAnimation::update_skeleton( state.skeleton_mut(), time,