aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-client/src/plugins')
-rw-r--r--azalea-client/src/plugins/attack.rs11
-rw-r--r--azalea-client/src/plugins/interact/mod.rs22
-rw-r--r--azalea-client/src/plugins/packet/game/mod.rs10
3 files changed, 21 insertions, 22 deletions
diff --git a/azalea-client/src/plugins/attack.rs b/azalea-client/src/plugins/attack.rs
index 41ce114d..4cafc9f8 100644
--- a/azalea-client/src/plugins/attack.rs
+++ b/azalea-client/src/plugins/attack.rs
@@ -1,10 +1,9 @@
use azalea_core::{game_type::GameMode, tick::GameTick};
use azalea_entity::{
- Attributes, Crouching, Physics, indexing::EntityIdIndex, metadata::Sprinting,
- update_bounding_box,
+ Attributes, Physics, indexing::EntityIdIndex, metadata::Sprinting, update_bounding_box,
};
use azalea_physics::PhysicsSystems;
-use azalea_protocol::packets::game::s_interact::{self, ServerboundInteract};
+use azalea_protocol::packets::game::ServerboundAttack;
use bevy_app::{App, Plugin, Update};
use bevy_ecs::prelude::*;
use derive_more::{Deref, DerefMut};
@@ -59,7 +58,6 @@ pub fn handle_attack_queued(
&mut Sprinting,
&AttackQueued,
&LocalGameMode,
- &Crouching,
&EntityIdIndex,
)>,
) {
@@ -70,7 +68,6 @@ pub fn handle_attack_queued(
mut sprinting,
attack_queued,
game_mode,
- crouching,
entity_id_index,
) in &mut query
{
@@ -84,10 +81,8 @@ pub fn handle_attack_queued(
commands.trigger(SendGamePacketEvent::new(
client_entity,
- ServerboundInteract {
+ ServerboundAttack {
entity_id: target_entity_id,
- action: s_interact::ActionType::Attack,
- using_secondary_action: **crouching,
},
));
commands.trigger(SwingArmEvent {
diff --git a/azalea-client/src/plugins/interact/mod.rs b/azalea-client/src/plugins/interact/mod.rs
index 04986de7..0eb43818 100644
--- a/azalea-client/src/plugins/interact/mod.rs
+++ b/azalea-client/src/plugins/interact/mod.rs
@@ -4,6 +4,7 @@ use std::collections::HashMap;
use azalea_block::BlockState;
use azalea_core::{
+ delta::LpVec3,
direction::Direction,
game_type::GameMode,
hit_result::{BlockHitResult, HitResult},
@@ -25,10 +26,8 @@ use azalea_physics::{
local_player::PhysicsState,
};
use azalea_protocol::packets::game::{
- ServerboundInteract, ServerboundUseItem,
- s_interact::{self, InteractionHand},
- s_swing::ServerboundSwing,
- s_use_item_on::ServerboundUseItemOn,
+ ServerboundInteract, ServerboundUseItem, s_interact::InteractionHand,
+ s_swing::ServerboundSwing, s_use_item_on::ServerboundUseItemOn,
};
use azalea_world::World;
use bevy_app::{App, Plugin, Update};
@@ -350,12 +349,10 @@ pub fn handle_entity_interact(
}
};
- let mut interact = ServerboundInteract {
+ let interact = ServerboundInteract {
entity_id,
- action: s_interact::ActionType::InteractAt {
- location,
- hand: InteractionHand::MainHand,
- },
+ hand: InteractionHand::MainHand,
+ location: LpVec3::from(location),
using_secondary_action: physics_state.trying_to_crouch,
};
commands.trigger(SendGamePacketEvent::new(trigger.client, interact.clone()));
@@ -364,11 +361,8 @@ pub fn handle_entity_interact(
// in certain cases when interacting with armor stands
let consumes_action = false;
if !consumes_action {
- // but yes, most of the time vanilla really does send two interact packets like
- // this
- interact.action = s_interact::ActionType::Interact {
- hand: InteractionHand::MainHand,
- };
+ // but yes, most of the time vanilla really does send two identical interact
+ // packets like this
commands.trigger(SendGamePacketEvent::new(trigger.client, interact));
}
}
diff --git a/azalea-client/src/plugins/packet/game/mod.rs b/azalea-client/src/plugins/packet/game/mod.rs
index ecc1bc2f..f1bff086 100644
--- a/azalea-client/src/plugins/packet/game/mod.rs
+++ b/azalea-client/src/plugins/packet/game/mod.rs
@@ -197,6 +197,8 @@ pub fn process_packet(ecs: &mut World, player: Entity, packet: &ClientboundGameP
debug_entity_value,
debug_event,
game_test_highlight_pos,
+ low_disk_space_warning,
+ game_rule_values,
]
);
}
@@ -1644,6 +1646,14 @@ impl GamePacketHandler<'_> {
pub fn game_test_highlight_pos(&mut self, p: &ClientboundGameTestHighlightPos) {
debug!("Got game test highlight pos packet {p:?}");
}
+
+ pub fn low_disk_space_warning(&mut self, p: &ClientboundLowDiskSpaceWarning) {
+ debug!("Got low disk space warning packet {p:?}");
+ }
+
+ pub fn game_rule_values(&mut self, p: &ClientboundGameRuleValues) {
+ debug!("Got game rule values packet {p:?}");
+ }
}
struct MoveEntity {