From 0d16f01571ec8315f3979eae46981e559ade1cf9 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Fri, 10 Jan 2025 16:45:27 -0600 Subject: Fluid physics (#199) * start implementing fluid physics * Initial implementation of fluid pushing * different travel function in water * bubble columns * jumping in water * cleanup * change ultrawarm to be required * fix for clippy --- azalea-world/src/chunk_storage.rs | 3 ++- azalea-world/src/container.rs | 8 ++++---- azalea-world/src/find_blocks.rs | 2 +- azalea-world/src/palette.rs | 2 +- azalea-world/src/world.rs | 11 ++++++++--- 5 files changed, 16 insertions(+), 10 deletions(-) (limited to 'azalea-world/src') diff --git a/azalea-world/src/chunk_storage.rs b/azalea-world/src/chunk_storage.rs index 94ffb362..8362385a 100755 --- a/azalea-world/src/chunk_storage.rs +++ b/azalea-world/src/chunk_storage.rs @@ -7,7 +7,8 @@ use std::{ sync::{Arc, Weak}, }; -use azalea_block::{BlockState, BlockStateIntegerRepr, FluidState}; +use azalea_block::block_state::{BlockState, BlockStateIntegerRepr}; +use azalea_block::fluid_state::FluidState; use azalea_buf::{AzaleaRead, AzaleaWrite, BufReadError}; use azalea_core::position::{BlockPos, ChunkBlockPos, ChunkPos, ChunkSectionBlockPos}; use nohash_hasher::IntMap; diff --git a/azalea-world/src/container.rs b/azalea-world/src/container.rs index 0b3a13fd..7e5927e3 100644 --- a/azalea-world/src/container.rs +++ b/azalea-world/src/container.rs @@ -56,14 +56,14 @@ impl InstanceContainer { let existing = existing_lock.read(); if existing.chunks.height != height { error!( - "Shared dimension height mismatch: {} != {}", - existing.chunks.height, height, + "Shared dimension height mismatch: {} != {height}", + existing.chunks.height ); } if existing.chunks.min_y != min_y { error!( - "Shared world min_y mismatch: {} != {}", - existing.chunks.min_y, min_y, + "Shared world min_y mismatch: {} != {min_y}", + existing.chunks.min_y ); } existing_lock.clone() diff --git a/azalea-world/src/find_blocks.rs b/azalea-world/src/find_blocks.rs index ff69dd2f..6228687f 100644 --- a/azalea-world/src/find_blocks.rs +++ b/azalea-world/src/find_blocks.rs @@ -1,4 +1,4 @@ -use azalea_block::{BlockState, BlockStates}; +use azalea_block::{block_state::BlockState, BlockStates}; use azalea_core::position::{BlockPos, ChunkPos}; use crate::{iterators::ChunkIterator, palette::Palette, ChunkStorage, Instance}; diff --git a/azalea-world/src/palette.rs b/azalea-world/src/palette.rs index 269e443b..31a03f3d 100755 --- a/azalea-world/src/palette.rs +++ b/azalea-world/src/palette.rs @@ -1,6 +1,6 @@ use std::io::{Cursor, Write}; -use azalea_block::BlockStateIntegerRepr; +use azalea_block::block_state::BlockStateIntegerRepr; use azalea_buf::{AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; use azalea_core::math; use tracing::warn; diff --git a/azalea-world/src/world.rs b/azalea-world/src/world.rs index 0a09d387..298bd598 100644 --- a/azalea-world/src/world.rs +++ b/azalea-world/src/world.rs @@ -5,7 +5,8 @@ use std::{ fmt::Debug, }; -use azalea_block::{BlockState, FluidState}; +use azalea_block::fluid_state::FluidState; +use azalea_block::BlockState; use azalea_core::position::{BlockPos, ChunkPos}; use azalea_core::registry_holder::RegistryHolder; use bevy_ecs::{component::Component, entity::Entity}; @@ -88,8 +89,12 @@ pub struct Instance { /// An index of all the entities we know are in the chunks of the world pub entities_by_chunk: HashMap>, - /// An index of Minecraft entity IDs to Azalea ECS entities. You should - /// avoid using this and instead use `azalea_entity::EntityIdIndex` + /// An index of Minecraft entity IDs to Azalea ECS entities. + /// + /// You should avoid using this (particularly if you're using swarms) and + /// instead use `azalea_entity::EntityIdIndex`, since some servers may + /// give different entity IDs for the same entities to different + /// players. pub entity_by_id: IntMap, pub registries: RegistryHolder, -- cgit v1.2.3