diff --git a/examples/conway.rs b/examples/conway.rs index 3a1475d..40d095e 100644 --- a/examples/conway.rs +++ b/examples/conway.rs @@ -7,7 +7,7 @@ use std::sync::Mutex; use log::LevelFilter; use num::Integer; use rayon::iter::{IndexedParallelIterator, IntoParallelRefMutIterator, ParallelIterator}; -use valence::client::{ClientEvent, ClientId, GameMode}; +use valence::client::{ClientEvent, ClientId, GameMode, Hand}; use valence::config::{Config, ServerListPing}; use valence::entity::meta::Pose; use valence::entity::EntityData; @@ -218,9 +218,12 @@ impl Config for Game { e.set_sprinting(false); } } - ClientEvent::ArmSwing(_) => { + ClientEvent::ArmSwing(hand) => { if let EntityData::Player(e) = player.data_mut() { - e.trigger_swing_main_arm(); + match hand { + Hand::Main => e.trigger_swing_main_arm(), + Hand::Off => e.trigger_swing_offhand(), + } } } _ => {} diff --git a/src/client.rs b/src/client.rs index fccec33..2411f1b 100644 --- a/src/client.rs +++ b/src/client.rs @@ -1207,7 +1207,9 @@ fn to_biome_registry_item(biome: &Biome, id: i32) -> BiomeRegistryBiome { }, particle: biome.particle.as_ref().map(|p| BiomeParticle { probability: p.probability, - options: BiomeParticleOptions { kind: p.kind.clone() }, + options: BiomeParticleOptions { + kind: p.kind.clone(), + }, }), }, }