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
+2 -2
View File
@@ -64,12 +64,12 @@ export abstract class Entity {
// in water, like the server's Entity.in_water
get in_water() {
return physics.in_water(this, (x, y, z) => this.level.is_liquid(x, y, z));
return physics.in_water(this, (x, y, z) => this.level.is_fluid(x, y, z));
}
// its eyes are in water
get eyes_in_water() {
return physics.eyes_in_water(this, this.eye_height, (x, y, z) => this.level.is_liquid(x, y, z));
return physics.eyes_in_water(this, this.eye_height, (x, y, z) => this.level.is_fluid(x, y, z));
}
// after moving each tick. full speed is 5 blocks per second, a bit faster than walking
+4 -4
View File
@@ -159,9 +159,9 @@ export class LocalPlayer extends Player {
this.drag = this.flying ? FLY_VERTICAL_DRAG : this.#in_water ? WATER_DRAG : LAND_DRAG;
if (this.swimming && this.#in_water) this.#steer(input);
if (!this.flying) {
physics.push_by_liquid(
physics.push_by_fluid(
this,
(x, y, z) => this.level.liquid_at(x, y, z),
(x, y, z) => this.level.fluid_at(x, y, z),
(x, y, z) => this.level.collision_shape(x, y, z),
true,
);
@@ -229,7 +229,7 @@ export class LocalPlayer extends Player {
// of leaping out of the water, unless it's holding jump
#steer(input: MoveInput) {
const look_y = Math.sin(this.pitch);
const head_in_water = this.level.is_liquid(
const head_in_water = this.level.is_fluid(
Math.floor(this.x),
Math.floor(this.y + this.height),
Math.floor(this.z),
@@ -259,7 +259,7 @@ export class LocalPlayer extends Player {
#hop_out_of_water(from_y: number) {
if (!this.colliding_x && !this.colliding_z) return;
const blocked = (x: number, y: number, z: number) =>
this.level.is_liquid(x, y, z) || this.level.collision_shape(x, y, z);
this.level.is_fluid(x, y, z) || this.level.collision_shape(x, y, z);
const dy = from_y - this.y + this.vy * TICK_DELTA + WATER_HOP_HEIGHT;
if (physics.box_is_free(this, this.vx * TICK_DELTA, dy, this.vz * TICK_DELTA, blocked)) this.vy = WATER_HOP;
}