Fix: Rotation
This commit is contained in:
parent
4c34a98ad5
commit
77b205ada0
@ -116,8 +116,8 @@ impl Client {
|
||||
entity.x = Self::clamp_horizontal(position_rotation.x);
|
||||
entity.y = Self::clamp_vertical(position_rotation.feet_y);
|
||||
entity.z = Self::clamp_horizontal(position_rotation.z);
|
||||
entity.yaw = wrap_degrees(position_rotation.yaw).clamp(-90.0, 90.0) % 360.0;
|
||||
entity.pitch = wrap_degrees(position_rotation.pitch) % 360.0;
|
||||
entity.yaw = wrap_degrees(position_rotation.yaw) % 360.0;
|
||||
entity.pitch = wrap_degrees(position_rotation.pitch).clamp(-90.0, 90.0) % 360.0;
|
||||
|
||||
// send new position to all other players
|
||||
let on_ground = player.on_ground;
|
||||
@ -151,8 +151,8 @@ impl Client {
|
||||
}
|
||||
let player = self.player.as_mut().unwrap();
|
||||
let entity = &mut player.entity;
|
||||
entity.yaw = wrap_degrees(rotation.yaw).clamp(-90.0, 90.0) % 360.0;
|
||||
entity.pitch = wrap_degrees(rotation.pitch) % 360.0;
|
||||
entity.yaw = wrap_degrees(rotation.yaw) % 360.0;
|
||||
entity.pitch = wrap_degrees(rotation.pitch).clamp(-90.0, 90.0) % 360.0;
|
||||
// send new position to all other players
|
||||
let on_ground = player.on_ground;
|
||||
let entity_id = entity.entity_id;
|
||||
@ -314,6 +314,9 @@ impl Client {
|
||||
&CHurtAnimation::new(&entity_id, 10.0),
|
||||
)
|
||||
}
|
||||
if config.swing {
|
||||
|
||||
}
|
||||
} else {
|
||||
self.kick("Interacted with invalid entitiy id")
|
||||
}
|
||||
|
||||
@ -70,6 +70,8 @@ pub struct PVPConfig {
|
||||
pub protect_creative: bool,
|
||||
/// Has PVP Knockback?
|
||||
pub knockback: bool,
|
||||
/// Should player swing when attacking?
|
||||
pub swing: bool,
|
||||
}
|
||||
|
||||
impl Default for PVPConfig {
|
||||
@ -79,6 +81,7 @@ impl Default for PVPConfig {
|
||||
hurt_animation: true,
|
||||
protect_creative: true,
|
||||
knockback: true,
|
||||
swing: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user