diff --git a/pumpkin/src/client/player_packet.rs b/pumpkin/src/client/player_packet.rs index 36eaac5ca..51d4d878e 100644 --- a/pumpkin/src/client/player_packet.rs +++ b/pumpkin/src/client/player_packet.rs @@ -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") } diff --git a/pumpkin/src/config/mod.rs b/pumpkin/src/config/mod.rs index 9d519dd66..ec2adf192 100644 --- a/pumpkin/src/config/mod.rs +++ b/pumpkin/src/config/mod.rs @@ -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, } } }