aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/pathfinder/moves
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2026-01-13 10:51:30 -0600
committerGitHub <noreply@github.com>2026-01-13 10:51:30 -0600
commitd5fa5e32b37754b3b5c136e58821e48cd3b7c2ff (patch)
treeea04702f96ad170fb1d90e5ed2dc875ae8166495 /azalea/src/pathfinder/moves
parentefb36d5fc0fe56a98f5795c53dfa109887cd5aae (diff)
downloadazalea-drasl-d5fa5e32b37754b3b5c136e58821e48cd3b7c2ff.tar.xz
Rename Instance to World (#304)
Diffstat (limited to 'azalea/src/pathfinder/moves')
-rw-r--r--azalea/src/pathfinder/moves/mod.rs21
1 files changed, 5 insertions, 16 deletions
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<RwLock<Instance>>,
+ pub world: Arc<RwLock<World>>,
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()
}
}