aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-02-16 17:10:04 +0000
committermat <git@matdoes.dev>2025-02-16 17:10:04 +0000
commit228489dded720cea566dd0a4638b39cba2aff5ec (patch)
treeae4631e3ed42cd13b02bdcd32e81761ca79f4d0c /azalea-client/src
parent4fb6b077464e14f816e4c4fe54ff648e8c3d0ede (diff)
downloadazalea-drasl-228489dded720cea566dd0a4638b39cba2aff5ec.tar.xz
use MinecraftEntityId type instead of u32 in az-protocol
Diffstat (limited to 'azalea-client/src')
-rw-r--r--azalea-client/src/attack.rs2
-rw-r--r--azalea-client/src/movement.rs2
-rw-r--r--azalea-client/src/packet_handling/game.rs22
3 files changed, 13 insertions, 13 deletions
diff --git a/azalea-client/src/attack.rs b/azalea-client/src/attack.rs
index b1b36b69..f626483f 100644
--- a/azalea-client/src/attack.rs
+++ b/azalea-client/src/attack.rs
@@ -86,7 +86,7 @@ pub fn handle_attack_event(
send_packet_events.send(SendPacketEvent::new(
event.entity,
ServerboundInteract {
- entity_id: *event.target,
+ entity_id: event.target,
action: s_interact::ActionType::Attack,
using_secondary_action: **sneaking,
},
diff --git a/azalea-client/src/movement.rs b/azalea-client/src/movement.rs
index 6308002e..3bea9de2 100644
--- a/azalea-client/src/movement.rs
+++ b/azalea-client/src/movement.rs
@@ -303,7 +303,7 @@ fn send_sprinting_if_needed(
send_packet_events.send(SendPacketEvent::new(
entity,
ServerboundPlayerCommand {
- id: **minecraft_entity_id,
+ id: *minecraft_entity_id,
action: sprinting_action,
data: 0,
},
diff --git a/azalea-client/src/packet_handling/game.rs b/azalea-client/src/packet_handling/game.rs
index f8e72a4a..207cdd91 100644
--- a/azalea-client/src/packet_handling/game.rs
+++ b/azalea-client/src/packet_handling/game.rs
@@ -301,7 +301,7 @@ pub fn process_packet_events(ecs: &mut World) {
azalea_registry::EntityKind::Player,
new_instance_name,
);
- let entity_id = MinecraftEntityId(p.player_id);
+ let entity_id = p.player_id;
// insert our components into the ecs :)
commands.entity(player_entity).insert((
entity_id,
@@ -643,7 +643,7 @@ pub fn process_packet_events(ecs: &mut World) {
let (mut entity_id_index, instance_name, tab_list) =
query.get_mut(player_entity).unwrap();
- let entity_id = MinecraftEntityId(p.id);
+ let entity_id = p.id;
let Some(instance_name) = instance_name else {
warn!("got add player packet but we haven't gotten a login packet yet");
@@ -721,7 +721,7 @@ pub fn process_packet_events(ecs: &mut World) {
let (mut commands, mut query, entity_kind_query) = system_state.get_mut(ecs);
let (entity_id_index, instance_holder) = query.get_mut(player_entity).unwrap();
- let entity = entity_id_index.get(MinecraftEntityId(p.id));
+ let entity = entity_id_index.get(p.id);
let Some(entity) = entity else {
// some servers like hypixel trigger this a lot :(
@@ -768,7 +768,7 @@ pub fn process_packet_events(ecs: &mut World) {
let (mut commands, mut query) = system_state.get_mut(ecs);
let (entity_id_index, instance_holder) = query.get_mut(player_entity).unwrap();
- let Some(entity) = entity_id_index.get(MinecraftEntityId(p.id)) else {
+ let Some(entity) = entity_id_index.get(p.id) else {
// note that this log (and some other ones like the one in RemoveEntities)
// sometimes happens when killing mobs. it seems to be a vanilla bug, which is
// why it's a debug log instead of a warning
@@ -837,7 +837,7 @@ pub fn process_packet_events(ecs: &mut World) {
let (mut commands, mut query) = system_state.get_mut(ecs);
let (entity_id_index, instance_holder) = query.get_mut(player_entity).unwrap();
- let Some(entity) = entity_id_index.get(MinecraftEntityId(p.id)) else {
+ let Some(entity) = entity_id_index.get(p.id) else {
warn!("Got teleport entity packet for unknown entity id {}", p.id);
continue;
};
@@ -883,7 +883,7 @@ pub fn process_packet_events(ecs: &mut World) {
debug!("Got move entity pos packet {p:?}");
- let Some(entity) = entity_id_index.get(MinecraftEntityId(p.entity_id)) else {
+ let Some(entity) = entity_id_index.get(p.entity_id) else {
debug!(
"Got move entity pos packet for unknown entity id {}",
p.entity_id
@@ -924,7 +924,7 @@ pub fn process_packet_events(ecs: &mut World) {
debug!("Got move entity pos rot packet {p:?}");
- let entity = entity_id_index.get(MinecraftEntityId(p.entity_id));
+ let entity = entity_id_index.get(p.entity_id);
if let Some(entity) = entity {
let new_delta = p.delta.clone();
@@ -977,7 +977,7 @@ pub fn process_packet_events(ecs: &mut World) {
let (mut commands, mut query) = system_state.get_mut(ecs);
let (entity_id_index, instance_holder) = query.get_mut(player_entity).unwrap();
- let entity = entity_id_index.get(MinecraftEntityId(p.entity_id));
+ let entity = entity_id_index.get(p.entity_id);
if let Some(entity) = entity {
let new_look_direction = LookDirection {
@@ -1040,7 +1040,7 @@ pub fn process_packet_events(ecs: &mut World) {
};
for &id in &p.entity_ids {
- let Some(entity) = entity_id_index.remove(MinecraftEntityId(id)) else {
+ let Some(entity) = entity_id_index.remove(id) else {
debug!("Tried to remove entity with id {id} but it wasn't in the EntityIdIndex");
continue;
};
@@ -1334,7 +1334,7 @@ pub fn process_packet_events(ecs: &mut World) {
let (mut commands, mut query, mut death_events) = system_state.get_mut(ecs);
let (entity_id, dead) = query.get_mut(player_entity).unwrap();
- if **entity_id == p.player_id && dead.is_none() {
+ if *entity_id == p.player_id && dead.is_none() {
commands.entity(player_entity).insert(Dead);
death_events.send(DeathEvent {
entity: player_entity,
@@ -1475,7 +1475,7 @@ pub fn process_packet_events(ecs: &mut World) {
let (mut commands, mut query) = system_state.get_mut(ecs);
let (entity_id_index, instance_holder) = query.get_mut(player_entity).unwrap();
- let Some(entity) = entity_id_index.get(MinecraftEntityId(p.id)) else {
+ let Some(entity) = entity_id_index.get(p.id) else {
debug!("Got teleport entity packet for unknown entity id {}", p.id);
continue;
};