From cb1f61b9913379d206e637296597f395c1bbdd82 Mon Sep 17 00:00:00 2001 From: Andrew Gazelka Date: Mon, 11 Nov 2024 13:11:53 -0800 Subject: [PATCH] chore: update dependencies and clean up imports - Update various crate versions in `Cargo.lock` - Replace `fxhash` dependency with `hashbrown` in `flecs_ecs` - Clean up and organize imports in command modules - Fix minor formatting issues in `fly.rs` and `speed.rs` Key updates: - `anyhow` -> 1.0.93 - `flecs_ecs` -> latest git revision - `tokio` -> 1.41.1 --- Cargo.lock | 148 +++++++++---------- events/proof-of-concept/src/command.rs | 3 +- events/proof-of-concept/src/command/fly.rs | 2 +- events/proof-of-concept/src/command/speed.rs | 12 +- events/proof-of-concept/src/lib.rs | 8 +- 5 files changed, 80 insertions(+), 93 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 23d48c25..af1408bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -66,9 +66,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" [[package]] name = "anes" @@ -127,9 +127,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f37166d7d48a0284b99dd824694c26119c700b53bf0d1540cdb147dbdaaf13" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" dependencies = [ "backtrace", ] @@ -168,8 +168,8 @@ checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" dependencies = [ "async-task", "concurrent-queue", - "fastrand 2.1.1", - "futures-lite 2.4.0", + "fastrand 2.2.0", + "futures-lite 2.5.0", "slab", ] @@ -264,7 +264,7 @@ dependencies = [ "fixedbitset", "rustc-hash 1.1.0", "serde", - "thiserror 1.0.68", + "thiserror 1.0.69", "thread_local", ] @@ -326,7 +326,7 @@ dependencies = [ "instant", "nonmax", "petgraph", - "thiserror 1.0.68", + "thiserror 1.0.69", "tracing", "uuid", ] @@ -453,7 +453,7 @@ dependencies = [ "arrayvec", "criterion", "divan", - "fastrand 2.1.1", + "fastrand 2.2.0", "glam", "itertools 0.13.0", "ordered-float", @@ -548,9 +548,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.34" +version = "1.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b9470d453346108f93a59222a9a1a5724db32d0a4727b7ab7ace4b4d822dc9" +checksum = "40545c26d092346d8a8dab71ee48e7685a7a9cba76e634790c215b41a4a7b4cf" dependencies = [ "shlex", ] @@ -763,9 +763,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6" dependencies = [ "libc", ] @@ -1127,9 +1127,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "fdeflate" @@ -1172,19 +1172,19 @@ dependencies = [ [[package]] name = "flecs_ecs" version = "0.1.3" -source = "git+https://github.com/Indra-db/Flecs-Rust#98b53fb037a4ebbf20e063f001df2d53770fb28a" +source = "git+https://github.com/Indra-db/Flecs-Rust#77a030d0969984a6313a723d2b0e8d2f06eaa5f1" dependencies = [ "bitflags 2.6.0", "compact_str", "flecs_ecs_derive", "flecs_ecs_sys", - "fxhash", + "hashbrown 0.15.1", ] [[package]] name = "flecs_ecs_derive" version = "0.1.0" -source = "git+https://github.com/Indra-db/Flecs-Rust#98b53fb037a4ebbf20e063f001df2d53770fb28a" +source = "git+https://github.com/Indra-db/Flecs-Rust#77a030d0969984a6313a723d2b0e8d2f06eaa5f1" dependencies = [ "proc-macro2", "quote", @@ -1194,7 +1194,7 @@ dependencies = [ [[package]] name = "flecs_ecs_sys" version = "0.1.2" -source = "git+https://github.com/Indra-db/Flecs-Rust#98b53fb037a4ebbf20e063f001df2d53770fb28a" +source = "git+https://github.com/Indra-db/Flecs-Rust#77a030d0969984a6313a723d2b0e8d2f06eaa5f1" dependencies = [ "bindgen", "cc", @@ -1282,11 +1282,11 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f1fa2f9765705486b33fd2acf1577f8ec449c2ba1f318ae5447697b7c08d210" +checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" dependencies = [ - "fastrand 2.1.1", + "fastrand 2.2.0", "futures-core", "futures-io", "parking", @@ -1333,15 +1333,6 @@ dependencies = [ "slab", ] -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "generator" version = "0.8.3" @@ -1396,9 +1387,9 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glam" -version = "0.29.1" +version = "0.29.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "480c9417a5dc586fc0c0cb67891170e59cc11e9dc79ba1c11ddd2c56ca3f3b90" +checksum = "dc46dd3ec48fdd8e693a98d2b8bafae273a2d54c1de02a2a7e3d57d501f39677" dependencies = [ "serde", ] @@ -1712,7 +1703,7 @@ dependencies = [ "derive_more", "divan", "enumset", - "fastrand 2.1.1", + "fastrand 2.2.0", "flate2", "flecs_ecs", "glam", @@ -1750,7 +1741,7 @@ dependencies = [ "serde_json", "sha2 0.10.8", "tango-bench", - "thiserror 2.0.1", + "thiserror 2.0.3", "tokio", "toml", "tracing", @@ -1905,7 +1896,7 @@ version = "0.1.0" dependencies = [ "serde", "serde_json", - "thiserror 1.0.68", + "thiserror 1.0.69", "uuid", "valence_protocol", ] @@ -2205,9 +2196,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.161" +version = "0.2.162" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" +checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" [[package]] name = "libdeflate-sys" @@ -2905,7 +2896,7 @@ dependencies = [ "clap", "compact_str", "dotenvy", - "fastrand 2.1.1", + "fastrand 2.2.0", "flecs_ecs", "hyperion", "hyperion-clap", @@ -2956,7 +2947,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls", "socket2", - "thiserror 1.0.68", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -2973,16 +2964,16 @@ dependencies = [ "rustc-hash 2.0.0", "rustls", "slab", - "thiserror 1.0.68", + "thiserror 1.0.69", "tinyvec", "tracing", ] [[package]] name = "quinn-udp" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e346e016eacfff12233c243718197ca12f148c84e1e84268a896699b41c71780" +checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" dependencies = [ "cfg_aliases", "libc", @@ -3120,7 +3111,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -3131,7 +3122,7 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", + "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -3146,9 +3137,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -3322,9 +3313,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.39" +version = "0.38.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375116bee2be9ed569afe2154ea6a99dfdffd257f533f187498c2a8f5feaf4ee" +checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" dependencies = [ "bitflags 2.6.0", "errno", @@ -3450,9 +3441,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.0" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" dependencies = [ "core-foundation-sys", "libc", @@ -3472,18 +3463,18 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", @@ -3761,7 +3752,7 @@ dependencies = [ "rand 0.8.5", "scroll", "tempfile", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -3789,12 +3780,12 @@ checksum = "42a4d50cdb458045afc8131fd91b64904da29548bcb63c7236e0844936c13078" [[package]] name = "tempfile" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", - "fastrand 2.1.1", + "fastrand 2.2.0", "once_cell", "rustix", "windows-sys 0.59.0", @@ -3821,27 +3812,27 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl 1.0.68", + "thiserror-impl 1.0.69", ] [[package]] name = "thiserror" -version = "2.0.1" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07c1e40dd48a282ae8edc36c732cbc219144b87fb6a4c7316d611c6b1f06ec0c" +checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" dependencies = [ - "thiserror-impl 2.0.1", + "thiserror-impl 2.0.3", ] [[package]] name = "thiserror-impl" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", @@ -3850,9 +3841,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.1" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874aa7e446f1da8d9c3a5c95b1c5eb41d800045252121dc7f8e0ba370cee55f5" +checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" dependencies = [ "proc-macro2", "quote", @@ -3957,9 +3948,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.0" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", @@ -4160,11 +4151,12 @@ dependencies = [ [[package]] name = "tracy-client-sys" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68613466112302fdbeabc5fa55f7d57462a0b247d5a6b7d7e09401fb471a144d" +checksum = "3637e734239e12ab152cd269302500bd063f37624ee210cd04b4936ed671f3b1" dependencies = [ "cc", + "windows-targets 0.52.6", ] [[package]] @@ -4269,7 +4261,7 @@ dependencies = [ "byteorder", "flate2", "lru", - "thiserror 1.0.68", + "thiserror 1.0.69", "valence_nbt", "valence_server", ] @@ -4336,7 +4328,7 @@ version = "0.2.0-alpha.1+mc.1.20.1" source = "git+https://github.com/andrewgazelka/valence?branch=feat-open#7ed3252c1172c935f8e56df0699339ab35b08f65" dependencies = [ "serde", - "thiserror 1.0.68", + "thiserror 1.0.69", "valence_ident_macros", ] @@ -4367,7 +4359,7 @@ dependencies = [ "cesu8", "indexmap", "serde", - "thiserror 1.0.68", + "thiserror 1.0.69", "uuid", ] @@ -4386,7 +4378,7 @@ dependencies = [ "flate2", "serde", "serde_json", - "thiserror 1.0.68", + "thiserror 1.0.69", "tracing", "url", "uuid", @@ -4475,7 +4467,7 @@ source = "git+https://github.com/andrewgazelka/valence?branch=feat-open#7ed3252c dependencies = [ "serde", "serde_json", - "thiserror 1.0.68", + "thiserror 1.0.69", "uuid", "valence_ident", "valence_nbt", diff --git a/events/proof-of-concept/src/command.rs b/events/proof-of-concept/src/command.rs index 1df6806f..53e328e2 100644 --- a/events/proof-of-concept/src/command.rs +++ b/events/proof-of-concept/src/command.rs @@ -1,6 +1,5 @@ use flecs_ecs::core::World; -use hyperion_clap::hyperion_command::CommandRegistry; -use hyperion_clap::MinecraftCommand; +use hyperion_clap::{MinecraftCommand, hyperion_command::CommandRegistry}; use crate::command::{fly::FlyCommand, speed::SpeedCommand}; diff --git a/events/proof-of-concept/src/command/fly.rs b/events/proof-of-concept/src/command/fly.rs index ededcf8f..cd9f19f2 100644 --- a/events/proof-of-concept/src/command/fly.rs +++ b/events/proof-of-concept/src/command/fly.rs @@ -35,7 +35,7 @@ impl MinecraftCommand for FlyCommand { fn fly_packet() -> PlayerAbilitiesS2c { const SPEED_METER_PER_SECOND: f32 = 10.92; - + // guessing.. idk what the actual conversion is const SOME_CONVERSION: f32 = SPEED_METER_PER_SECOND / 70.0; diff --git a/events/proof-of-concept/src/command/speed.rs b/events/proof-of-concept/src/command/speed.rs index a171a731..6e415551 100644 --- a/events/proof-of-concept/src/command/speed.rs +++ b/events/proof-of-concept/src/command/speed.rs @@ -1,9 +1,12 @@ use clap::Parser; use flecs_ecs::core::{Entity, EntityViewGet, World, WorldGet}; -use hyperion::net::{agnostic, Compose, DataBundle, NetworkStreamRef}; -use hyperion::system_registry::SystemId; -use hyperion::valence_protocol::packets::play::player_abilities_s2c::PlayerAbilitiesFlags; -use hyperion::valence_protocol::packets::play::PlayerAbilitiesS2c; +use hyperion::{ + net::{Compose, DataBundle, NetworkStreamRef, agnostic}, + system_registry::SystemId, + valence_protocol::packets::play::{ + PlayerAbilitiesS2c, player_abilities_s2c::PlayerAbilitiesFlags, + }, +}; use hyperion_clap::MinecraftCommand; #[derive(Parser, Debug)] @@ -12,7 +15,6 @@ pub struct SpeedCommand { amount: f32, } - impl MinecraftCommand for SpeedCommand { fn execute(self, world: &World, caller: Entity) { let msg = format!("Setting speed to {}", self.amount); diff --git a/events/proof-of-concept/src/lib.rs b/events/proof-of-concept/src/lib.rs index e5b7617f..03697f2b 100644 --- a/events/proof-of-concept/src/lib.rs +++ b/events/proof-of-concept/src/lib.rs @@ -8,19 +8,13 @@ use std::net::ToSocketAddrs; -use clap::Parser; use flecs_ecs::prelude::*; use hyperion::{ Hyperion, - net::{Compose, DataBundle, NetworkStreamRef, agnostic}, runtime::AsyncRuntime, simulation::{Player, blocks::Blocks}, - system_registry::SystemId, - valence_protocol::packets::play::{ - PlayerAbilitiesS2c, player_abilities_s2c::PlayerAbilitiesFlags, - }, }; -use hyperion_clap::{MinecraftCommand, hyperion_command::CommandRegistry}; +use hyperion_clap::hyperion_command::CommandRegistry; use module::block::BlockModule; mod component;