From d5fa5e32b37754b3b5c136e58821e48cd3b7c2ff Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Tue, 13 Jan 2026 10:51:30 -0600 Subject: Rename Instance to World (#304) --- azalea/src/pathfinder/moves/mod.rs | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'azalea/src/pathfinder/moves') diff --git a/azalea/src/pathfinder/moves/mod.rs b/azalea/src/pathfinder/moves/mod.rs index 33c34c3b..d575c01a 100644 --- a/azalea/src/pathfinder/moves/mod.rs +++ b/azalea/src/pathfinder/moves/mod.rs @@ -13,7 +13,7 @@ use azalea_client::{ }; use azalea_core::position::{BlockPos, Vec3}; use azalea_inventory::Menu; -use azalea_world::Instance; +use azalea_world::World; use bevy_ecs::{entity::Entity, message::MessageWriter, system::Commands}; use parking_lot::RwLock; use tracing::debug; @@ -65,7 +65,7 @@ pub struct ExecuteCtx<'s, 'w1, 'w2, 'w3, 'w4, 'w5, 'w6, 'a> { pub position: Vec3, pub physics: &'a azalea_entity::Physics, pub is_currently_mining: bool, - pub instance: Arc>, + pub world: Arc>, pub menu: Menu, pub commands: &'a mut Commands<'w1, 's>, @@ -124,11 +124,7 @@ impl ExecuteCtx<'_, '_, '_, '_, '_, '_, '_, '_> { /// Returns whether this block could be mined. pub fn should_mine(&mut self, block: BlockPos) -> bool { - let block_state = self - .instance - .read() - .get_block_state(block) - .unwrap_or_default(); + let block_state = self.world.read().get_block_state(block).unwrap_or_default(); if is_block_state_passable(block_state) { // block is already passable, no need to mine it return false; @@ -141,11 +137,7 @@ impl ExecuteCtx<'_, '_, '_, '_, '_, '_, '_, '_> { /// /// Returns whether the block is being mined. pub fn mine(&mut self, block: BlockPos) -> bool { - let block_state = self - .instance - .read() - .get_block_state(block) - .unwrap_or_default(); + let block_state = self.world.read().get_block_state(block).unwrap_or_default(); if is_block_state_passable(block_state) { // block is already passable, no need to mine it return false; @@ -196,10 +188,7 @@ impl ExecuteCtx<'_, '_, '_, '_, '_, '_, '_, '_> { } pub fn get_block_state(&self, block: BlockPos) -> BlockState { - self.instance - .read() - .get_block_state(block) - .unwrap_or_default() + self.world.read().get_block_state(block).unwrap_or_default() } } -- cgit v1.2.3