Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgazelka committed Nov 17, 2024
1 parent 866e8fe commit ea70816
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 47 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[profile]
[profile.release-debug]
debug = true
inherits = 'release'
Expand Down
4 changes: 2 additions & 2 deletions crates/hyperion-item/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use derive_more::{Constructor, Deref, DerefMut};
use flecs_ecs::{
core::{EntityViewGet, QueryBuilderImpl, SystemAPI, TermBuilderImpl, World, WorldGet},
core::{EntityViewGet, World, WorldGet},
macros::Component,
prelude::Module,
};
use hyperion::storage::{EventHandler, EventHandlers, GlobalEventHandlers};
use hyperion::storage::{EventHandler, GlobalEventHandlers};
use valence_protocol::{nbt, Hand};

pub mod builder;
Expand Down
1 change: 0 additions & 1 deletion crates/hyperion-rank-tree/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ toml = { workspace = true }
valence_protocol = { workspace = true }
clap = { workspace = true }
flecs_ecs = { workspace = true }
bytemuck = { workspace = true }
hyperion-item.workspace = true

[lints]
Expand Down
7 changes: 3 additions & 4 deletions crates/hyperion-rank-tree/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use clap::ValueEnum;
use flecs_ecs::{
core::{Entity, IdOperations, World, WorldGet},
core::{Entity, IdOperations, World},
macros::Component,
prelude::Module,
};
use hyperion::{net::Compose, storage::EventHandler};
use valence_protocol::Hand;
use hyperion::storage::EventHandler;

pub mod inventory;
pub mod skin;
Expand Down Expand Up @@ -49,7 +48,7 @@ impl Module for RankTree {
world.component::<Rank>();
world.component::<Handles>();

let handler = EventHandler::new(|query, hand| {
let handler = EventHandler::new(|query, _| {
let cursor = query.inventory.get_cursor();
println!("clicked {cursor:?}");
});
Expand Down
33 changes: 1 addition & 32 deletions crates/hyperion/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub use uuid;
// todo: slowly move more and more things to arbitrary module
// and then eventually do not re-export valence_protocol
pub use valence_protocol;
use valence_protocol::{CompressionThreshold, Encode, Hand, Packet};
use valence_protocol::{CompressionThreshold, Encode, Packet};
pub use valence_protocol::{
ItemKind, ItemStack, Particle,
block::{BlockKind, BlockState},
Expand All @@ -68,7 +68,6 @@ use crate::{
runtime::Tasks,
simulation::{
EgressComm, EntitySize, IgnMap, PacketState, Player,
handlers::PacketSwitchQuery,
metadata::{EntityFlags, Pose},
},
util::mojang::ApiProvider,
Expand Down Expand Up @@ -136,11 +135,6 @@ pub fn adjust_file_descriptor_limits(recommended_min: u64) -> std::io::Result<()
Ok(())
}

#[derive(Component)]
pub struct ClickEventHandlers {
fns: Vec<fn(&mut PacketSwitchQuery<'_>, Hand)>,
}

/// The central [`Hyperion`] struct which owns and manages the entire server.
pub struct Hyperion;

Expand Down Expand Up @@ -336,31 +330,6 @@ impl Hyperion {
app.run();

bail!("app exited");

// loop {
// let tick_each_ms = 50.0;
//
// let start = std::time::Instant::now();
//
// tracing::info_span!("tick").in_scope(|| {

// world.progress();
// });
//
// let elapsed = start.elapsed();
//
// let ms_last_tick = elapsed.as_secs_f32() * 1000.0;
//
// if ms_last_tick < tick_each_ms {
// let remaining = tick_each_ms - ms_last_tick;
// let remaining = Duration::from_secs_f32(remaining / 1000.0);
// std::thread::sleep(remaining);
// }
//
// world.get::<&mut Compose>(|compose| {
// compose.global_mut().ms_last_tick = ms_last_tick;
// });
// }
}
}

Expand Down
3 changes: 1 addition & 2 deletions crates/hyperion/src/simulation/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use glam::{IVec3, Vec3};
use hyperion_utils::EntityExt;
use tracing::{info, instrument, trace, warn};
use valence_generated::block::{BlockKind, BlockState, PropName};
use valence_nbt::Value;
use valence_protocol::{
Decode, Hand, ItemStack, Packet, VarInt,
packets::play::{
Expand All @@ -21,7 +20,7 @@ use valence_protocol::{
use valence_text::IntoText;

use super::{
ConfirmBlockSequences, EntitySize, Name, Position,
ConfirmBlockSequences, EntitySize, Position,
animation::{self, ActiveAnimation},
block_bounds,
blocks::Blocks,
Expand Down
5 changes: 1 addition & 4 deletions crates/hyperion/src/storage/event/sync.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use flecs_ecs::{
core::{Entity, World},
macros::Component,
};
use flecs_ecs::{core::Entity, macros::Component};
use valence_protocol::Hand;

use crate::simulation::handlers::PacketSwitchQuery;
Expand Down

0 comments on commit ea70816

Please sign in to comment.