aboutsummaryrefslogtreecommitdiff
path: root/azalea-physics/src/fluids.rs
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-physics/src/fluids.rs
parentefb36d5fc0fe56a98f5795c53dfa109887cd5aae (diff)
downloadazalea-drasl-d5fa5e32b37754b3b5c136e58821e48cd3b7c2ff.tar.xz
Rename Instance to World (#304)
Diffstat (limited to 'azalea-physics/src/fluids.rs')
-rw-r--r--azalea-physics/src/fluids.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/azalea-physics/src/fluids.rs b/azalea-physics/src/fluids.rs
index fa6a1586..73ee7ddb 100644
--- a/azalea-physics/src/fluids.rs
+++ b/azalea-physics/src/fluids.rs
@@ -8,7 +8,7 @@ use azalea_core::{
};
use azalea_entity::{HasClientLoaded, LocalEntity, Physics, Position};
use azalea_registry::builtin::BlockKind;
-use azalea_world::{Instance, InstanceContainer, InstanceName};
+use azalea_world::{World, WorldName, Worlds};
use bevy_ecs::prelude::*;
use crate::collision::legacy_blocks_motion;
@@ -16,13 +16,13 @@ use crate::collision::legacy_blocks_motion;
#[allow(clippy::type_complexity)]
pub fn update_in_water_state_and_do_fluid_pushing(
mut query: Query<
- (&mut Physics, &Position, &InstanceName),
+ (&mut Physics, &Position, &WorldName),
(With<LocalEntity>, With<HasClientLoaded>),
>,
- instance_container: Res<InstanceContainer>,
+ worlds: Res<Worlds>,
) {
- for (mut physics, position, instance_name) in &mut query {
- let Some(world_lock) = instance_container.get(instance_name) else {
+ for (mut physics, position, world_name) in &mut query {
+ let Some(world_lock) = worlds.get(world_name) else {
continue;
};
let world = world_lock.read();
@@ -41,7 +41,7 @@ pub fn update_in_water_state_and_do_fluid_pushing(
.registries
.dimension_type
.map
- .get(&**instance_name)
+ .get(&**world_name)
.and_then(|i| i.ultrawarm)
.unwrap_or_default();
let lava_push_factor = if is_ultrawarm {
@@ -60,7 +60,7 @@ pub fn update_in_water_state_and_do_fluid_pushing(
}
fn update_in_water_state_and_do_water_current_pushing(
physics: &mut Physics,
- world: &Instance,
+ world: &World,
_position: Position,
) {
// TODO: implement vehicles and boats
@@ -86,7 +86,7 @@ fn update_in_water_state_and_do_water_current_pushing(
fn update_fluid_height_and_do_fluid_pushing(
physics: &mut Physics,
- world: &Instance,
+ world: &World,
checking_fluid: FluidKind,
fluid_push_factor: f64,
) -> bool {
@@ -180,7 +180,7 @@ pub fn update_swimming() {
}
// FlowingFluid.getFlow
-pub fn get_fluid_flow(fluid: &FluidState, world: &Instance, pos: BlockPos) -> Vec3 {
+pub fn get_fluid_flow(fluid: &FluidState, world: &World, pos: BlockPos) -> Vec3 {
let mut z_flow: f64 = 0.;
let mut x_flow: f64 = 0.;
@@ -244,7 +244,7 @@ pub fn get_fluid_flow(fluid: &FluidState, world: &Instance, pos: BlockPos) -> Ve
// i don't really get what this is for
fn is_solid_face(
fluid: &FluidState,
- world: &Instance,
+ world: &World,
adjacent_pos: BlockPos,
direction: Direction,
) -> bool {
@@ -269,7 +269,7 @@ fn is_solid_face(
fn is_face_sturdy(
_block_state: BlockState,
- _world: &Instance,
+ _world: &World,
_pos: BlockPos,
_direction: Direction,
) -> bool {