diff options
Diffstat (limited to 'azalea-client/src/plugins/interact')
| -rw-r--r-- | azalea-client/src/plugins/interact/mod.rs | 12 | ||||
| -rw-r--r-- | azalea-client/src/plugins/interact/pick.rs | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/azalea-client/src/plugins/interact/mod.rs b/azalea-client/src/plugins/interact/mod.rs index d8f8b8b4..04986de7 100644 --- a/azalea-client/src/plugins/interact/mod.rs +++ b/azalea-client/src/plugins/interact/mod.rs @@ -30,7 +30,7 @@ use azalea_protocol::packets::game::{ s_swing::ServerboundSwing, s_use_item_on::ServerboundUseItemOn, }; -use azalea_world::Instance; +use azalea_world::World; use bevy_app::{App, Plugin, Update}; use bevy_ecs::prelude::*; use tracing::warn; @@ -140,7 +140,7 @@ impl BlockStatePredictionHandler { } } - pub fn end_prediction_up_to(&mut self, seq: u32, world: &Instance) { + pub fn end_prediction_up_to(&mut self, seq: u32, world: &World) { let mut to_remove = Vec::new(); for (pos, state) in &self.server_state { if state.seq > seq { @@ -377,10 +377,10 @@ pub fn handle_entity_interact( /// /// If this is false, then we can interact with the block. /// -/// Passing the inventory, block position, and instance is necessary for the -/// adventure mode check. +/// The world, block position, and inventory are used for the adventure mode +/// check. pub fn check_is_interaction_restricted( - instance: &Instance, + world: &World, block_pos: BlockPos, game_mode: &GameMode, inventory: &Inventory, @@ -393,7 +393,7 @@ pub fn check_is_interaction_restricted( let held_item = inventory.held_item(); match &held_item { ItemStack::Present(item) => { - let block = instance.chunks.get_block_state(block_pos); + let block = world.chunks.get_block_state(block_pos); let Some(block) = block else { // block isn't loaded so just say that it is restricted return true; diff --git a/azalea-client/src/plugins/interact/pick.rs b/azalea-client/src/plugins/interact/pick.rs index 8ffe47e8..1fed584a 100644 --- a/azalea-client/src/plugins/interact/pick.rs +++ b/azalea-client/src/plugins/interact/pick.rs @@ -17,7 +17,7 @@ use azalea_physics::{ clip::{BlockShapeType, ClipContext, FluidPickType}, collision::entity_collisions::{AabbQuery, get_entities}, }; -use azalea_world::{Instance, InstanceContainer, InstanceName}; +use azalea_world::{World, WorldName, Worlds}; use bevy_ecs::prelude::*; use derive_more::{Deref, DerefMut}; @@ -37,13 +37,13 @@ pub fn update_hit_result_component( &Position, &EntityDimensions, &LookDirection, - &InstanceName, + &WorldName, &Physics, &Attributes, ), With<LocalEntity>, >, - instance_container: Res<InstanceContainer>, + worlds: Res<Worlds>, aabb_query: AabbQuery, pickable_query: MaybePickableEntityQuery, ) { @@ -63,7 +63,7 @@ pub fn update_hit_result_component( let eye_position = position.up(dimensions.eye_height.into()); - let Some(world_lock) = instance_container.get(world_name) else { + let Some(world_lock) = worlds.get(world_name) else { continue; }; let world = world_lock.read(); @@ -117,7 +117,7 @@ pub struct PickOpts<'world, 'state, 'a, 'b, 'c> { look_direction: LookDirection, eye_position: Vec3, aabb: &'a Aabb, - world: &'a Instance, + world: &'a World, entity_pick_range: f64, block_pick_range: f64, aabb_query: &'a AabbQuery<'world, 'state, 'b>, @@ -246,7 +246,7 @@ struct PickEntityOpts<'world, 'state, 'a, 'b> { source_entity: Entity, eye_position: Vec3, end_position: Vec3, - world: &'a azalea_world::Instance, + world: &'a azalea_world::World, pick_range_squared: f64, predicate: &'a dyn Fn(Entity) -> bool, aabb: &'a Aabb, |
