Swing correct hand

This commit is contained in:
Ryan 2022-07-05 19:25:55 -07:00
parent 3ac711ca74
commit bfba7a1d11
2 changed files with 9 additions and 4 deletions

View file

@ -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(),
}
}
}
_ => {}

View file

@ -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(),
},
}),
},
}