Send Inventory and Health when Switching dimension

This commit is contained in:
Alexander Medvedev committed 2025-07-31 20:10:51 +02:00
1 parent 5084ccd43f
commit 0c1f0b9a33
1 file changed
+6
+6
View File
@@ -1081,6 +1081,7 @@ impl Player {
}; };
'after: { 'after: {
// TODO: this is duplicate code from world
let position = event.position; let position = event.position;
let yaw = event.yaw; let yaw = event.yaw;
let pitch = event.pitch; let pitch = event.pitch;
@@ -1119,6 +1120,11 @@ impl Player {
self.clone().request_teleport(position, yaw, pitch).await; self.clone().request_teleport(position, yaw, pitch).await;
self.living_entity.last_pos.store(position); self.living_entity.last_pos.store(position);
self.send_abilities_update().await; self.send_abilities_update().await;
self.enqueue_set_held_item_packet(&CSetSelectedSlot::new(
self.get_inventory().get_selected_slot() as i8,
)).await;
self.on_screen_handler_opened(self.player_screen_handler.clone()).await;
self.send_health().await;
new_world.send_world_info(self, position, yaw, pitch).await; new_world.send_world_info(self, position, yaw, pitch).await;
} }