Rename all "liquid" mentions to "fluid"

This commit is contained in:
2026-10-25 13:54:53 -03:00
parent bcca8fa4a5
commit 0cfa4d9b4a
58 changed files with 547 additions and 548 deletions
+5 -5
View File
@@ -3,7 +3,7 @@
import { assert, assertAlmostEquals, assertEquals } from "@std/assert";
import { eyes_in_water, in_water, move_body } from "$/common/physics.ts";
import { type BlockRegistry, is_liquid_block, LIQUID_DEFAULTS } from "$/common/everything_registry.ts";
import { type BlockRegistry, FLUID_DEFAULTS, is_fluid_block } from "$/common/everything_registry.ts";
const body = (x: number, z: number, vx: number, vz: number) => ({ x, y: 0, z, vx, vy: 0, vz, width: 0.6, height: 1.8 });
// a block at x 0 to 1, z 1 to 2, on a floor
@@ -46,12 +46,12 @@ Deno.test("a body on the ground steps up onto something low, not onto a full blo
assertAlmostEquals(wall.y, 0);
});
Deno.test("liquids are the blocks that say they are one", () => {
Deno.test("fluids are the blocks that say they are one", () => {
const block = (fields: Partial<BlockRegistry>) => ({ has_collision: false, ...fields }) as BlockRegistry;
assertEquals(is_liquid_block(block({ liquid: LIQUID_DEFAULTS })), true);
assertEquals(is_fluid_block(block({ fluid: FLUID_DEFAULTS })), true);
// no collision and replaceable isn't enough any more, like a plant you can place into
assertEquals(is_liquid_block(block({ replaceable: true })), false);
assertEquals(is_liquid_block(undefined), false);
assertEquals(is_fluid_block(block({ replaceable: true })), false);
assertEquals(is_fluid_block(undefined), false);
});
Deno.test("a body is in water by its feet or the middle of its box, and its eyes by its eye height", () => {