Skip to content

Commit

Permalink
1.21.2 (#171)
Browse files Browse the repository at this point in the history
* partially implement 24w35a

* start updating to 24w39a + itemcomponent codegen

* fix codegen and broken packets to finish updating to 24w39a :D

* update to 1.21.2 except for blocks

* update ServerboundPlayerInputPacket impl
  • Loading branch information
mat-1 authored Oct 23, 2024
1 parent abc7b43 commit 40e4096
Show file tree
Hide file tree
Showing 41 changed files with 4,051 additions and 1,333 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A collection of Rust crates for making Minecraft bots, clients, and tools.

<!-- The line below is automatically read and updated by the migrate script, so don't change it manually. -->

_Currently supported Minecraft version: `1.21.1`._
_Currently supported Minecraft version: `1.21.2`._

> [!WARNING]
> Azalea is still very unfinished, though most crates are in a somewhat useable state
Expand Down
2 changes: 1 addition & 1 deletion azalea-client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ impl Client {
debug!("Got compression request {:?}", p.compression_threshold);
conn.set_compression_threshold(p.compression_threshold);
}
ClientboundLoginPacket::GameProfile(p) => {
ClientboundLoginPacket::LoginFinished(p) => {
debug!(
"Got profile {:?}. handshake is finished and we're now switching to the configuration state",
p.game_profile
Expand Down
42 changes: 25 additions & 17 deletions azalea-client/src/packet_handling/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ pub fn process_packet_events(ecs: &mut World) {

*player_abilities = PlayerAbilities::from(p);
}
ClientboundGamePacket::SetCarriedItem(p) => {
debug!("Got set carried item packet {p:?}");
ClientboundGamePacket::SetCursorItem(p) => {
debug!("Got set cursor item packet {p:?}");
}
ClientboundGamePacket::UpdateTags(_p) => {
debug!("Got update tags packet");
Expand All @@ -415,9 +415,6 @@ pub fn process_packet_events(ecs: &mut World) {
ClientboundGamePacket::EntityEvent(_p) => {
// debug!("Got entity event packet {p:?}");
}
ClientboundGamePacket::Recipe(_p) => {
debug!("Got recipe packet");
}
ClientboundGamePacket::PlayerPosition(p) => {
debug!("Got player position packet {p:?}");

Expand Down Expand Up @@ -445,25 +442,25 @@ pub fn process_packet_events(ecs: &mut World) {
let is_z_relative = p.relative_arguments.z;

let (delta_x, new_pos_x) = if is_x_relative {
last_sent_position.x += p.x;
(delta_movement.x, position.x + p.x)
last_sent_position.x += p.pos.x;
(delta_movement.x, position.x + p.pos.x)
} else {
last_sent_position.x = p.x;
(0.0, p.x)
last_sent_position.x = p.pos.x;
(0.0, p.pos.x)
};
let (delta_y, new_pos_y) = if is_y_relative {
last_sent_position.y += p.y;
(delta_movement.y, position.y + p.y)
last_sent_position.y += p.pos.y;
(delta_movement.y, position.y + p.pos.y)
} else {
last_sent_position.y = p.y;
(0.0, p.y)
last_sent_position.y = p.pos.y;
(0.0, p.pos.y)
};
let (delta_z, new_pos_z) = if is_z_relative {
last_sent_position.z += p.z;
(delta_movement.z, position.z + p.z)
last_sent_position.z += p.pos.z;
(delta_movement.z, position.z + p.pos.z)
} else {
last_sent_position.z = p.z;
(0.0, p.z)
last_sent_position.z = p.pos.z;
(0.0, p.pos.z)
};

let mut y_rot = p.y_rot;
Expand Down Expand Up @@ -1475,6 +1472,17 @@ pub fn process_packet_events(ecs: &mut World) {
ClientboundGamePacket::PongResponse(_) => {}
ClientboundGamePacket::StoreCookie(_) => {}
ClientboundGamePacket::Transfer(_) => {}
ClientboundGamePacket::MoveMinecart(_) => {}
ClientboundGamePacket::SetHeldSlot(_) => {}
ClientboundGamePacket::SetPlayerInventory(_) => {}
ClientboundGamePacket::ProjectilePower(_) => {}
ClientboundGamePacket::CustomReportDetails(_) => {}
ClientboundGamePacket::ServerLinks(_) => {}
ClientboundGamePacket::EntityPositionSync(_) => {}
ClientboundGamePacket::PlayerRotation(_) => {}
ClientboundGamePacket::RecipeBookAdd(_) => {}
ClientboundGamePacket::RecipeBookRemove(_) => {}
ClientboundGamePacket::RecipeBookSettings(_) => {}
}
}
}
Expand Down
Loading

0 comments on commit 40e4096

Please sign in to comment.