diff options
| author | Shayne Hartford <shaybox@shaybox.com> | 2024-10-21 20:21:38 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-21 19:21:38 -0500 |
| commit | cd2f298a62819a3fabc52ef17560c2124a74d555 (patch) | |
| tree | 3e32e4ccc7d9f095696c8e23b688b06cf1188f76 /azalea/src/pathfinder | |
| parent | 5535877a4bddcdc30ef8f752a90e6845b308c3c2 (diff) | |
| download | azalea-drasl-cd2f298a62819a3fabc52ef17560c2124a74d555.tar.xz | |
Rename InventoryComponent to Inventory to match other components (#177)
(cherry picked from commit 266058a8d441169b46ef819595eee62337ab324c)
Diffstat (limited to 'azalea/src/pathfinder')
| -rw-r--r-- | azalea/src/pathfinder/mod.rs | 15 | ||||
| -rw-r--r-- | azalea/src/pathfinder/simulation.rs | 10 |
2 files changed, 9 insertions, 16 deletions
diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs index becc163d..cb6ba2bb 100644 --- a/azalea/src/pathfinder/mod.rs +++ b/azalea/src/pathfinder/mod.rs @@ -25,7 +25,7 @@ use crate::ecs::{ }; use crate::pathfinder::moves::PathfinderCtx; use crate::pathfinder::world::CachedWorld; -use azalea_client::inventory::{InventoryComponent, InventorySet, SetSelectedHotbarSlotEvent}; +use azalea_client::inventory::{Inventory, InventorySet, SetSelectedHotbarSlotEvent}; use azalea_client::mining::{Mining, StartMiningBlockEvent}; use azalea_client::movement::MoveEventsSet; use azalea_client::{InstanceHolder, StartSprintEvent, StartWalkEvent}; @@ -201,7 +201,7 @@ fn goto_listener( Option<&ExecutingPath>, &Position, &InstanceName, - &InventoryComponent, + &Inventory, )>, instance_container: Res<InstanceContainer>, ) { @@ -364,7 +364,7 @@ fn path_found_listener( &mut Pathfinder, Option<&mut ExecutingPath>, &InstanceName, - &InventoryComponent, + &Inventory, )>, instance_container: Res<InstanceContainer>, mut commands: Commands, @@ -576,12 +576,7 @@ fn check_node_reached( } fn check_for_path_obstruction( - mut query: Query<( - &Pathfinder, - &mut ExecutingPath, - &InstanceName, - &InventoryComponent, - )>, + mut query: Query<(&Pathfinder, &mut ExecutingPath, &InstanceName, &Inventory)>, instance_container: Res<InstanceContainer>, ) { for (pathfinder, mut executing_path, instance_name, inventory) in &mut query { @@ -688,7 +683,7 @@ fn tick_execute_path( &Physics, Option<&Mining>, &InstanceHolder, - &InventoryComponent, + &Inventory, )>, mut look_at_events: EventWriter<LookAtEvent>, mut sprint_events: EventWriter<StartSprintEvent>, diff --git a/azalea/src/pathfinder/simulation.rs b/azalea/src/pathfinder/simulation.rs index e8ba4dbd..a24a1acb 100644 --- a/azalea/src/pathfinder/simulation.rs +++ b/azalea/src/pathfinder/simulation.rs @@ -2,9 +2,7 @@ use std::sync::Arc; -use azalea_client::{ - inventory::InventoryComponent, packet_handling::game::SendPacketEvent, PhysicsState, -}; +use azalea_client::{inventory::Inventory, packet_handling::game::SendPacketEvent, PhysicsState}; use azalea_core::{position::Vec3, resource_location::ResourceLocation, tick::GameTick}; use azalea_entity::{ attributes::AttributeInstance, Attributes, EntityDimensions, LookDirection, Physics, Position, @@ -22,7 +20,7 @@ pub struct SimulatedPlayerBundle { pub physics_state: PhysicsState, pub look_direction: LookDirection, pub attributes: Attributes, - pub inventory: InventoryComponent, + pub inventory: Inventory, } impl SimulatedPlayerBundle { @@ -41,7 +39,7 @@ impl SimulatedPlayerBundle { speed: AttributeInstance::new(0.1), attack_speed: AttributeInstance::new(4.0), }, - inventory: InventoryComponent::default(), + inventory: Inventory::default(), } } } @@ -108,7 +106,7 @@ fn create_simulation_player_complete_bundle( partial_instance: Arc::new(RwLock::new(PartialInstance::default())), instance: instance.clone(), }, - InventoryComponent::default(), + Inventory::default(), ) } |
